apis_saltans_aps/frame/extended/
control.rs1use bitflags::bitflags;
2use le_stream::{FromLeStream, ToLeStream};
3
4#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Hash, FromLeStream, ToLeStream)]
6#[repr(transparent)]
7pub struct Control(u8);
8
9bitflags! {
10 impl Control: u8 {
11 const FRAGMENTATION = 0b1100_0000;
13
14 const RESERVED = 0b0011_1111;
16
17 const FIRST_FRAGMENT = 0b0100_0000;
19
20 const FOLLOWUP_FRAGMENT = 0b1000_0000;
22 }
23}
24
25impl core::fmt::Display for Control {
26 fn fmt(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
27 bitflags::parser::to_writer(self, formatter)
28 }
29}
30
31impl core::str::FromStr for Control {
32 type Err = bitflags::parser::ParseError;
33
34 fn from_str(flags: &str) -> Result<Self, Self::Err> {
35 bitflags::parser::from_str(flags)
36 }
37}