Struct sbp::messages::ext_events::msg_ext_event::MsgExtEvent
source · pub struct MsgExtEvent {
pub sender_id: Option<u16>,
pub wn: u16,
pub tow: u32,
pub ns_residual: i32,
pub flags: u8,
pub pin: u8,
}
Expand description
Reports timestamped external pin event
Reports detection of an external event, the GPS time it occurred, which pin it was and whether it was rising or falling.
Fields§
§sender_id: Option<u16>
The message sender_id
wn: u16
GPS week number
tow: u32
GPS time of week rounded to the nearest millisecond
ns_residual: i32
Nanosecond residual of millisecond-rounded TOW (ranges from -500000 to 500000)
flags: u8
Flags
pin: u8
Pin number. 0..9 = DEBUG0..9.
Implementations§
source§impl MsgExtEvent
impl MsgExtEvent
sourcepub fn time_quality(&self) -> Result<TimeQuality, u8>
pub fn time_quality(&self) -> Result<TimeQuality, u8>
Gets the TimeQuality stored in the flags
bitfield.
Returns Ok
if the bitrange contains a known TimeQuality
variant.
Otherwise the value of the bitrange is returned as an Err(u8)
. This may be because of a malformed message,
or because new variants of TimeQuality
were added.
sourcepub fn set_time_quality(&mut self, time_quality: TimeQuality)
pub fn set_time_quality(&mut self, time_quality: TimeQuality)
Set the bitrange corresponding to the TimeQuality of the flags
bitfield.
sourcepub fn new_level_of_pin(&self) -> Result<NewLevelOfPin, u8>
pub fn new_level_of_pin(&self) -> Result<NewLevelOfPin, u8>
Gets the NewLevelOfPin stored in the flags
bitfield.
Returns Ok
if the bitrange contains a known NewLevelOfPin
variant.
Otherwise the value of the bitrange is returned as an Err(u8)
. This may be because of a malformed message,
or because new variants of NewLevelOfPin
were added.
sourcepub fn set_new_level_of_pin(&mut self, new_level_of_pin: NewLevelOfPin)
pub fn set_new_level_of_pin(&mut self, new_level_of_pin: NewLevelOfPin)
Set the bitrange corresponding to the NewLevelOfPin of the flags
bitfield.
Trait Implementations§
source§impl Clone for MsgExtEvent
impl Clone for MsgExtEvent
source§fn clone(&self) -> MsgExtEvent
fn clone(&self) -> MsgExtEvent
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl ConcreteMessage for MsgExtEvent
impl ConcreteMessage for MsgExtEvent
source§const MESSAGE_TYPE: u16 = 257u16
const MESSAGE_TYPE: u16 = 257u16
source§const MESSAGE_NAME: &'static str = "MSG_EXT_EVENT"
const MESSAGE_NAME: &'static str = "MSG_EXT_EVENT"
source§impl Debug for MsgExtEvent
impl Debug for MsgExtEvent
source§impl<'de> Deserialize<'de> for MsgExtEvent
impl<'de> Deserialize<'de> for MsgExtEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl FriendlyName for MsgExtEvent
impl FriendlyName for MsgExtEvent
fn friendly_name() -> &'static str
source§impl From<MsgExtEvent> for Sbp
impl From<MsgExtEvent> for Sbp
source§fn from(msg: MsgExtEvent) -> Self
fn from(msg: MsgExtEvent) -> Self
source§impl PartialEq for MsgExtEvent
impl PartialEq for MsgExtEvent
source§fn eq(&self, other: &MsgExtEvent) -> bool
fn eq(&self, other: &MsgExtEvent) -> bool
self
and other
values to be equal, and is used
by ==
.