wmbus: fix format-A length formula for L=10 (mod 16); host tests under ASan

This commit is contained in:
Lars Nolden
2026-09-01 11:28:14 +02:00
parent c835c62172
commit 6bdcb2acad
6 changed files with 302 additions and 3 deletions
+15
View File
@@ -24,3 +24,18 @@
(thermal suspected). The `rtl_test -t` theory was DISPROVEN.
- Can the SX1262 RX be stopped early (poll GetRxBufferStatus after
SyncWordValid) to remove the ~12 ms fixed-capture tail?
## Standards detail needing an authoritative answer
- Format A frame length for `L = 10 (mod 16)`. Two mature open-source
implementations disagree in this corner:
- rtl-wmbus computes `1 + L + 2*((L-10+15)/16 + 1)` CRC pairs, which for
L = 10, 26, 42, ... requires a 17-byte block;
- wmbusmeters does not predict the length at all; it walks greedy 16-byte
blocks and accepts a final block of 1..16 bytes.
This firmware follows the wmbusmeters decomposition
(`1 + L + 2*(1 + ceil((L-9)/16))`) because it is self-consistent with the
CRC walk actually used. No valid frame with such an L was ever captured
at this site, so the question is unresolved empirically -- it needs the
EN 13757-4 text, or a meter that emits one. Until then, a real meter using
those lengths is an interoperability risk worth a targeted test.