simple_repeater: per-origin advert window + fairness dry-run (tth #2, #1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tthandClaude Opus 5.5 committed 2026-11-02 09:40:20 +01:00
1 parent af1714db08
commit 910bee899a
7 files changed
+351 -11

No files matched your search

+7 -2
View File
@@ -369,9 +369,14 @@ protected:
#endif
// CUSTOM (TeTeHacko): FairnessLimiter veto. mesh::Mesh consults this as the
// LAST condition of every forward decision, so a token is only taken for a
// packet that would otherwise transmit. Runtime kill switch in prefs.
// packet that would otherwise transmit. Buckets have a runtime kill switch
// (`fairness on|off`), the advert window its own (`fairness advert 0`).
// What gets shed is also summed as airtime -- in dry-run, what WOULD be.
bool takeForwardingRateLimit(const mesh::Packet* packet) override {
return !_prefs.fairness_enabled || fairness_limiter.allowPacket(packet);
bool ok = fairness_limiter.allowPacket(packet, _ms->getMillis());
FairShed why = fairness_limiter.lastShed();
if (why != FAIR_SHED_NONE) fairness_limiter.addShedAirtime(why, _radio->getEstAirtimeFor(packet->getRawLength()));
return ok;
}
const char* getLogDateTime() override;
void logRxRaw(float snr, float rssi, const uint8_t raw[], int len) override;