3 stable releases

2.0.0 Oct 4, 2019
1.0.1 Jul 9, 2019
1.0.0 Jan 26, 2019

#1811 in Embedded development

31 downloads per month

MIT/Apache

33KB
569 lines

ANPP

pipeline status

(Rendered Documentation/Benchmarks)

A Rust port of the Advanced Navigation Packet Protocol, a low overhead communication protocol that can provide error checking and packetisation on top of (possibly noisy) raw byte stream.

Getting Started

To use this crate in your application you'll need to add it as a dependency in your Cargo.toml.

# Cargo.toml

[dependencies]
anpp = { git = "https://gitlab.com/Michael-F-bryan/anpp" }

Then you can use it just like any other library:

extern crate anpp;

use anpp::{Decoder, Packet};
use anpp::errors::DecodeError;

fn decode_a_packet() -> Result<Packet, DecodeError> {
    // create the decoder and read some data into it
    let mut dec = Decoder::new();
    let data = read_some_data()?;
    dec.push_data(&data)?;

    // Now the decoder has some bytes to work with, we can decode the packet
    let pkt = dec.decode()?;

    Ok(pkt)
}

If you want to build this crate locally, first you'll need a copy of the source code.

$ git clone https://gitlab.com/Michael-F-Bryan/anpp

Then compile using the Rust build tool, cargo.

$ cargo build

From here you can run the tests, generate HTML documentation, or execute the benchmarks.

$ cargo test
$ cargo doc --open
$ cargo bench

Licensing

This port is released under either the Apache 2 or MIT license, at your choosing.

The original Advanced Navigation Packet Protocol source code is available under the MIT license and can be found on the Advanced Navigation website as part of their Spatial SDK (link/direct download).

Dependencies

~200KB