1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/// <sup>[`mavspec`](https://crates.io/crates/mavspec)</sup>
/// [MAVSpec](https://crates.io/crates/mavspec) re-exported
///
/// We re-export MAVSpec in order to simplify interoperability with the tools provided by this
/// library.
///
/// For example, [`derive`](mod@derive) proc macros depends on [`mavspec::rust::spec`] being
/// accessible.
///
/// ---
pub use mavspec;
/// <sup>[`mavspec`](https://crates.io/crates/mavspec)</sup>
/// MAVLink dialects
///
/// These dialects are generated by [MAVSpec](https://crates.io/crates/mavspec).
///
/// Each dialect belongs to a specific module, such as:
///
/// - [`minimal`](crate::protocol::dialects::minimal)
/// - [`common`](crate::protocol::dialects::common)
/// - [`ardupilotmega`](crate::protocol::dialects::ardupilotmega)
/// - ... and so on
///
/// Re-exported from [`mavspec::rust::dialects`].
///
/// ---
pub use dialects;
/// <sup>[`mavspec`](https://crates.io/crates/mavspec)</sup>
/// Default MAVLink dialect module
///
/// Similar to [`DefaultDialect`] but provides access to a dialect module instead of dialect itself.
///
/// See [`DefaultDialect`] to learn about logic behind choosing a default dialect.
///
/// # Usage
///
/// ```rust,no_run
/// use maviola::protocol::default_dialect;
///
/// let message = default_dialect::messages::Heartbeat::default();
/// ```
///
/// Requires at least `dlct-minimal` dialect feature flag to be enabled.
///
/// Re-exported from [`mavspec::rust::default_dialect`].
///
/// ---
pub use default_dialect;
/// <sup>[`mavspec`](https://crates.io/crates/mavspec)</sup>
/// Default MAVLink dialect
///
/// The rules for determining the default dialect are defined by the following order of canonical dialect inclusion:
///
/// [`all`](https://mavlink.io/en/messages/all.html) >
/// [`ardupilotmega`](https://mavlink.io/en/messages/common.html) >
/// [`common`](https://mavlink.io/en/messages/common.html) >
/// [`standard`]((https://mavlink.io/en/messages/standard.html))
/// [`minimal`]((https://mavlink.io/en/messages/minimal.html))
///
/// That means, that if you enabled `dlct-ardupilotmega` dialect but not `all`, then the former is the
/// most general canonical dialect, and it will be chosen as a default one.
///
/// Requires at least `dlct-minimal` dialect feature flag to be enabled.
///
/// Re-exported from [`mavspec::rust::DefaultDialect`].
///
/// ---
pub use DefaultDialect;
/// <sup>[`mavspec`](https://crates.io/crates/mavspec)</sup>
/// MAVLink [microservices](https://mavlink.io/en/services/)
///
/// Enabled by `msrv-*` feature flags, additional tools are available as [`microservices::utils`]
/// via `msrv-utils-*` feature flags (requires `unstable` feature).
///
/// Re-exported from [`mavspec::rust::microservices`].
///
/// ---
pub use microservices;
/// <sup>[`mavspec`](https://crates.io/crates/mavspec)</sup>
/// MAVLink message definitions
///
/// Requires `definitions` feature flag to be enabled.
///
/// <section class="warning">
/// Requires `std` feature flag to be enabled. Otherwise, the library won't compile.
/// </section>
///
/// Re-exported from [`mavspec::definitions`].
///
/// ---
pub use definitions;
/// <sup>[`mavspec`](https://crates.io/crates/mavspec)</sup>
/// MAVSpec procedural macros
///
/// Since derive macros relies on entities from [`mavspec::rust::spec`], you have to import
/// [`mavio::protocol::mavspec`](crate::protocol::mavspec) or use [`prelude`](crate::prelude). For example:
///
/// ```rust
/// #[cfg(feature = "derive")]
/// # {
/// use maviola::prelude::*; // This is necessary!!!
/// use maviola::protocol::derive::Enum;
///
/// #[derive(Enum)]
/// #[repr(u8)]
/// #[derive(Copy, Clone, Debug, Default)]
/// enum CustomEnum {
/// #[default]
/// DEFAULT = 0,
/// OptionA = 1,
/// OptionB = 2,
/// }
/// # }
/// ```
///
/// Requires `derive` feature flag to be enabled.
///
/// Re-exported from [`mavspec::rust::derive`].
///
/// ---
pub use derive;