diff --git a/src/mesh/MeshPacketQueue.cpp b/src/mesh/MeshPacketQueue.cpp index 87347f30..51af89df 100644 --- a/src/mesh/MeshPacketQueue.cpp +++ b/src/mesh/MeshPacketQueue.cpp @@ -72,6 +72,16 @@ MeshPacket *MeshPacketQueue::dequeue() return p; } +MeshPacket *MeshPacketQueue::getFront() +{ + if (empty()) { + return NULL; + } + + auto *p = queue.front(); + return p; +} + /** Attempt to find and remove a packet from this queue. Returns a pointer to the removed packet, or NULL if not found */ MeshPacket *MeshPacketQueue::remove(NodeNum from, PacketId id) { diff --git a/src/mesh/MeshPacketQueue.h b/src/mesh/MeshPacketQueue.h index c74addf4..8c93b452 100644 --- a/src/mesh/MeshPacketQueue.h +++ b/src/mesh/MeshPacketQueue.h @@ -28,6 +28,8 @@ class MeshPacketQueue MeshPacket *dequeue(); + MeshPacket *getFront(); + /** Attempt to find and remove a packet from this queue. Returns the packet which was removed from the queue */ MeshPacket *remove(NodeNum from, PacketId id); };