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
//! **MAVSpec** is a library for parsing MAVLink
//! [message definitions](https://github.com/mavlink/mavlink/tree/master/message_definitions/v1.0).
//!
//! Repository: [https://gitlab.com/mavka/libs/mavspec](https://gitlab.com/mavka/libs/mavspec).
//!
//! > ### WARNING!!!
//! >
//! > This project is intended to be used with other [Mavka](https://gitlab.com/mavka) tools. For
//! > now its API is still unstable. Once the library will be successfully consumed by these
//! > projects, API will be eventually stabilised.
//!
//! # Usage
//!
//! ```rust
//! use std::env;
//!
//! use mavspec::parser::XMLInspector;
//!
//! // Instantiate inspector and load list of XML definitions
//! let inspector = XMLInspector::new(vec![
//! "./message_definitions/standard".to_string(),
//! "./message_definitions/extra".to_string(),
//! ])
//! .unwrap();
//!
//! // Parse all XML definitions
//! let protocol = inspector.parse().unwrap();
//!
//! // Get `crazyflight` custom dialect
//! let crazyflight = protocol.dialects().get("crazyflight").unwrap();
//!
//! // Get `DUMMYFLIGHT_OUTCRY` message
//! let outcry_message = crazyflight.messages().get(&54000u32).unwrap();
//! assert_eq!(outcry_message.name(), "CRAZYFLIGHT_OUTCRY");
//! println!("\n`CRAZYFLIGHT_OUTCRY` message: {:#?}", outcry_message);
//! ```
//!
//! # Features
//!
//! * `serde` — add [Serde](https://serde.rs) support.
// MAVLink protocol parser.
// MAVLink protocol entities.