Copied src/protocol.rs from firmware verbatim, added crate-level #![no_std], migrated the defmt::Format derive gate from cfg_attr(not(test), ...) to cfg_attr(feature = "defmt", ...) so host-side (no-default-features) builds compile cleanly. Tests unchanged; all 35 pass. Firmware still owns the file for now — the re-export swap lands in a follow-up firmware commit to keep each change standalone.
26 lines
809 B
Markdown
26 lines
809 B
Markdown
# donglora-protocol
|
|
|
|
Wire protocol types and COBS framing for DongLoRa, shared between firmware
|
|
and host crates (`client-rs`, `mux-rs`, `bridge`).
|
|
|
|
`no_std` by default. `defmt::Format` derives are opt-in via the default
|
|
`defmt` feature. Host consumers disable default features:
|
|
|
|
```toml
|
|
donglora-protocol = { version = "0.1", default-features = false }
|
|
```
|
|
|
|
## Status
|
|
|
|
Pre-1.0. Currently consumed by path dep; will publish to crates.io once
|
|
the surface area settles.
|
|
|
|
## Layout
|
|
|
|
- `src/lib.rs` — `Command`, `Response`, `RadioConfig`, `ErrorCode`, etc.
|
|
- `src/framing.rs` — `CobsDecoder` + `cobs_encode_response` for USB/UART
|
|
transports.
|
|
- `tests/` — proptest suite (roundtrips, bounded-capacity invariants,
|
|
regional-regs, duty-cycle math).
|
|
- `fuzz/` — cargo-fuzz targets on the parser and framer.
|