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
sourceimpl 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
sourceimpl Clone for MsgExtEvent
impl Clone for MsgExtEvent
sourcefn clone(&self) -> MsgExtEvent
fn clone(&self) -> MsgExtEvent
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl ConcreteMessage for MsgExtEvent
impl ConcreteMessage for MsgExtEvent
sourceconst MESSAGE_TYPE: u16
const MESSAGE_TYPE: u16
The message type.
sourceconst MESSAGE_NAME: &'static str
const MESSAGE_NAME: &'static str
The message name.
sourceimpl Debug for MsgExtEvent
impl Debug for MsgExtEvent
sourceimpl From<MsgExtEvent> for Sbp
impl From<MsgExtEvent> for Sbp
sourcefn from(msg: MsgExtEvent) -> Self
fn from(msg: MsgExtEvent) -> Self
Performs the conversion.
sourceimpl SbpMessage for MsgExtEvent
impl SbpMessage for MsgExtEvent
sourcefn message_name(&self) -> &'static str
fn message_name(&self) -> &'static str
Get the message name.
sourcefn message_type(&self) -> u16
fn message_type(&self) -> u16
Get the message type.
sourcefn set_sender_id(&mut self, new_id: u16)
fn set_sender_id(&mut self, new_id: u16)
Set the sender id.
sourcefn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Number of bytes this message will take on the wire.
Auto Trait Implementations
impl RefUnwindSafe for MsgExtEvent
impl Send for MsgExtEvent
impl Sync for MsgExtEvent
impl Unpin for MsgExtEvent
impl UnwindSafe for MsgExtEvent
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more