Expand description
C FFI bindings for the mavwire MAVLink v1/v2 decoder.
Exposes a decode-only subset of mavwire’s API: decode a single v2 (or
v1) frame from a raw byte buffer into an opaque message handle, then
read its fields via a mavwire_message_as_<type> function that fills a
plain C struct - one call per message, rather than one accessor call
per field, since MAVLink has many small messages with several fields
each. See include/mavwire.h for the generated C declarations.
This crate is a plain (non-no_std) library: it targets host
environments linking a shared or static C library, not the embedded
no_alloc use case mavwire itself supports. Embedded consumers
should use the mavwire Rust crate directly.
Structs§
- Mavwire
Attitude - ATTITUDE (id 30): roll/pitch/yaw and their rates.
- Mavwire
Command Ack COMMAND_ACK(id 77): the result of executing aCOMMAND_LONG.- Mavwire
Command Long COMMAND_LONG(id 76): sends a command with up to seven parameters.- Mavwire
Global Position Int GLOBAL_POSITION_INT(id 33): fused global position.- Mavwire
GpsRaw Int GPS_RAW_INT(id 24): raw GPS fix.- Mavwire
Heartbeat - HEARTBEAT (id 0): system presence/type/mode.
- Mavwire
Message - Opaque handle to a decoded
MAVLinkmessage, owned by the caller until freed withmavwire_message_free. - Mavwire
Param Value PARAM_VALUE(id 22): a single parameter’s current value.- Mavwire
RcChannels RC_CHANNELS(id 65): raw RC receiver channel values.- Mavwire
Status Text STATUSTEXT(id 253): a human-readable status/log message.- Mavwire
SysStatus SYS_STATUS(id 1): onboard sensor and battery health.- Mavwire
VfrHud VFR_HUD(id 74): airspeed/altitude/heading HUD data.
Enums§
- Mavwire
Error - Error codes returned by
mavwire_decode.
Functions§
- mavwire_
decode ⚠ - Decodes a single
MAVLinkv1 or v2 frame from the start ofbuf(lenbytes long).bufmay contain trailing bytes after the frame (e.g. the start of the next frame in a stream); only the leading frame is parsed. - mavwire_
message_ ⚠as_ attitude - Reads this message’s fields into
*outif it is an ATTITUDE message. - mavwire_
message_ ⚠as_ command_ ack - Reads this message’s fields into
*outif it is aCOMMAND_ACKmessage. - mavwire_
message_ ⚠as_ command_ long - Reads this message’s fields into
*outif it is aCOMMAND_LONGmessage. - mavwire_
message_ ⚠as_ global_ position_ int - Reads this message’s fields into
*outif it is aGLOBAL_POSITION_INTmessage. - mavwire_
message_ ⚠as_ gps_ raw_ int - Reads this message’s fields into
*outif it is aGPS_RAW_INTmessage. - mavwire_
message_ ⚠as_ heartbeat - Reads this message’s fields into
*outif it is a HEARTBEAT message. - mavwire_
message_ ⚠as_ param_ value - Reads this message’s fields into
*outif it is aPARAM_VALUEmessage. - mavwire_
message_ ⚠as_ rc_ channels - Reads this message’s fields into
*outif it is anRC_CHANNELSmessage. - mavwire_
message_ ⚠as_ statustext - Reads this message’s fields into
*outif it is aSTATUSTEXTmessage. - mavwire_
message_ ⚠as_ sys_ status - Reads this message’s fields into
*outif it is aSYS_STATUSmessage. - mavwire_
message_ ⚠as_ vfr_ hud - Reads this message’s fields into
*outif it is aVFR_HUDmessage. - mavwire_
message_ ⚠component_ id - The sending component’s ID, or
0for a NULL handle. - mavwire_
message_ ⚠free - Frees a message handle returned by
mavwire_decode. Passing NULL is a no-op. - mavwire_
message_ ⚠id - The message’s
MAVLinkmessage id (e.g.0for HEARTBEAT), or0xFFFFFFFFfor a NULL handle. - mavwire_
message_ ⚠sequence - The frame’s sequence number, or
0for a NULL handle. - mavwire_
message_ ⚠system_ id - The sending system’s ID, or
0for a NULL handle. - mavwire_
version - The
mavwirecrate version, as a NUL-terminated, statically allocated string (e.g."0.1.0"). Do not free.