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
mod incompat_flags {
    use bitflags::bitflags;

    use crate::consts::MAVLINK_IFLAG_SIGNED;

    /// `MAVLink 2` incompatibility flags.
    ///
    /// First bit is [`MAVLINK_IFLAG_SIGNED`] as required by
    /// [specification]((https://mavlink.io/en/guide/serialization.html#incompat_flags)).
    ///
    /// Other bit flags are named according to powers of 2 in little endian.
    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
    #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
    pub struct IncompatFlags(u8);
    bitflags! {
        impl IncompatFlags: u8 {
            /// Signed message flag.
            ///
            /// Controls [message signing](https://mavlink.io/en/guide/message_signing.html) for
            /// `MAVLink 2` protocol.
            const MAVLINK_IFLAG_SIGNED = MAVLINK_IFLAG_SIGNED;
            /// Second bit.
            const BIT_2 = 1 << 1;
            /// Third bit.
            const BIT_3 = 1 << 2;
            /// Fourth bit.
            const BIT_4 = 1 << 3;
            /// Fifth bit.
            const BIT_5 = 1 << 4;
            /// Sixth bit.
            const BIT_6 = 1 << 5;
            /// Seventh bit.
            const BIT_7 = 1 << 6;
            /// Eighth bit.
            const BIT_8 = 1 << 7;
        }
    }
}
pub use incompat_flags::IncompatFlags;

mod compat_flags {
    use bitflags::bitflags;

    /// `MAVLink 2` compatibility flags.
    ///
    /// Bit flags are named according to powers of 2 in little endian.
    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
    #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
    pub struct CompatFlags(u8);
    bitflags! {
        impl CompatFlags: u8 {
            /// Fist bit.
            const BIT_1 = 1;
            /// Second bit.
            const BIT_2 = 1 << 1;
            /// Third bit.
            const BIT_3 = 1 << 2;
            /// Fourth bit.
            const BIT_4 = 1 << 3;
            /// Fifth bit.
            const BIT_5 = 1 << 4;
            /// Sixth bit.
            const BIT_6 = 1 << 5;
            /// Seventh bit.
            const BIT_7 = 1 << 6;
            /// Eighth bit.
            const BIT_8 = 1 << 7;
        }
    }
}
pub use compat_flags::CompatFlags;