feat(mesh): track actually-forwarded packet count, show in Diagnostics

allowPacketForward() only gates permission; the packet can still be
dropped afterward (hasSeen(), path-size limit). Add Mesh::n_forwarded,
incremented at the 3 ACTION_RETRANSMIT_DELAYED return sites, so the
Diagnostics screen can confirm a repeater is actually relaying traffic
rather than just being configured to.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-06-18 23:20:23 +02:00
parent 72bc4ee895
commit d1d64dc612
3 changed files with 14 additions and 2 deletions

View File

@@ -27,6 +27,7 @@ class Mesh : public Dispatcher {
RTCClock* _rtc;
RNG* _rng;
MeshTables* _tables;
uint32_t n_forwarded; // packets actually re-transmitted (repeater/transport role)
void removeSelfFromPath(Packet* packet);
void routeDirectRecvAcks(Packet* packet, uint32_t delay_millis);
@@ -178,6 +179,10 @@ public:
LocalIdentity self_id;
// packets actually re-transmitted (vs. just permitted by allowPacketForward()) —
// confirms a repeater/transport role is really forwarding, not just configured to.
uint32_t getNumForwarded() const { return n_forwarded; }
RNG* getRNG() const { return _rng; }
RTCClock* getRTCClock() const { return _rtc; }