2 Commits
Author SHA1 Message Date
swaits acf715b3f0 feat: auto-resume RX across SET_CONFIG (no more re-issue of RX_START)
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).
2026-04-22 11:44:53 -06:00
swaits 4cccb65124 feat!: protocol v2 wire format and module restructure
The wire protocol is re-specified as DongLoRa Protocol v2 (see PROTOCOL.md). Every type_id, tag-correlation rule, and field layout is incompatible with 0.1.0.

* Add PROTOCOL.md as the normative spec for the v2 wire format.

* Replace framing.rs with a streaming FrameDecoder that emits (type_id, tag, payload) triples on each COBS-delimited, CRC-checked frame.

* Split the single-file lib.rs into dedicated modules: frame, commands, events, errors, modulation, info, crc, chip_id. Re-exports preserve convenience imports at the crate root.

* Replace RadioConfig / Bandwidth with a Modulation enum covering LoRa, FSK/GFSK, LR-FHSS, and FLRC, each with its own typed parameter struct.

* Add TxFlags, RxOrigin, SetConfigResult, OkPayload to model v2 response shapes, and RadioChipId for GET_INFO.

* Rewrite fuzz corpus: replace the 4 cobs_* / command_roundtrip targets with decoder_feed, frame_roundtrip, lora_config_roundtrip, and parse_device_message; drop parse_radio_config.

* Expand proptest and mutation-killer coverage for the new wire shape.

* Rewrite canonical-byte test vectors against the v2 spec.
2026-04-22 09:21:11 -06:00