Struct nmea::Nmea

source · []
pub struct Nmea {
Show 14 fields pub fix_time: Option<NaiveTime>, pub fix_date: Option<NaiveDate>, pub fix_type: Option<FixType>, pub latitude: Option<f64>, pub longitude: Option<f64>, pub altitude: Option<f32>, pub speed_over_ground: Option<f32>, pub true_course: Option<f32>, pub num_of_fix_satellites: Option<u32>, pub hdop: Option<f32>, pub vdop: Option<f32>, pub pdop: Option<f32>, pub geoid_separation: Option<f32>, pub fix_satellites_prns: Option<Vec<u32>>, /* private fields */
}
Expand description

NMEA parser This struct parses NMEA sentences, including checksum checks and sentence validation.

Examples

use nmea::Nmea;

let mut nmea= Nmea::default();
let gga = "$GPGGA,092750.000,5321.6802,N,00630.3372,W,1,8,1.03,61.7,M,55.2,M,,*76";
nmea.parse(gga).unwrap();
println!("{}", nmea);

Fields

fix_time: Option<NaiveTime>fix_date: Option<NaiveDate>fix_type: Option<FixType>latitude: Option<f64>longitude: Option<f64>altitude: Option<f32>

MSL Altitude in meters

speed_over_ground: Option<f32>true_course: Option<f32>num_of_fix_satellites: Option<u32>hdop: Option<f32>vdop: Option<f32>pdop: Option<f32>geoid_separation: Option<f32>

Geoid separation in meters

fix_satellites_prns: Option<Vec<u32>>

Implementations

Constructs a new Nmea for navigation purposes.

Examples
use nmea::{Nmea, SentenceType};

let mut nmea = Nmea::create_for_navigation(&[SentenceType::RMC,
SentenceType::GGA]).unwrap();
let gga = "$GPGGA,092750.000,5321.6802,N,00630.3372,W,1,8,1.03,61.7,M,55.2,M,,*76";
nmea.parse(gga).unwrap();
println!("{}", nmea);

Returns fix type

Returns fix type

Returns last fixed latitude in degress. None if not fixed.

Returns last fixed longitude in degress. None if not fixed.

Returns altitude above WGS-84 ellipsoid, meters.

Returns the number of satellites use for fix.

Returns the number fix HDOP

Returns the altitude above MSL (geoid), meters.

Returns used sattelites

Parse any NMEA sentence and stores the result. The type of sentence is returnd if implemented and valid.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.