7 package com.MAVLink.Messages;
9 import java.nio.ByteBuffer;
33 payload = ByteBuffer.allocate(payloadSize);
45 public void add(byte c) {
136 return Float.intBitsToFloat(
getInt());
144 if(data < UNSIGNED_BYTE_MIN_VALUE || data > UNSIGNED_BYTE_MAX_VALUE){
145 throw new IllegalArgumentException(
"Value is outside of the range of an unsigned byte: " + data);
152 add((byte) (data >> 0));
153 add((byte) (data >> 8));
157 if(data < UNSIGNED_SHORT_MIN_VALUE || data > UNSIGNED_SHORT_MAX_VALUE){
158 throw new IllegalArgumentException(
"Value is outside of the range of an unsigned short: " + data);
165 add((byte) (data >> 0));
166 add((byte) (data >> 8));
167 add((byte) (data >> 16));
168 add((byte) (data >> 24));
172 if(data < UNSIGNED_INT_MIN_VALUE || data > UNSIGNED_INT_MAX_VALUE){
173 throw new IllegalArgumentException(
"Value is outside of the range of an unsigned int: " + data);
180 add((byte) (data >> 0));
181 add((byte) (data >> 8));
182 add((byte) (data >> 16));
183 add((byte) (data >> 24));
184 add((byte) (data >> 32));
185 add((byte) (data >> 40));
186 add((byte) (data >> 48));
187 add((byte) (data >> 56));
192 throw new IllegalArgumentException(
"Value is outside of the range of an unsigned long: " + data);
199 putInt(Float.floatToIntBits(data));
void putUnsignedInt(long data)
void putFloat(float data)
static final long UNSIGNED_LONG_MIN_VALUE
void putShort(short data)
void putUnsignedByte(short data)
void putUnsignedShort(int data)
static final byte UNSIGNED_BYTE_MIN_VALUE
static final short UNSIGNED_BYTE_MAX_VALUE
void putUnsignedLong(long data)
static final short UNSIGNED_SHORT_MIN_VALUE
static final int MAX_PAYLOAD_SIZE
static final long UNSIGNED_INT_MAX_VALUE
static final int UNSIGNED_SHORT_MAX_VALUE
static final int UNSIGNED_INT_MIN_VALUE