MavRawFrame

data class MavRawFrame(val stx: UByte, val len: UByte, val incompatFlags: UByte, val compatFlags: UByte, val seq: UByte, val systemId: UByte, val componentId: UByte, val messageId: UInt, val payload: ByteArray, val checksum: UShort, val signatureLinkId: UByte, val signatureTimestamp: UInt, val signature: ByteArray, val rawBytes: ByteArray)

Represents a mid-level MAVLink Frame, i.e., a frame that is in between a fully deserialized high-level object, and a wire-format ByteArray.

Note: Several functions of this class are not fault-tolerant. They assume that the input raw bytes are valid ByteArrays. For example, generateSignature assumes that its input frameBytes is a correct MAVLink v2 frame in the form of raw bytes. Therefore, the users of this class should be careful while using it.

Refer: MAVLink Serialization

Constructors

Link copied to clipboard
constructor(stx: UByte, len: UByte, incompatFlags: UByte, compatFlags: UByte, seq: UByte, systemId: UByte, componentId: UByte, messageId: UInt, payload: ByteArray, checksum: UShort, signatureLinkId: UByte, signatureTimestamp: UInt, signature: ByteArray, rawBytes: ByteArray)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
object Flags
Link copied to clipboard
object Sizes
Link copied to clipboard
object Stx

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns true if the frame is a signed MAVLink v2 frame, false otherwise.

Link copied to clipboard
val len: UByte
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val seq: UByte
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val stx: UByte
Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun validateCrc(crcExtra: Byte): Boolean

Validates the frame's checksum using the MAVLink message crcExtra and the frame's rawBytes.

Link copied to clipboard

Validates the frame's signature using the given secretKey. If the secretKey's size is less than 32 then it is padded with zeroes. If the size is more than 32, then only the first 32 bytes are taken.