#[repr(u8)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum FaaMode {
Autonomous = b'A',
Differential = b'D',
Estimated = b'E',
Manual = b'M',
Simulator = b'S',
Invalid = b'N',
RtkFloat = b'F',
RtkFixed = b'R',
Precise = b'P',
}
impl FaaMode {
#[must_use]
pub fn parse(raw: &str) -> Option<Self> {
match raw.as_bytes().first() {
Some(&b'A') => Some(Self::Autonomous),
Some(&b'D') => Some(Self::Differential),
Some(&b'E') => Some(Self::Estimated),
Some(&b'M') => Some(Self::Manual),
Some(&b'S') => Some(Self::Simulator),
Some(&b'N') => Some(Self::Invalid),
Some(&b'F') => Some(Self::RtkFloat),
Some(&b'R') => Some(Self::RtkFixed),
Some(&b'P') => Some(Self::Precise),
_ => None,
}
}
}