mirror of https://github.com/meshcore-dev/MeshCore
Browse Source
isChannelActive() previously spin-waited (with YIELD_TASK()) for up to 16s after detecting RSSI busy, blocking Dispatcher::loop() from servicing incoming packets for the duration of the backoff. Replace the blocking wait with a state machine (_lbt_backoff_active / _lbt_deadline): on busy detection, arm a deadline and return true (busy) immediately. Dispatcher::checkSend()'s existing retry mechanism (getCADFailRetryDelay()) re-polls isChannelActive() on the next loop() pass; once the deadline has elapsed, re-sense (bounded, single-level recursion) instead of assuming still-busy. The initial 5ms RSSI sense and the post-clear jitter wait remain blocking, as both are short (<=5ms and <=~1s respectively) relative to the up-to-16s backoff this change targets. Hardware-tested (LilyGo T3S3 sx1262 / Wio Tracker L1 Pro) in both quiet and electrically noisy environments; confirmed both bidirectional and unidirectional message delivery under legitimate busy-channel conditions.pull/2218/head
committed by
me
2 changed files with 18 additions and 5 deletions
Loading…
Reference in new issue