Struct nrf_modem::Gnss

source ·
pub struct Gnss {}
Expand description

A GNSS objects that controls the GPS of the modem.

There can only be one instance at a time.

Implementations§

source§

impl Gnss

source

pub async fn new() -> Result<Self, Error>

Activate the GPS

source

pub fn start_single_fix( self, config: GnssConfig, timeout_seconds: u16, ) -> Result<GnssStream, Error>

Do a single GPS fix until a valid Position Velocity Time (PVT) is found.

The timeout_seconds parameter controls the maximum time the GNSS receiver is allowed to run while trying to produce a valid PVT estimate. If the value is non-zero, the GNSS receiver is turned off after the time is up regardless of whether a valid PVT estimate was produced or not. If the value is set to zero, the GNSS receiver is allowed to run indefinitely until a valid PVT estimate is produced. A sane default value: 60s.

source

pub fn start_continuous_fix( self, config: GnssConfig, ) -> Result<GnssStream, Error>

source

pub fn start_periodic_fix( self, config: GnssConfig, period_seconds: u16, ) -> Result<GnssStream, Error>

source

pub async fn deactivate(self) -> Result<(), Error>

Trait Implementations§

source§

impl Drop for Gnss

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Gnss

§

impl RefUnwindSafe for Gnss

§

impl Send for Gnss

§

impl Sync for Gnss

§

impl Unpin for Gnss

§

impl UnwindSafe for Gnss

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.