[][src]Struct adafruit_gps::gps::Gps

pub struct Gps {
    pub port: Box<dyn SerialPort>,
    pub satellite_data: bool,
    pub naviagtion_data: bool,
}

This is the main struct around which all commands are centered. It allows for communication with the GPS module via the open port.

Satellite data: true if you want the individual satellite data Navigation data: true if you want the naviagion data (lat, long, etc)

Fields

port: Box<dyn SerialPort>satellite_data: boolnaviagtion_data: bool

Trait Implementations

impl GetGpsData for Gps[src]

fn update(&mut self) -> GpsData[src]

Keeps reading sentences until all the required sentences are read.

Returns GpsData.

fn read_line(&mut self) -> String[src]

Reads a full sentence from the serial buffer, returns a String.

impl SendPmtk for Gps[src]

fn send_command(&mut self, cmd: &str)[src]

Input: no $ and no *checksum.

fn pmtk_001(&mut self, search_depth: i32) -> Pmtk001Ack[src]

Format: $pmtk{cmd},{flag},{value}*{checksum}

fn pmtk_500(&mut self) -> Option<String>[src]

Return the string without checksum.

fn pmtk_313_api_set_sbas_enabled(&mut self, sbas: Sbas) -> Pmtk001Ack[src]

Enable = 1 -> Default.

Disabled = 0

fn pmtk_314_api_set_nmea_output(
    &mut self,
    gll: i8,
    rmc: i8,
    vtg: i8,
    gga: i8,
    gsa: i8,
    gsv: i8,
    pmtkchn_interval: i8
) -> Pmtk001Ack
[src]

19 fields can be parsed to this one.

$PMTK314,{GPGLL},{GPRMC},{GPTVG},{GPGGA},{GPGAS},{GPGSV},{R}..6-17,{PMTKCHN interval}

For each field, frequency setting is given: 0-5, 0-> Disabled, 1-> Output once everty one position fix, 2-> every second... every 5th.

Default is PMTK314,-1* (Default: 0,1,1,1,1,5,0..0)

fn pmtk_414_api_q_nmea_output(&mut self) -> NmeaOutput[src]

Return 514: PMTK514, the nmea outputs that are valid (see pmtk_314_api_set_nmea_output for the fields).

fn pmtk_319_api_set_sbas_mode(&mut self, sbas_mode: SbasMode) -> bool[src]

Set sbas mode. 0=testing mode and 1=integrity mode. Integrity mode is default.

Get's reboot code.

fn pmtk_419_api_q_sbas_mode(&mut self) -> SbasMode[src]

519 response, PMTK519,{0,1} for {testing mode, integrity mode}, set by 319. false: testing mode, true: integrity mode.

fn pmtk_605_q_release(&mut self) -> String[src]

Return example: $PMTK705,AXN_5.1.7_3333_19020118,0027,PA1010D,1.0*76

Return blank string if no info found.

fn pmtk_607_q_epo_info(&mut self) -> EpoData[src]

Example sentence: $PMTK707,0,0,0,0,0,0,0,0,0*2E

Return -1 if it failed to get data in someway.

Get EPO data status

  • 0 Set: Total number sets of EPO data stored in the GPS chip
  • 1 FWN & FTOW : GPS week number
  • 2 FWN & FTOW : TOW of the first set of EPO data stored in chip respectively
  • 3 LWN & LTOW : GPS week number
  • 4 LWN & LTOW : TOW of the last set of EPO data stored in chip respectively
  • 5 FCWN & FCTOW : GPS week number
  • 6 FCWN & FCTOW : TOW of the first set of EPO data that are currently used respectively
  • 7 LCWN & LCTOW : GPS week number
  • 8 LCWN & LCTOW : TOW of the last set of EPO data that are currently used respectively

fn pmtk_127_cmd_clear_epo(&mut self) -> Pmtk001Ack[src]

Multiple $CLR,EPO,{000a8000}*5E lines, ending with a 001 response.

fn pmtk_397_set_nav_speed_threshold(&mut self, nav_threshold: f32) -> Pmtk001Ack[src]

For MT3318 and MT3329 chips.

fn pmtk_386_set_nav_speed_threshold(&mut self, nav_threshold: f32) -> Pmtk001Ack[src]

For MT3339 chips.

fn pmtk_447_q_nav_threshold(&mut self) -> f32[src]

$PMTK527,{0.40}*04

fn pmtk_223_set_al_dee_cfg(
    &mut self,
    sv: i8,
    snr: i8,
    ext_threshold: i32,
    ext_gap: i32
) -> Pmtk001Ack
[src]

Should be used with the PMTK225 command to set periodic mode.

