#nmea #read #automatic #built #data #client #canboat

canboat-rs

Reads nmea 2000 data. Client is built automatically based on data from 'canboat'

3 releases

0.1.2-alpha Nov 21, 2024
0.1.1-alpha Nov 21, 2024
0.1.0-alpha Nov 21, 2024

#551 in Network programming

Download history 376/week @ 2024-11-20 13/week @ 2024-11-27

389 downloads per month

Apache-2.0

1.5MB
37K SLoC

canboat-rs

Check the generated doc page for how to use this package. Still under early development and barely tested.


lib.rs:

canboat-rs

Parsing nmea data

use chrono::Datelike;
use canboat_rs::pgns::pgn::Pgn;
use canboat_rs::NmeaParser;
// Check the `can-analyzer` project to figure out how to grab
// a can id and data.

pub fn main() {
    let id = 233836644;
    let data: &[u8] = &[255, 255, 79, 78, 144, 3, 32, 46];
    let mut parser = NmeaParser::new();
    let parsed_message = parser.parse(id, data);
    match parsed_message.unwrap() {
        Pgn::SystemTime(time) => {
            println!("{:?}", time);
        }
        _ => {},
    };
}

Dependencies

~1.5MB
~28K SLoC