mirror of
https://github.com/meshtastic/firmware.git
synced 2026-09-28 09:17:07 -04:00
The TX queue was arrival-ordered, and extended advertising is set-and-repeat: a frame that leaves first holds the radio for a whole burst. So a position update queued ahead of an ack went out first and the ack waited behind it, which is exactly backwards for the one a sender is timing out waiting on. It is now a bag rather than a ring. runOnce picks the highest-priority slot and closes the gap; equal priorities still leave oldest-first, because priority is meant to order the queue, not to reorder within itself. A full queue makes room only for something strictly more important, the same trade MeshPacketQueue::replaceLowerPriorityPacket makes for LoRa, and the slot it displaces is the newest of the least important, so a frame that has already waited its turn is not the one thrown away. Refusals are counted in txDroppedQueueFull, kept separate from txDroppedTooLarge: one says the bearer cannot carry this packet at all, the other that it could not carry it right now. The slot carries the priority because the air copy no longer does - strippedForAir drops it, being local scheduling the receiver overwrites.