simplify app layer: dedup response/telemetry/JSON builders

- CompanionMesh: sendPacketSent() helper, collapse sendFloodScoped
  overloads, share self-telemetry LPP builder
- Mesh: shared computeAdaptive{Flood,Direct}Delay (was duplicated in
  Companion + Repeater)
- ObserverMesh/RepeaterMesh: shared helpers/MeshcoreJson.h builders;
  drop dead sign_input_len
This commit is contained in:
liquidraver
2026-05-29 12:54:52 +02:00
parent b1f1c77b88
commit 94dcf61715
7 changed files with 375 additions and 540 deletions
+5
View File
@@ -56,6 +56,11 @@ protected:
virtual bool allowPacketForward(const Packet *packet);
virtual uint32_t getRetransmitDelay(const Packet *packet);
virtual uint32_t getDirectRetransmitDelay(const Packet *packet) { return 0; }
/* Shared adaptive retransmit-delay math. CompanionMesh and RepeaterMesh
* had byte-identical overrides of getRetransmitDelay/getDirectRetransmitDelay;
* both now delegate here. */
uint32_t computeAdaptiveFloodDelay(const Packet *packet);
uint32_t computeAdaptiveDirectDelay(const Packet *packet);
/* Passive contention tracking: if true, track heard floods we don't forward
* (warms the contention EMA on nodes that don't relay, e.g. companions). */
virtual bool passivelyTrackFloods() const { return false; }