Skip to main content

Crate mavwire

Crate mavwire 

Source
Expand description

A no_std, allocation-free parser and encoder for MAVLink v1/v2 telemetry messages, the wire protocol used by most drone/autopilot flight stacks (ArduPilot, PX4) and ground control stations.

§Layering

  • frame parses/encodes the raw v1/v2 wire framing and CRC.
  • crc is MAVLink’s CRC-16/MCRF4XX checksum.
  • message decodes/encodes a frame’s payload into a typed MavMessage, one variant per supported message id, verifying the checksum along the way (using the message’s crc_extra byte, which only this layer knows how to look up).

§No allocation

Nothing in this crate uses alloc.

Re-exports§

pub use error::MavError;
pub use frame::Frame;
pub use message::MavMessage;

Modules§

crc
MAVLink’s CRC-16/MCRF4XX checksum, plus the per-message CRC_EXTRA byte that also catches a sender/receiver message-definition mismatch, not just bit errors.
error
Error types for the frame and message layers.
frame
Raw MAVLink v1/v2 frame parsing and v2 encoding.
message
Message-id-dispatched decoding/encoding of a frame’s payload into a typed MavMessage.

Functions§

decode
Parses and decodes a single MAVLink v1 or v2 frame from the start of buf.
encode_v2
Encodes a typed message into a v2 frame in buf, returning the number of bytes written.