feat(repeater): report the TX-failure counters in the RF status reply
A repeater that keeps failing to get its transmits out looks perfectly healthy over RF: sent/airtime just stop growing and nothing in the status says why. The Dispatcher already counts those failures (n_tx_start_fail, n_tx_timeout, from the requeue path); this puts them on the air. Appended at the END of RepeaterStats on purpose, because the struct goes out byte-for-byte and clients parse it by fixed offsets. Upstream grew the same frame the same way -- meshcore-py's parse_status() reads recv_errors only `if len(data) >= offset + 56`, with the comment "appended in firmware v1.12.0" -- so older clients keep working and simply do not see the new fields. Verified against the installed parser before writing this. A static_assert pins sizeof(RepeaterStats) == 64 (56 + 8, padding-free): reordering a field or gaining padding would silently shift every offset after it, and that is not something to leave to review. Room server keeps its own, already-different stats struct -- not touched. Builds: SenseCap_Solar_repeater, SenseCap_Solar_repeater_ble, t1000e_repeater. NOT field-tested yet: needs a repeater flashed with this and queried over RF. Reading the two values also needs the consumer side extended (the library parser stops at 56 bytes by design). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
1614cb3e48
commit
f80fcc0587
2 files changed
+22
No files matched your search
@@ -497,6 +497,8 @@ int MyMesh::handleRequest(ClientInfo *sender, uint32_t sender_timestamp, uint8_t
|
||||
stats.n_flood_dups = ((SimpleMeshTables *)getTables())->getNumFloodDups();
|
||||
stats.total_rx_air_time_secs = getReceiveAirTime() / 1000;
|
||||
stats.n_recv_errors = radio_driver.getPacketsRecvErrors();
|
||||
stats.n_tx_start_fail = getNumTxStartFail(); // CUSTOM (TeTeHacko)
|
||||
stats.n_tx_timeout = getNumTxTimeout(); // CUSTOM (TeTeHacko)
|
||||
memcpy(&reply_data[4], &stats, sizeof(stats));
|
||||
|
||||
return 4 + sizeof(stats); // reply_len
|
||||
|
||||
Reference in new issue
Block a user