[−][src]Struct nmea::Nmea
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]
required_sentences_for_nav: HashSet<SentenceType>
) -> Result<Nmea, &'static str>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,