Crate mavlink_message_definitions

Source
Expand description

πŸ‡ΊπŸ‡¦ repository crates.io docs.rs issues

This is a very simple crate with the whole purpose to collect MAVLink message definitions using MAVInspect. It is used by MAVSpec as a source of truth about MAVLink dialect specification.

Upstream crates that use Mavka toolchain can use Cargo patch mechanism to replace this crate and therefore change which dialects will be packaged. The latter may be combined with extra-dialects feature flag that enforces inclusion of all extra dialects.

Β§Usage

⚠️ Make sure that you’ve enabled the std feature when using this crate without default features.

Use protocol function to get metadata for the entire set of MAVLink dialects.

let protocol = mavlink_message_definitions::protocol();
let common = protocol.get_dialect_by_name("common").unwrap();
let heartbeat_message = common.get_message_by_name("HEARTBEAT").unwrap();
assert_eq!(heartbeat_message.defined_in(), "minimal");

Β§Development

The main development workflow for this crate involves inclusion into MAVSpec as a submodule.

Β§Feature flags

Β§Generic features

  • default β€” Default features (std is enabled)

  • std (enabled by default) β€” Enable standard library support.

    Without this feature the library will be essentially empty.

  • compress β€” Compress the protocol definition

Β§Dialects

Bundle standard MAVLink dialects as defined in XML message definitions.

Enabling any of dlct-* features will bundle corresponding dialect.

In case you want to patch mavspec-definitions, you might be interested in enabling extra-dialects feature.

  • dlct-ardupilotmega β€” Include ardupilotmega dialect

  • dlct-asluav β€” Include ASLUAV dialect

  • dlct-avssuas β€” Include AVSSUAS dialect

  • dlct-common β€” Include common dialect

  • dlct-cs_air_link β€” Include csAirLink dialect

  • dlct-cubepilot β€” Include cubepilot dialect

  • dlct-development β€” Include development dialect

  • dlct-icarous β€” Include icarous dialect

  • dlct-matrixpilot β€” Include matrixpilot dialect

  • dlct-minimal β€” Include minimal dialect

  • dlct-paparazzi β€” Include paparazzi dialect

  • dlct-standard β€” Include standard dialect

  • dlct-ualberta β€” Include ualberta dialect

  • dlct-uavionix β€” Include uAvionix dialect

  • dlct-all β€” Include all meta-dialect

  • extra-dialects β€” Enables extra dialects

    Downstream crates can patch mavspec-definitions adding extra MAVLink dialects.

  • test-dialects β€” Enables test dialects

    These dialects are useful for checking various test cases.

ConstantsΒ§

DEFAULT_DIALECT_SEQUENCE
The sequence of default dialects from the most feature-rich to the most primitive.

FunctionsΒ§

protocol
Metadata for MAVLink dialects generated by MAVInspect.