mavlink/
lib.rs

1#![cfg_attr(not(feature = "std"), no_std)]
2#![cfg_attr(all(any(docsrs, doc), not(doctest)), feature(doc_auto_cfg))]
3
4//! Rust implementation of the MAVLink UAV messaging protocol, with bindings for all dialects.
5//! This crate provides message set code generation, packet building, parsing and connection handling for blocking and asynchronous I/O.
6//!
7//! # Feature flags
8//! The `mavlink` crate uses a number of [feature flags] to reduce the amount of compiled code by making certain functions and MAVLink message sets (dialects) optional.
9//! These feature flags are available to control the provided functionalities:
10//!
11//! - `std`: Enables the usage of `std` in `mavlink`, enabled by default, this can be disabled for embedded applications.
12//! - `direct-serial`: Enable serial MAVLink connections, enabled by default.
13//! - `udp`: Enables UDP based MAVLink connections, enabled by default.
14//! - `tcp`: Enables TCP based MAVLink connections, enabled by default.
15//! - `signing`: Enable support for [MAVLink 2 message signing]
16//! - `embedded`: Enables embedded support using the [embedded-io] crate, incompatible with `embedded-hal-02` and `tokio-1`.
17//! - `embedded-hal-02`: Enables embedded support using version 0.2 of the [embedded-hal] crate, incompatible with `embedded`.
18//! - `tokio-1`: Enable support for asynchronous I/O using [tokio], incompatible with `embedded`.
19//! - `serde`: Enables [serde] support in generated message sets, enabled by default.
20//! - `format-generated-code`: Generated MAVLink message set code will be formatted.
21//! - `emit-description`: Generated MAVLink message set code will include documentation.
22//! - `emit-extensions`: Generated MAVLink message set code will include [MAVLink 2 message extensions].
23//! - `arbitrary`: Enable support for the [arbitrary] crate.
24//!
25//! Either `std`, `embedded` or `embedded-hal-02` must be enabled.
26//!
27//! Each MAVlink message set (dialect) can be enabled using its feature flag. The following message set feature flags are available:
28//! - `ardupilotmega`, enabled by default
29//! - `common`, enabled by default
30//! - `all`, this includes all other sets in the same message set
31//! - `asluav`
32//! - `avssuas`
33//! - `cubepilot`
34//! - `csairlink`
35//! - `development`
36//! - `icarous`
37//! - `loweheiser`
38//! - `matrixpilot`
39//! - `minimal`
40//! - `paparazzi`
41//! - `python_array_test`
42//! - `slugs`
43//! - `standard`
44//! - `storm32`
45//! - `test`
46//! - `ualberta`
47//! - `uavionix`
48//!
49//! The `all-dialects` feature enables all message sets except `all`.
50//!
51//! [feature flags]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section
52//! [MAVLink 2 message signing]: https://mavlink.io/en/guide/message_signing.html
53//! [MAVLink 2 message extensions]: https://mavlink.io/en/guide/define_xml_element.html#message_extensions
54//! [embedded-io]: https://crates.io/crates/embedded-io
55//! [embedded-hal]: https://crates.io/crates/embedded-hal
56//! [tokio]: https://crates.io/crates/tokio
57//! [serde]: https://crates.io/crates/serde
58//! [arbitrary]: https://crates.io/crates/arbitrary
59
60// include generate definitions
61include!(concat!(env!("OUT_DIR"), "/mod.rs"));
62
63pub use mavlink_core::*;
64
65#[cfg(feature = "emit-extensions")]
66#[allow(unused_imports)]
67pub(crate) use mavlink_core::utils::RustDefault;