Handle repeated/fallback to flooding packets properly

First check if it's not still in the TxQueue
This commit is contained in:
GUVWAF
2024-11-16 16:32:24 +01:00
parent 360637c25d
commit bfc6a1940d
15 changed files with 122 additions and 49 deletions

View File

@@ -133,6 +133,12 @@ bool SimRadio::cancelSending(NodeNum from, PacketId id)
return result;
}
/** Attempt to find a packet in the TxQueue. Returns true if the packet was found. */
bool SimRadio::findInTxQueue(NodeNum from, PacketId id)
{
return txQueue.find(from, id);
}
void SimRadio::onNotify(uint32_t notification)
{
switch (notification) {
@@ -265,4 +271,4 @@ int16_t SimRadio::readData(uint8_t *data, size_t len)
}
return state;
}
}

View File

@@ -38,6 +38,9 @@ class SimRadio : public RadioInterface, protected concurrency::NotifiedWorkerThr
/** Attempt to cancel a previously sent packet. Returns true if a packet was found we could cancel */
virtual bool cancelSending(NodeNum from, PacketId id) override;
/** Attempt to find a packet in the TxQueue. Returns true if the packet was found. */
virtual bool findInTxQueue(NodeNum from, PacketId id) override;
/**
* Start waiting to receive a message
*