pub struct GnssSnapshot {
pub fix: FixKind,
pub altitude_m: Option<i32>,
pub accuracy_dm: Option<u16>,
pub sats_used: u8,
pub sats_in_view: Option<u8>,
/* private fields */
}Expand description
The receiver’s current view of position and constellation.
The default is what a disabled or searching receiver reports: no fix, no satellites, nothing positional to say.
Fields§
§fix: FixKindFix quality.
altitude_m: Option<i32>Altitude above the WGS-84 ellipsoid in meters, matching the units
of node identity option 2. None without a three-dimensional fix.
accuracy_dm: Option<u16>Estimated horizontal accuracy in decimeters.
sats_used: u8Satellites contributing to the solution.
sats_in_view: Option<u8>Satellites the receiver can see, whether or not they are used.
None when the receiver does not report it.
Implementations§
Source§impl GnssSnapshot
impl GnssSnapshot
Sourcepub fn location(&self) -> &[u8]
pub fn location(&self) -> &[u8]
The encoded location, in the variable-precision interleaved format. Empty when there is no position.
Sourcepub fn set_location(&mut self, bytes: &[u8])
pub fn set_location(&mut self, bytes: &[u8])
Replace the location, silently truncating past MAX_LOCATION_LEN.
Sourcepub const fn accuracy_from_hdop_centi(hdop_centi: u16) -> u16
pub const fn accuracy_from_hdop_centi(hdop_centi: u16) -> u16
Turn a horizontal dilution of precision, in hundredths, into the
accuracy estimate PROP_GNSS_PRECISION reports.
This is an estimate scaled by an assumed range error, not a
measured error bound; receivers that report a real accuracy figure
should set accuracy_dm from that instead.
The product cannot overflow: the largest dilution the argument can
express still scales to half of u16::MAX.
Sourcepub fn encode(&self, key: u32, out: &mut [u8]) -> Result<usize, GnssError>
pub fn encode(&self, key: u32, out: &mut [u8]) -> Result<usize, GnssError>
Encode the value of one positioning property.
Returns the number of bytes written; zero is the empty value, and is what the three positional properties answer without a fix.
Sourcepub fn absorb(&mut self, key: u32, value: &[u8]) -> Result<(), GnssError>
pub fn absorb(&mut self, key: u32, value: &[u8]) -> Result<(), GnssError>
Fold one property value back into the snapshot.
A host reads the positioning properties one at a time; this is how it reassembles them. The empty value clears the corresponding field rather than leaving a stale one behind.
Trait Implementations§
Source§impl Clone for GnssSnapshot
impl Clone for GnssSnapshot
Source§fn clone(&self) -> GnssSnapshot
fn clone(&self) -> GnssSnapshot
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GnssSnapshot
impl Debug for GnssSnapshot
Source§impl Default for GnssSnapshot
impl Default for GnssSnapshot
Source§fn default() -> GnssSnapshot
fn default() -> GnssSnapshot
Source§impl PartialEq for GnssSnapshot
impl PartialEq for GnssSnapshot
impl Copy for GnssSnapshot
impl Eq for GnssSnapshot
impl StructuralPartialEq for GnssSnapshot
Auto Trait Implementations§
impl Freeze for GnssSnapshot
impl RefUnwindSafe for GnssSnapshot
impl Send for GnssSnapshot
impl Sync for GnssSnapshot
impl Unpin for GnssSnapshot
impl UnwindSafe for GnssSnapshot
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)