Files
MeshCore-Solo/src/helpers/DeviceDiag.h
Jakub 327e659d51 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>
2026-06-18 22:34:52 +02:00

11 lines
430 B
C

#pragma once
#include <stdint.h>
// Cross-platform free-heap / stack-headroom estimate for the on-device
// diagnostics screen. A total_bytes of 0 means "not supported on this
// platform" — callers should display "N/A" rather than 0/0.
struct DeviceDiag {
static void getHeapStats(uint32_t& free_bytes, uint32_t& total_bytes);
static uint32_t getStackFreeBytes(); // current task's min-ever headroom; 0 = unsupported
};