[][src]Function nmea_0183::parse

pub fn parse(input: &str) -> Result<Sentence, Error>

Parse a sentence According to the NMEA-0183 standard.

Examples

// Get a sentence to parse.
// According to the specification, an nmea sentence must end with CRLF
let raw_nmea = "$GPGGA,092725.00,4717.11399,N,00833.91590,E,1,08,1.01,499.6,M,48.0,M,,*5B\r\n";
let parsed_sentence = parse(raw_nmea)?;
   /*
   Sentence {
       sentence_type: Parametric,
       talker: GPS,
       message: GGA(GGAMessage {
           time: Some(09:27:25),
           lat: Some(Degree(47.1711399)),
           ns: North,
           lon: Some(Degree(8.339159)),
           ew: East,
           quality: AutonomousGNSSFix,
           num_sv: Some(8),
           hdop: Some(1.01),
           alt: Some(Meter(499.6)),
           sep: Some(Meter(48.0)),
           diff_age: None,
           diff_station: None
       })
   }
   */
Ok(())