mirror of
https://github.com/meshtastic/firmware.git
synced 2025-05-02 12:03:56 +00:00
make sure the queue stays in te same order
the memory pool can NOT be iterated easily, since it's not a linear object.
This commit is contained in:
parent
385b29c977
commit
d952da8b1e
@ -146,12 +146,12 @@ NodeNum MeshService::getNodenumFromRequestId(uint32_t request_id)
|
||||
NodeNum nodenum = 0;
|
||||
for (int i = 0; i < toPhoneQueue.numUsed(); i++) {
|
||||
meshtastic_MeshPacket *p = toPhoneQueue.dequeuePtr(0);
|
||||
// put it right back on the queue
|
||||
toPhoneQueue.enqueue(p, 0);
|
||||
if (p->id == request_id) {
|
||||
nodenum = p->to;
|
||||
break;
|
||||
// make sure to continue this to make one full loop
|
||||
}
|
||||
// put it right back on the queue
|
||||
toPhoneQueue.enqueue(p, 0);
|
||||
}
|
||||
return nodenum;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user