SV: Default 1, range 1-4. Increases the time to receive more ephemeris data while the number of satellites without ephemeris data is less than the SV value.

SNR: Fedault 30, range 25-30. Enable receiving ephemeris data while the SNR of satellite is more than the value.

Extention threshold (millisecond): default 180_000, range 40_000-180_000. The extension time for ephemeris data receiving.

Extention gap: Default 60000, range 0-3_600_000

Standard 001 response.

fn pmtk_225_cmd_periodic_mode(
    &mut self,
    run_type: u8,
    run_time: u32,
    sleep_time: u32,
    second_run_time: u32,
    second_sleep_time: u32
) -> Pmtk001Ack
[src]

Enter standby or backup mode for power saving.

PMTK225,Type,Run time,Sleep time, Second run time,Second sleep time

run_type: operation mode - ‘0’ = go back to normal mode - ‘1’ = Periodic backup mode - ‘2’ = Periodic standby mode - ‘4’ = Perpetual backup mode - ‘8’ = AlwaysLocateTM standby mode - ‘9’ = AlwaysLocateTM backup mode

Run time (millisecond): Duration to fix for (or attempt to fix for) before switching from running modeback to a minimum power sleep mode. - '0’: disable - >=’1,000’: enable Range: 1,000~518400000

Sleep time (millisecond):Interval to come out of a minimum power sleep mode and start running in order to get a new position fix. - ‘0’: disable - >=’1,000’: enable Range: 1,000~518400000

Second run time (millisecond): Duration to fix for (or attempt to fix for) before switching from running mode back to a minimum power sleep mode. - ‘0’: disable - >=’1,000’: enable Range: 1,000~518400000

Second sleep time (millisecond): Interval to come out of a minimum power sleep mode and start running in order to get a new position fix. - ‘0’: disable - >=’1,000’: enable Range: 1,000~518400000

Note:

  • 1.The second run time should larger than first run time when non-zero value.
  • 2.The purpose of second run time and sleep time can let module to catch more satellite ephemeris data in cold boot condition. The value of them can be null. Then it will use the first run time and sleep time for ephemeris data receiving.
  • 3.AlwaysLocateTM is an intelligent controller of MT3339 power saving mode. Depending on the environment and motion conditions, MT3339 can adaptive adjust the on/off time to achieve balance of positioning accuracy and power consumption.
  • 4.This command needs to work normal with some hardware circuits.

fn pmtk_286_cmd_aic_mode(&mut self, aic: bool) -> Pmtk001Ack[src]

true is enable, false is disable.

fn pmtk_869_cmd_easy_enable(&mut self, enable_easy: bool) -> Pmtk001Ack[src]

Enable or disable EASY function.

Enabled by default.

Requires VBACKUP pin to be connected to battery.

Only valid for 1Hz update rate

true is enable easy, false is disable.

If you wish to query the EASY function, use pmtk_869_cmd_easy_query Response

  • pmtk,0 -> gives $PMTK869,2,1,3*29
  • pmtk,1,0 -> Gives 001 reply.
  • pmtk,2,{0,1} -> Gives 001 reply.

fn pmtk_869_cmd_easy_query(&mut self) -> bool[src]

Query the EASY command status. Return true or false, true is enabled, false it disabled.

fn pmtk_187_locus_config(&mut self, locus_interval: i8) -> Pmtk001Ack[src]

Locus mode (1 for interval mode) is always on. Interval, in seconds, is how often to log a data.

fn pmtk_330_api_set_datum(&mut self, datum: u16) -> Pmtk001Ack[src]

Configure Datum. 222 datum options.

‘0’ = WGS84

‘1’ = TOKYO-M

‘2’ = TOKYO-A

A full list is on the GTOP Datum list, but I can't find it.

fn pmtk_430_api_q_datum(&mut self) -> u16[src]

Query current datum. Gives PMTK530,datum See pmtk_330_api_set_datum for more details on datum.

0 is return value if there is an error.

fn pmtk_351_api_set_support_qzss_nmea(
    &mut self,
    enable_qzss: bool
) -> Pmtk001Ack
[src]

Sets the output to be the QZSS NMEA format.

True is enable, false is disable. Default is disable.

fn pmtk_352_api_set_stop_qzss(&mut self, enable: bool) -> Pmtk001Ack[src]

Since QZSS is regional positioning service. The command allow user enable or disable QZSS function.

Default is enable QZSS function

Enable is true, disable is false. Default is enable.

Auto Trait Implementations

impl !RefUnwindSafe for Gps

impl Send for Gps

impl !Sync for Gps

impl Unpin for Gps

impl !UnwindSafe for Gps

Blanket Implementations

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

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

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

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

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

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.

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.