Struct MavlinkFrame
MAVLink v2 wire frame: [0xFD][len][incompat][compat][seq][sysid][compid][msgid(3)][payload][crc(2)].
public readonly ref struct MavlinkFrame
- Inherited Members
Properties
CompatFlags
Compatibility flags; unknown bits are ignored by receivers.
public byte CompatFlags { get; }
Property Value
ComponentId
Sender component id.
public byte ComponentId { get; }
Property Value
IncompatFlags
Incompatibility flags; any unknown bit causes the frame to be dropped.
public byte IncompatFlags { get; }
Property Value
MessageId
24-bit MAVLink message id.
public uint MessageId { get; }
Property Value
Payload
Decoded payload bytes (length = PayloadLength). Slice of the original buffer — do not hold past the buffer's lifetime.
public ReadOnlySpan<byte> Payload { get; }
Property Value
PayloadLength
Number of payload bytes on the wire (0–255).
public byte PayloadLength { get; }
Property Value
Sequence
Packet sequence number, wraps at 255.
public byte Sequence { get; }
Property Value
SystemId
Sender system id (1–255).
public byte SystemId { get; }
Property Value
Methods
TryDecode(ReadOnlySpan<byte>, out MavlinkFrame)
Attempt to decode a MAVLink v2 frame. Returns false if:
- data too short / not v2 magic / signed frame (we don't handle signatures yet)
- msgid is unknown to the registry — without CrcExtra we can't verify the frame
- payload length is outside [MinPayloadLength, MaxPayloadLength] for this msgid
- declared payload length doesn't fit in the buffer
- CRC doesn't match the per-msgid CRC_EXTRA from MessageRegistry
public static bool TryDecode(ReadOnlySpan<byte> data, out MavlinkFrame frame)
Parameters
dataReadOnlySpan<byte>frameMavlinkFrame