acf715b3f0d6df9f79d89f08f1e6dd7ada2707cb
Spec §3.5 and §6.3 (SET_CONFIG side effects) previously required the host to re-issue RX_START after any successful SET_CONFIG, because the radio was unconditionally left in idle. That chore is hostile to scanner, time-division, and dynamic-modulation use cases and violates the principle of least surprise. Update the normative text so that SET_CONFIG applied while the radio is in continuous RX auto-re-arms RX with the new parameters once reconfiguration completes. RX ring is still cleared (stale packets from the old modulation are not semantically meaningful). The OK response is still held until the radio is ready, so hosts may TX / RX immediately after it. Behavior when RX was not active on SET_CONFIG is unchanged: radio lands in idle. No wire-format change. Old hosts that re-issue RX_START after SET_CONFIG keep working (the redundant call is a no-op OK on a radio already in Receiving).
donglora-protocol
Wire protocol types and COBS framing for DongLoRa, shared between the
firmware and host crates (client-rs, mux-rs, bridge). no_std,
zero-alloc, fixed-width little-endian. See PROTOCOL.md
in this repo for the normative DongLoRa Protocol v2 specification.
Install
# Embedded / firmware (defmt::Format derives on by default):
donglora-protocol = "1"
# Host (no defmt):
donglora-protocol = { version = "1", default-features = false }
Layout
src/frame.rs:FrameDecoder(streaming COBS + CRC decoder) andencode_frame(type_id, tag, payload, out).src/commands.rs: host-to-deviceCommandenum,type_idconstants, andTxFlags.src/events.rs: device-to-hostDeviceMessage(OK / ERR / RX / TX_DONE), with theOkPayload,SetConfigResult,RxPayload,RxOrigin, andTxDonePayloadsub-shapes.src/modulation.rs:Modulationenum (LoRa, FSK/GFSK, LR-FHSS, FLRC) and their typed parameter structs.src/info.rs:GET_INFOresponse payload + capability bitmap helpers.src/errors.rs: wire-levelErrorCodeenum.src/chip_id.rs:RadioChipIdenum.src/crc.rs: CRC-16/CCITT-FALSE helper.
Features
| Feature | Default | What it does |
|---|---|---|
defmt |
yes | Derive defmt::Format on public enums. |
std |
no | Enable Debug-based niceties for host-side fuzz / proptest. |
Testing
The crate ships its own quality gate via just test:
| Gate | What runs |
|---|---|
test-unit |
nextest across all feature permutations + doc tests |
test-clippy |
-D warnings across all feature permutations |
test-fmt |
cargo fmt -- --check |
test-doc |
cargo doc --no-deps --all-features |
test-deny |
cargo deny check |
test-fuzz |
60 s on each of 5 cargo-fuzz targets (nightly) |
test-miri |
miri on lib + vector tests, both feature shapes (nightly) |
test-mutants |
cargo-mutants under both feature configurations |
The proptest suite alone exercises ~1.13M test cases per run.
License
MIT — see LICENSE.
Languages
Rust
98.6%
Just
1.4%