Struct sbp::messages::navigation::msg_gps_time::MsgGpsTime
source · [−]pub struct MsgGpsTime {
pub sender_id: Option<u16>,
pub wn: u16,
pub tow: u32,
pub ns_residual: i32,
pub flags: u8,
}
Expand description
GPS Time
This message reports the GPS time, representing the time since the GPS epoch began on midnight January 6, 1980 UTC. GPS time counts the weeks and seconds of the week. The weeks begin at the Saturday/Sunday transition. GPS week 0 began at the beginning of the GPS time scale.
Within each week number, the GPS time of the week is between between 0 and 604800 seconds (=606024*7). Note that GPS time does not accumulate leap seconds, and as of now, has a small offset from UTC. In a message stream, this message precedes a set of other navigation messages referenced to the same time (but lacking the ns field) and indicates a more precise time of these messages.
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
Status flags (reserved)
Implementations
sourceimpl MsgGpsTime
impl MsgGpsTime
sourcepub fn time_source(&self) -> Result<TimeSource, u8>
pub fn time_source(&self) -> Result<TimeSource, u8>
Gets the TimeSource stored in the flags
bitfield.
Returns Ok
if the bitrange contains a known TimeSource
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 TimeSource
were added.
sourcepub fn set_time_source(&mut self, time_source: TimeSource)
pub fn set_time_source(&mut self, time_source: TimeSource)
Set the bitrange corresponding to the TimeSource of the flags
bitfield.
Trait Implementations
sourceimpl Clone for MsgGpsTime
impl Clone for MsgGpsTime
sourcefn clone(&self) -> MsgGpsTime
fn clone(&self) -> MsgGpsTime
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 MsgGpsTime
impl ConcreteMessage for MsgGpsTime
sourceconst MESSAGE_TYPE: u16 = 258u16
const MESSAGE_TYPE: u16 = 258u16
The message type.
sourceconst MESSAGE_NAME: &'static str = "MSG_GPS_TIME"
const MESSAGE_NAME: &'static str = "MSG_GPS_TIME"
The message name.
sourceimpl Debug for MsgGpsTime
impl Debug for MsgGpsTime
sourceimpl From<MsgGpsTime> for Sbp
impl From<MsgGpsTime> for Sbp
sourcefn from(msg: MsgGpsTime) -> Self
fn from(msg: MsgGpsTime) -> Self
Converts to this type from the input type.
sourceimpl SbpMessage for MsgGpsTime
impl SbpMessage for MsgGpsTime
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 MsgGpsTime
impl Send for MsgGpsTime
impl Sync for MsgGpsTime
impl Unpin for MsgGpsTime
impl UnwindSafe for MsgGpsTime
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more