MavDataEncoder

interface MavDataEncoder

Writes primitives to a ByteArray according to the little-endian byte order.

Properties

Link copied to clipboard
abstract val bytes: ByteArray

The ByteArray into which the data is written.

Link copied to clipboard
abstract val remaining: Int

The number of bytes remaining to be written.

Functions

Link copied to clipboard
fun MavDataEncoder.encodeBitmaskValue(value: UInt, dataSize: Int)

Encodes the given UInt MAVLink bitmask value into a ByteArray of size dataSize, writes it to the array's current position, and then increments the position.

Link copied to clipboard
abstract fun encodeByte(value: Byte)

Writes the given Byte into the array's current position, and then increments the position.

Link copied to clipboard
abstract fun encodeByteArray(src: ByteArray, offset: Int = 0, length: Int = src.size)

Writes length number of bytes from src into the array with the given offset, and then increments the position.

Link copied to clipboard

Writes the given Char/UInt64 to the array's current position, and then increments the position.

Link copied to clipboard

Writes the given Double/Float64 to the array's current position, and then increments the position.

Link copied to clipboard

Encodes the given List of Double/Float64 into a ByteArray of size dataSize, writes it to the array's current position, and then increments the position.

Link copied to clipboard
fun MavDataEncoder.encodeEnumValue(value: UInt, dataSize: Int)

Encodes the given UInt MAVLink enum value into a ByteArray of size dataSize, writes it to the array's current position, and then increments the position.

Link copied to clipboard

Writes the given Float/Float32 to the array's current position, and then increments the position.

Link copied to clipboard

Encodes the given List of Float/Float32 into a ByteArray of size dataSize, writes it to the array's current position, and then increments the position.

Link copied to clipboard
abstract fun encodeInt(value: Int)

Writes the given Int into the array's current position, and then increments the position.

Link copied to clipboard

Writes the given Short/Int16 to the array's current position, and then increments the position.

Link copied to clipboard

Encodes the given List of Short/Int16 into a ByteArray of size dataSize, writes it to the array's current position, and then increments the position.

Link copied to clipboard

Writes the given Int/Int32 to the array's current position, and then increments the position.

Link copied to clipboard

Encodes the given List of Int/Int32 into a ByteArray of size dataSize, writes it to the array's current position, and then increments the position.

Link copied to clipboard

Writes the given Long/Int64 to the array's current position, and then increments the position.

Link copied to clipboard

Encodes the given List of Long/Int64 into a ByteArray of size dataSize, writes it to the array's current position, and then increments the position.

Link copied to clipboard

Writes the given Byte/Int8 to the array's current position, and then increments the position.

Link copied to clipboard

Encodes the given List of Byte/Int8 into a ByteArray of size dataSize, writes it to the array's current position, and then increments the position.

Link copied to clipboard
fun MavDataEncoder.encodeInteger(value: Long, dataSize: Int)

Encodes the given Long into a ByteArray of size dataSize, writes it to the array's current position, and then increments the position.

Link copied to clipboard
abstract fun encodeLong(value: Long)

Writes the given Long into the array's current position, and then increments the position.

Link copied to clipboard
abstract fun encodeShort(value: Short)

Writes the given Short into the array's current position, and then increments the position.

Link copied to clipboard
fun MavDataEncoder.encodeString(value: String, length: Int)

Writes the given String to the array's current position, and then increments the position. If the encoded String is shorter than the length parameter then the remaining positions are filled with empty characters.

Link copied to clipboard

Writes the given UShort/UInt16 to the array's current position, and then increments the position.

Link copied to clipboard

Encodes the given List of UShort/UInt16 into a ByteArray of size dataSize, writes it to the array's current position, and then increments the position.

Link copied to clipboard

Writes the given UInt/UInt32 to the array's current position, and then increments the position.

Link copied to clipboard

Encodes the given List of UInt/UInt32 into a ByteArray of size dataSize, writes it to the array's current position, and then increments the position.

Link copied to clipboard

Writes the given ULong/UInt64 to the array's current position, and then increments the position.

Link copied to clipboard

Encodes the given List of ULong/UInt64 into a ByteArray of size dataSize, writes it to the array's current position, and then increments the position.

Link copied to clipboard

Writes the given UByte/UInt8 to the array's current position, and then increments the position.

Link copied to clipboard

Encodes the given List of UByte/UInt8 into a ByteArray of size dataSize, writes it to the array's current position, and then increments the position.