19 releases

0.7.0 Oct 12, 2024
0.6.0 Aug 27, 2023
0.5.1 Aug 27, 2023
0.5.0 Jun 4, 2023
0.0.1 May 20, 2016

#13 in Geospatial

Download history 243/week @ 2024-08-19 211/week @ 2024-08-26 295/week @ 2024-09-02 348/week @ 2024-09-09 250/week @ 2024-09-16 483/week @ 2024-09-23 651/week @ 2024-09-30 423/week @ 2024-10-07 199/week @ 2024-10-14 356/week @ 2024-10-21 278/week @ 2024-10-28 273/week @ 2024-11-04 313/week @ 2024-11-11 204/week @ 2024-11-18 155/week @ 2024-11-25 319/week @ 2024-12-02

1,000 downloads per month
Used in 4 crates (3 directly)

Apache-2.0

275KB
6K SLoC

NMEA

Version Build Status License Apache-2

Complete documentation can be found on www.docs.rs/nmea

NMEA 0183 sentence parser for Rust.

Supported sentences:

NMEA Standard Sentences

  • AAM
  • ALM
  • APA
  • BOD
  • BWC
  • BWW
  • DBK
  • DPT
  • GBS
  • GGA *
  • GLL *
  • GNS *
  • GSA *
  • GST
  • GSV *
  • HDT
  • MDA
  • MTW
  • MWV
  • RMC *
  • TTM
  • VHW
  • VTG *
  • WNC
  • ZDA
  • ZFO
  • ZTG

Other Sentences

  • TXT *

Vendor Extensions

  • PGRMZ

* Nmea::parse() supported sentences

How to contribute

We have an ongoing effort to support as many sentences from NMEA 0183 as possible, starting with the most well-known. If you'd like to contribute by writing a parser for a given message, check out the Supporting additional sentences (AeroRust/nmea#54) issue and contribute in 3 easy steps:

  1. Write a comment - Please write a comment in the issue for the sentence(s) you'd like to implement, you will be mentioned on the task to avoid duplicate implementations.
  2. Implement each sentence alongside at least 1 test in its own module under the ./src/sentences directory using the nom crate.
  3. Open a PR 🎉

What is NMEA 0183?

NMEA 0183 is a combined electrical and data specification for communication between marine electronics such as echo sounder, sonars, anemometer, gyrocompass, autopilot, GPS receivers and many other types of instruments.

Usage

Add the nmea dependency in your Cargo.toml:

[dependencies]
nmea = "0.7"

For no_std

This crate support no_std without the use of an allocator ( alloc ), just add the nmea crate without the default features:

[dependencies]
nmea = { version = "0.7", default-features = false }

Parse

To use the NMEA parser create a Nmea struct and feed it with NMEA sentences (only supports GNSS messages, otherwise use the parse_str() and parse_bytes()):

use nmea::Nmea;

fn main() {
    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";

    // feature `GGA` should be enabled to parse this sentence.
    #[cfg(feature = "GGA")]
    {
        nmea.parse(gga).unwrap();
        println!("{}", nmea);
    }
}

Supported Rust Versions

The Minimum supported Rust version (or MSRV) is 1.70.0.

Unsafe-free crate

We use #![deny(unsafe_code)] for a fully unsafe-free crate.

License

This project is licensed under the Apache-2.0.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the project by you, shall be licensed as Apache-2.0, without any additional terms or conditions.

Dependencies

~2.6–8.5MB
~72K SLoC