hil: wmbusmeters link-layer cross-check; firmware duty-cycle accounting
This commit is contained in:
+25
@@ -103,6 +103,31 @@ if [ "$PROOF" = 1 ]; then
|
||||
$PY hil/verify_tx.py --serial "$RUN_DIR/proof_serial.log" \
|
||||
--sdr "$RUN_DIR/proof_sdr.log" --json > "$RUN_DIR/tx_proof.json" 2>&1 || true
|
||||
cat "$RUN_DIR/tx_proof.txt"
|
||||
|
||||
# Second, independent decoder opinion on one of our transmitted frames:
|
||||
# rtl-wmbus proves it demodulates, wmbusmeters proves the link layer is
|
||||
# a structurally valid wM-Bus telegram.
|
||||
FRAME=$(grep -o '"raw":"[0-9A-Fa-f]*"' "$RUN_DIR/proof_serial.log" \
|
||||
| head -1 | sed 's/.*"raw":"//;s/"//')
|
||||
if [ -n "${FRAME:-}" ]; then
|
||||
COOKED=$($PY - "$FRAME" <<'PYCOOK'
|
||||
import sys
|
||||
sys.path.insert(0, "hil")
|
||||
from correlate import cook_a
|
||||
raw = bytes.fromhex(sys.argv[1])
|
||||
c = cook_a(raw)
|
||||
print(c.hex() if c else "")
|
||||
PYCOOK
|
||||
)
|
||||
if [ -n "$COOKED" ]; then
|
||||
if ./hil/verify_frame_semantics.sh "$COOKED" \
|
||||
"$RUN_DIR/frame_semantics.txt"; then
|
||||
echo "wmbusmeters link-layer cross-check: PASS"
|
||||
else
|
||||
echo "wmbusmeters link-layer cross-check: FAIL (see frame_semantics.txt)"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# --- phase B: real meter traffic, decodes + IQ from ONE stream -------------
|
||||
|
||||
Reference in New Issue
Block a user