aboutsummaryrefslogtreecommitdiff
path: root/src/helpers/StaticPoolPacketManager.cpp
AgeCommit message (Collapse)Author
2026-04-14Fixing bugs related to 16-bit int on AVRDavid Barksdale
2026-03-01Also fix countBefore(0xFFFFFFFF) to return _numDaniel Novak
The signed comparison in countBefore breaks for the max uint32_t value. Even though callers now use getOutboundTotal(), the function itself should be correct for all inputs.
2026-02-28Replace 0xFFFFFFFF sentinel with explicit getOutboundTotal()Daniel Novak
Instead of overloading getOutboundCount() with a magic sentinel value, add a dedicated getOutboundTotal() method to the PacketManager interface that returns the total queue size without time filtering. This eliminates the fragile convention that caused the regression and makes the two operations — time-filtered count vs total count — explicitly separate in the API.
2026-02-28Fix countBefore sentinel regression from millis wraparound fixDaniel Novak
PR #1795 changed PacketQueue::countBefore() to use signed 2's complement arithmetic for millis wraparound safety. However, this broke the 0xFFFFFFFF sentinel pattern used by callers to mean "count all packets regardless of schedule". With the signed comparison, countBefore(0xFFFFFFFF) always returns 0, causing hasPendingWork() to report false and repeaters to sleep with packets still queued. Stats reporting also shows queue_len as 0. Add an early-return for the sentinel value before the loop, and document the sentinel convention on the virtual interface and implementation.
2026-02-22Fix millis() wraparound in PacketQueue time comparisonsDaniel Novak
PacketQueue::countBefore() and PacketQueue::get() use unsigned comparison (_schedule_table[j] > now) to check if a packet is scheduled for the future. This breaks when millis() wraps around after ~49.7 days: packets scheduled just before the wrap appear to be in the far future and get stuck in the queue. Use signed subtraction instead, matching the approach already used by Dispatcher::millisHasNowPassed(). This correctly handles the wraparound for time differences up to ~24.8 days in either direction, well beyond the maximum queue delay of 32 seconds.
2026-02-17Fix packet pool leak when rx queue is fullWessel Nieboer
PacketQueue::add() silently dropped packets when the queue was at capacity. The packet pointer was lost — never enqueued, never returned to the unused pool. Each occurrence permanently shrank the 32-packet pool until allocNew() returned NULL and the node went deaf. Return bool from add() and free the packet back to the pool on failure.
2025-05-14* Dispatcher::checkSend() bug: getOutboundCount() should only count ↵Scott Powell
non-future packets
2025-02-04* new packet score functionScott Powell
2025-02-04* new RX delays based on SNRScott Powell
2025-01-13Initial commitScott Powell