From 1f801d98517884476ce6e0cf72492644cf07f193 Mon Sep 17 00:00:00 2001 From: R0ck Date: Thu, 3 Sep 2026 17:13:41 +0100 Subject: [PATCH] radioserver: report the DIO1 routing mask, not only the enable mask The record already carried the IRQ enable mask. It did not carry the DIO1 routing mask, which is the narrower set SetDioIrqParams wires out to the pin, and the difference is not academic: reading the enable mask where the routing mask belongs is the fault that made an emulated board hear every advert and relay one in three. HeaderValid raised DIO1 part-way through a carrier, the pin was still high when RxDone arrived, and RadioLib attaches that pin on the rising edge, so recvRaw never ran. Nothing outside the chip could see which mask was which, so the fault had to be found by reading the datasheet against the source rather than by looking at a running node. Now it can be read off a node: RadioLib's receive default is RxDone alone against an enable mask that also carries Timeout, CrcErr, HeaderValid and HeaderErr, so the two being equal is a sign rather than a normal reading. Appended to the record, because the host reads it on length: an older host ignores the two new bytes and a newer host tells "did not say" from "said zero". Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Q9HbD44EKWWTRYgxbFGxf6 --- bridge/radioserver.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bridge/radioserver.cpp b/bridge/radioserver.cpp index b84d1fa..749fc90 100644 --- a/bridge/radioserver.cpp +++ b/bridge/radioserver.cpp @@ -160,7 +160,7 @@ void put16(uint8_t* p, uint16_t v) { // state there was no way here to tell a node configured correctly from one that // was not. void writeRadioStats(sock_t fd) { - uint8_t sb[37]; + uint8_t sb[39]; put32(&sb[0], gChip.irqReads()); put32(&sb[4], gChip.busyReads()); put32(&sb[8], gChip.busyMs()); @@ -183,6 +183,13 @@ void writeRadioStats(sock_t fd) { // Three states, because "has not transmitted" is not "transmitted with the // module out": 0 no transmission yet, 1 module out, 2 module in. sb[36] = !gChip.hasTransmitted() ? 0 : (gChip.femAtTx() ? 2 : 1); + // The DIO1 routing mask, which is not the IRQ enable mask above. Reported + // separately because confusing the two is a fault that has already happened + // here: the model read the enable mask where SetDioIrqParams gives the routing + // mask, HeaderValid raised DIO1 part-way through a carrier, and the pin was + // still high when RxDone arrived - no rising edge for a driver that attaches + // it on one. Appended, because the host reads this record on length. + put16(&sb[37], gChip.dio1Mask()); writeMsg(fd, kRadioStats, sb, sizeof(sb)); }