pub struct MAVLinkV2MessageRaw(/* private fields */);Expand description
Byte buffer containing the raw representation of a MAVLink 2 message beginning with the STX marker.
Follow protocol definition: https://mavlink.io/en/guide/serialization.html#mavlink2_packet_format. Maximum size is 280 bytes.
Implementations§
Source§impl MAVLinkV2MessageRaw
impl MAVLinkV2MessageRaw
Sourcepub const fn from_bytes_unparsed(bytes: [u8; 283]) -> Self
pub const fn from_bytes_unparsed(bytes: [u8; 283]) -> Self
Create a new raw MAVLink 2 message from a given buffer.
Note: This method does not guarantee that the constructed MAVLink message is valid.
Sourcepub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Mutable reference to its internal buffer.
Sourcepub fn into_inner(self) -> [u8; 283]
pub fn into_inner(self) -> [u8; 283]
Deconstruct the MAVLink message into its owned internal buffer.
Sourcepub fn payload_length(&self) -> u8
pub fn payload_length(&self) -> u8
Size of the payload of the message
Sourcepub fn incompatibility_flags(&self) -> u8
pub fn incompatibility_flags(&self) -> u8
Incompatiblity flags of the message
Currently the only supported incompatebility flags are consts::v2::IFLAG_SIGNED and consts::v2::IFLAG_SYSID32.
Sourcepub fn incompatibility_flags_mut(&mut self) -> &mut u8
pub fn incompatibility_flags_mut(&mut self) -> &mut u8
Mutable reference to the incompatiblity flags of the message
Currently the only supported incompatebility flags are consts::v2::IFLAG_SIGNED and consts::v2::IFLAG_SYSID32.
Sourcepub fn compatibility_flags(&self) -> u8
pub fn compatibility_flags(&self) -> u8
Compatibility Flags of the message
Sourcepub fn component_id(&self) -> u8
pub fn component_id(&self) -> u8
Message sender Component ID
Sourcepub fn message_id(&self) -> u32
pub fn message_id(&self) -> u32
Message ID
Sourcepub fn checksum(&self) -> u16
pub fn checksum(&self) -> u16
CRC-16 checksum field of the message
Sourcepub fn has_valid_crc<M: Message>(&self) -> bool
pub fn has_valid_crc<M: Message>(&self) -> bool
Checks wether the message’s CRC-16 checksum calculation matches its checksum field.
Sourcepub fn has_valid_crc_with_extra_crc(&self, extra_crc: u8) -> bool
pub fn has_valid_crc_with_extra_crc(&self, extra_crc: u8) -> bool
Checks whether this message’s checksum matches a supplied MAVLink CRC extra byte. This is useful for dialects loaded at runtime.
Sourcepub fn serialize_message<M: Message>(&mut self, header: MavHeader, message: &M)
pub fn serialize_message<M: Message>(&mut self, header: MavHeader, message: &M)
Serialize a Message with a given header into this raw message buffer.
This does not set any compatiblity or incompatiblity flags.
Sourcepub fn serialize_message_with_dialect<D: Dialect>(
&mut self,
header: MavHeader,
dialect: &D,
message: &D::Message,
) -> Result<(), EncoderError>
pub fn serialize_message_with_dialect<D: Dialect>( &mut self, header: MavHeader, dialect: &D, message: &D::Message, ) -> Result<(), EncoderError>
Serialize a message through an instance-backed dialect.