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.
This commit is contained in:
swaits committed 2026-04-22 09:21:11 -06:00
1 parent 35866edac4
commit 4cccb65124
29 files changed
+7115 -2285

No files matched your search

+13 -27
View File
@@ -22,6 +22,13 @@ features = ["std"]
[workspace]
members = ["."]
[[bin]]
name = "decoder_feed"
path = "fuzz_targets/decoder_feed.rs"
test = false
doc = false
bench = false
[[bin]]
name = "parse_command"
path = "fuzz_targets/parse_command.rs"
@@ -30,43 +37,22 @@ doc = false
bench = false
[[bin]]
name = "parse_radio_config"
path = "fuzz_targets/parse_radio_config.rs"
name = "parse_device_message"
path = "fuzz_targets/parse_device_message.rs"
test = false
doc = false
bench = false
[[bin]]
name = "cobs_decoder_feed"
path = "fuzz_targets/cobs_decoder_feed.rs"
name = "frame_roundtrip"
path = "fuzz_targets/frame_roundtrip.rs"
test = false
doc = false
bench = false
[[bin]]
name = "cobs_roundtrip"
path = "fuzz_targets/cobs_roundtrip.rs"
test = false
doc = false
bench = false
[[bin]]
name = "command_roundtrip"
path = "fuzz_targets/command_roundtrip.rs"
test = false
doc = false
bench = false
[[bin]]
name = "cobs_decoder_multi_frame"
path = "fuzz_targets/cobs_decoder_multi_frame.rs"
test = false
doc = false
bench = false
[[bin]]
name = "cobs_chunk_invariant"
path = "fuzz_targets/cobs_chunk_invariant.rs"
name = "lora_config_roundtrip"
path = "fuzz_targets/lora_config_roundtrip.rs"
test = false
doc = false
bench = false