Struct nrfxlib::gnss::GnssSocket[][src]

pub struct GnssSocket(_);
Expand description

Represents a connection to the GPS sub-system.

Implementations

impl GnssSocket[src]

pub fn new() -> Result<GnssSocket, Error>[src]

Create a new GNSS socket.

pub fn start(&self, delete_mask: DeleteMask) -> Result<(), Error>[src]

Deletes the specified information from non-volatile memory, then starts the GNSS sub-system.

pub fn stop(&self) -> Result<(), Error>[src]

Stop the GNSS system.

pub fn set_fix_interval(&self, interval: u16) -> Result<(), Error>[src]

Set the Fix Interval.

Defines the interval between each fix in seconds. The default is 1. A value of 0 means single-fix mode.

pub fn set_fix_retry(&self, interval: u16) -> Result<(), Error>[src]

Set the Fix Retry time.

Defines how long (in seconds) the receiver should try to get a fix. The default is 60 seconds and a value of 0 means wait forever.

pub fn get_fix_interval(&self) -> Result<u16, Error>[src]

Get the current Fix Interval (in seconds).

See set_fix_interval for more information.

pub fn get_fix_retry(&self) -> Result<u16, Error>[src]

Get the Fix Retry time (in seconds).

See set_fix_retry for more information.

pub fn set_nmea_mask(&self, mask: NmeaMask) -> Result<(), Error>[src]

Set the NMEA mask.

You can select which particular NMEA strings you want from the GNSS socket here.

If you pass a default NmeaMask, you get no NMEA frames (only GnssData::Position or GnssData::Agps frames).

pub fn get_nmea_mask(&self) -> Result<NmeaMask, Error>[src]

Get the current NMEA mask.

See set_nmea_mask.

pub fn get_fix(&self) -> Result<Option<GnssData>, Error>[src]

Get a fix from the GNSS system.

Performs a read on the GNSS socket. The Nordic library determines which frame type you get on each read. You will get None if there is no fix to be read.

pub fn get_fix_blocking(&self) -> Result<Option<GnssData>, Error>[src]

Wait for a fix from the GNSS system.

Performs a read on the GNSS socket and returns either a GnssData::Nmea, if an NMEA string has been returned, or a GnssData::Position. The Nordic library determines which you get on each read. You will get None if there is no fix to be read.

Trait Implementations

impl Debug for GnssSocket[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Deref for GnssSocket[src]

type Target = Socket

The resulting type after dereferencing.

fn deref(&self) -> &Socket[src]

Dereferences the value.

impl DerefMut for GnssSocket[src]

fn deref_mut(&mut self) -> &mut Socket[src]

Mutably dereferences the value.

impl Drop for GnssSocket[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

impl Pollable for GnssSocket[src]

fn get_fd(&self) -> i32[src]

Auto Trait Implementations

impl Send for GnssSocket

impl Sync for GnssSocket

impl Unpin for GnssSocket

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.