* bug fix for rxdelay 0

This commit is contained in:
Scott Powell 2025-02-06 11:16:17 +11:00
parent 55f14d968f
commit 5824c9a6c0
3 changed files with 7 additions and 0 deletions

View file

@ -197,6 +197,7 @@ protected:
}
int calcRxDelay(float score, uint32_t air_time) const override {
if (_prefs.rx_delay_base <= 0.0f) return 0;
return (int) ((pow(_prefs.rx_delay_base, 0.85f - score) - 1.0) * air_time);
}

View file

@ -251,6 +251,7 @@ protected:
}
int calcRxDelay(float score, uint32_t air_time) const override {
if (_prefs.rx_delay_base <= 0.0f) return 0;
return (int) ((pow(_prefs.rx_delay_base, 0.85f - score) - 1.0) * air_time);
}

View file

@ -8,6 +8,8 @@
namespace mesh {
#define MAX_RX_DELAY_MILLIS 32000 // 32 seconds
void Dispatcher::begin() {
n_sent_flood = n_sent_direct = 0;
n_recv_flood = n_recv_direct = 0;
@ -127,6 +129,9 @@ void Dispatcher::checkRecv() {
processRecvPacket(pkt); // is below the score delay threshold, so process immediately
} else {
MESH_DEBUG_PRINTLN("Dispatcher::checkRecv(), score delay is: %d millis", _delay);
if (_delay > MAX_RX_DELAY_MILLIS) {
_delay = MAX_RX_DELAY_MILLIS;
}
_mgr->queueInbound(pkt, futureMillis(_delay)); // add to delayed inbound queue
}
} else {