Commit Graph
6 Commits
Author SHA1 Message Date
Christoph Koehler f6843b10a6 refactor: split MeshTables::hasSeen into pure query + markSeen
hasSeen() was simultaneously a predicate and a mutator — it inserted the
packet hash on every miss, making five call sites that only wanted to mark
a packet as sent call it with the return value discarded.

Split into:
- wasSeen()   — pure predicate, no side effects
- markSeen()  — explicit insert

All query sites now call markSeen() immediately after wasSeen() returns
false, preserving identical runtime behaviour. The five mark-only send
sites (sendFlood, sendDirect, sendZeroHop x2) now call markSeen directly.

Also fixes three bridge sites (BridgeBase, ESPNowBridge, RS232Bridge)
that had the same query+implicit-insert pattern.

Tests: add test/test_mesh_tables/ covering wasSeen purity, markSeen,
dup stats, and clear. Update SHA256 mock to produce deterministic output
(previously finalize() was a no-op). Add Packet.cpp to native build filter.
2026-07-01 21:51:38 -06:00
João Brázio 1de66be8a3 Refactor debug logging across bridge implementations 2025-10-06 12:57:04 +01:00
João Brázio 6c793a02f1 Bridge: enhance CLI configuration options 2025-10-03 00:20:09 +01:00
João Brázio 0a7cbf5e41 Add bridge management CLI 2025-09-24 16:30:00 +01:00
João Brázio c3f944418a Add BRIDGE_DELAY as a buffer to prevent immediate processing conflicts in the mesh network 2025-09-08 20:21:33 +01:00
João Brázio 91e659a17d Refactor bridge implementations to inherit from BridgeBase 2025-09-08 02:03:08 +01:00