Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ arrayvec = {version = "0.7.2", default-features = false}
chrono = {version = "0.4.19", default-features = false}
heapless = "0.7.15"
nom = {version = "7.1.1", default-features = false}
parse-display = {version = "0.6.0", default-features = false}

# we include num-traits only when `std` is not enabled
# because of `fract()` and `trunc()` methods
Expand Down
3 changes: 3 additions & 0 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use nom::{
sequence::preceded,
IResult,
};
use parse_display::{Display, FromStr};

use crate::{sentences::*, Error, SentenceType};

Expand All @@ -30,6 +31,8 @@ use crate::{sentences::*, Error, SentenceType};
pub const SENTENCE_MAX_LEN: usize = 102;

/// A known and parsable Nmea sentence type.
#[derive(Display)]
#[display("${talker_id},{message_id},{data}*{checksum}")]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prefix for the sentence start is different for AIS messages!

  • Support multiple prefixes

pub struct NmeaSentence<'a> {
pub talker_id: &'a str,
pub message_id: SentenceType,
Expand Down