[][src]Struct nmea::Nmea

pub struct Nmea {
    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_height: Option<f32>,
    pub satellites: Vec<Satellite>,
    pub fix_satellites_prns: Option<Vec<u32>>,
    // some fields omitted
}

NMEA parser

Fields

fix_time: Option<NaiveTime>fix_date: Option<NaiveDate>fix_type: Option<FixType>latitude: Option<f64>longitude: Option<f64>altitude: Option<f32>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_height: Option<f32>satellites: Vec<Satellite>fix_satellites_prns: Option<Vec<u32>>

Implementations

impl<'a> Nmea[src]

pub fn new() -> Nmea[src]

Constructs a new Nmea. This struct parses NMEA sentences, including checksum checks and sentence validation.

Examples

use nmea::Nmea;

let mut nmea= Nmea::new();
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);

pub fn create_for_navigation(
    required_sentences_for_nav: HashSet<SentenceType>
) -> Result<Nmea, &'static str>
[src]

Constructs a new Nmea for navigation purposes.

Examples

use nmea::{Nmea, SentenceType};

let mut nmea = Nmea::create_for_navigation([SentenceType::RMC, SentenceType::GGA]
                                               .iter()
                                               .map(|v| v.clone())
                                               .collect()).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);

pub fn fix_timestamp(&self) -> Option<NaiveTime>[src]

Returns fix type

pub fn fix_type(&self) -> Option<FixType>[src]

Returns fix type

pub fn latitude(&self) -> Option<f64>[src]

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

pub fn longitude(&self) -> Option<f64>[src]

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

pub fn altitude(&self) -> Option<f32>[src]

Returns latitude from last fix. None if not available.

pub fn fix_satellites(&self) -> Option<u32>[src]

Returns the number of satellites use for fix.

pub fn hdop(&self) -> Option<f32>[src]

Returns the number fix HDOP

pub fn geoid_height(&self) -> Option<f32>[src]

Returns the height of geoid above WGS84

pub fn satellites(&self) -> Vec<Satellite>[src]

Returns the height of geoid above WGS84

pub fn parse(&mut self, s: &'a str) -> Result<SentenceType, String>[src]

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

pub fn parse_for_fix(&mut self, xs: &[u8]) -> Result<FixType, String>[src]

pub fn last_txt(&self) -> Option<&TxtData>[src]

Trait Implementations

impl Clone for Nmea[src]

impl Debug for Nmea[src]

impl Default for Nmea[src]

impl Display for Nmea[src]

Auto Trait Implementations

impl RefUnwindSafe for Nmea

impl Send for Nmea

impl Sync for Nmea

impl Unpin for Nmea

impl UnwindSafe for Nmea

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.