wifi: Add a parameter to HasBar to remove the BAR from the queue

This commit is contained in:
Stefano Avallone
2019-03-05 15:48:50 +01:00
parent ecd6d45dc2
commit 5f76fd45e0
2 changed files with 7 additions and 3 deletions

View File

@@ -432,13 +432,16 @@ BlockAckManager::RemovePacket (uint8_t tid, Mac48Address recipient, uint16_t seq
}
bool
BlockAckManager::HasBar (Bar &bar)
BlockAckManager::HasBar (Bar &bar, bool remove)
{
CleanupBuffers ();
if (m_bars.size () > 0)
{
bar = m_bars.front ();
m_bars.pop_front ();
if (remove)
{
m_bars.pop_front ();
}
return true;
}
return false;

View File

@@ -166,10 +166,11 @@ public:
* Returns true if the BAR is scheduled. Returns false otherwise.
*
* \param bar
* \param remove true if the BAR has to be removed from the queue
*
* \return true if a BAR is scheduled, false otherwise
*/
bool HasBar (Bar &bar);
bool HasBar (Bar &bar, bool remove = true);
/**
* Returns true if there are packets that need of retransmission or at least a
* BAR is scheduled. Returns false otherwise.