pub struct MAVLinkV1MessageRaw(/* private fields */);Expand description
Byte buffer containing the raw representation of a MAVLink 1 message beginning with the STX marker.
Follow protocol definition: https://mavlink.io/en/guide/serialization.html#v1_packet_format. Maximum size is 263 bytes.
Implementations§
Source§impl MAVLinkV1MessageRaw
impl MAVLinkV1MessageRaw
Sourcepub const fn from_bytes_unparsed(bytes: [u8; 263]) -> Self
pub const fn from_bytes_unparsed(bytes: [u8; 263]) -> Self
Create a new raw MAVLink 1 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; 263]
pub fn into_inner(self) -> [u8; 263]
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 component_id(&self) -> u8
pub fn component_id(&self) -> u8
Message sender Component ID
Sourcepub fn message_id(&self) -> u8
pub fn message_id(&self) -> u8
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)
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.
Sourcepub fn serialize_message_data<D: MessageData>(
&mut self,
header: MavHeader,
message_data: &D,
)
pub fn serialize_message_data<D: MessageData>( &mut self, header: MavHeader, message_data: &D, )
§Panics
If the MavHeader’s sytem_id or the MessageData’s ID exceeds 255 and is therefore not supported for MAVLink 1