feat(ui): add on-device diagnostics screen (Tools > Diagnostics)

Shows packet counts by category (RX/TX), radio noise floor/RSSI/SNR,
packet-pool free count and outbound queue length, uptime, and heap/stack
headroom on a single scrollable screen.

Adds generic per-payload-type RX/TX counters to Dispatcher (mesh layer),
plus pool-free/queue-length getters, and a new DeviceDiag helper for
nRF52 heap (linker-symbol + sbrk) and stack (FreeRTOS high-water-mark)
stats — the only platform needed for the 3 in-scope boards (Wio Tracker
L1 OLED/Eink, GAT562 30S), all nRF52840.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-06-18 22:34:52 +02:00
parent 99cbe51797
commit 327e659d51
8 changed files with 200 additions and 2 deletions

View File

@@ -19,6 +19,8 @@ namespace mesh {
void Dispatcher::begin() {
n_sent_flood = n_sent_direct = 0;
n_recv_flood = n_recv_direct = 0;
memset(n_sent_by_type, 0, sizeof(n_sent_by_type));
memset(n_recv_by_type, 0, sizeof(n_recv_by_type));
_err_flags = 0;
radio_nonrx_start = _ms->getMillis();
@@ -106,6 +108,7 @@ void Dispatcher::loop() {
_radio->onSendFinished();
logTx(outbound, 2 + outbound->getPathByteLen() + outbound->payload_len);
n_sent_by_type[outbound->getPayloadType()]++;
if (outbound->isRouteFlood()) {
n_sent_flood++;
} else {
@@ -236,6 +239,7 @@ void Dispatcher::checkRecv() {
#endif
logRx(pkt, pkt->getRawLength(), score); // hook for custom logging
n_recv_by_type[pkt->getPayloadType()]++;
if (pkt->isRouteFlood()) {
n_recv_flood++;