#protocols #codec #parser #alp

no-std dash7

Implementation of a DASH7 ALP protocol codec

14 releases (6 breaking)

0.7.2 May 21, 2024
0.7.0 Apr 2, 2024
0.6.1 Dec 11, 2023

#1040 in Encoding

Download history 107/week @ 2024-03-28 33/week @ 2024-04-04 120/week @ 2024-05-09 139/week @ 2024-05-16 33/week @ 2024-05-23 2/week @ 2024-06-06 2/week @ 2024-06-13 10/week @ 2024-06-27 87/week @ 2024-07-04

97 downloads per month
Used in 2 crates

MIT license

160KB
4.5K SLoC

Dash7-rs

Crates.io Documentation MIT licensed codecov ci

Dash7 payload encoding and decoding in Rust!

Library

Currently, this library only assists in encoding and decoding dash7 payloads. Nothing more. I have plans for supporting no_std, possibly even without alloc, but as of this writing, only std targets are supported.

To use the library, run

cargo add dash7

CLI

This repostory also contains a CLI utility in the package dash7-tools to help you decode dash7 payloads (as hex strings) quickly.

Installation

Dash7-rs is published on crates.io, so you can just install it with:

cargo install dash7-tools

For sub-iot payloads

cargo install dash7-tools --no-default-features -F subiot

Usage

For the help menu, run

dash7 --help

Currently, there's just a single subcommand parse:

dash7 parse --help

To parse an ALP payload, you can use:

dash7 parse -t alp "04 48 00 09 00 00 00 00 00 00 30 00 00 04 48 00 09 00 00 30 00 00 00 00 02 00 04 48 00 09 00 00 70 00 00 00 30 02 00"

Parse type and file id are both optional. If neither are given, it will try to parse as any possible type, and as any known system file. This may however give a false impression of a payload.

Acknowledgements

Why not https://github.com/Stratus51/rust_dash7_alp ? Good question! @Stratus51 did very good work there. I did, however, dislike that the bit-level operations where so intertwined with the data structs itself. Bit ordering and endianness is hard, especially when host and target differ in endianness. To that end, this library uses https://docs.rs/deku. Deku provides a proc_derive macro for easy field definitions, while the underlying bitvec takes care of all bit-level operations.

However, I have to thank @Stratus51 for many of the struct defs themselves and even documentation!

Dependencies

~3MB
~74K SLoC