wifi: Preamble detection events are always cleared when canceled

This commit is contained in:
Sébastien Deronne
2023-11-11 17:59:48 +01:00
committed by Sébastien Deronne
parent d5aab3adc6
commit 1c320d7d07
2 changed files with 7 additions and 16 deletions

View File

@@ -999,7 +999,7 @@ PhyEntity::EndPreambleDetectionPeriod(Ptr<Event> event)
// A bit convoluted but it enables to sync all PHYs
for (auto& it : m_wifiPhy->m_phyEntities)
{
it.second->CancelRunningEndPreambleDetectionEvents(true);
it.second->CancelRunningEndPreambleDetectionEvents();
}
for (auto it = m_wifiPhy->m_currentPreambleEvents.begin();
@@ -1089,11 +1089,7 @@ void
PhyEntity::CancelAllEvents()
{
NS_LOG_FUNCTION(this);
for (auto& endPreambleDetectionEvent : m_endPreambleDetectionEvents)
{
endPreambleDetectionEvent.Cancel();
}
m_endPreambleDetectionEvents.clear();
CancelRunningEndPreambleDetectionEvents();
for (auto& endRxPayloadEvent : m_endRxPayloadEvents)
{
endRxPayloadEvent.Cancel();
@@ -1113,17 +1109,14 @@ PhyEntity::NoEndPreambleDetectionEvents() const
}
void
PhyEntity::CancelRunningEndPreambleDetectionEvents(bool clear /* = false */)
PhyEntity::CancelRunningEndPreambleDetectionEvents()
{
NS_LOG_FUNCTION(this << clear);
NS_LOG_FUNCTION(this);
for (auto& endPreambleDetectionEvent : m_endPreambleDetectionEvents)
{
endPreambleDetectionEvent.Cancel();
}
if (clear)
{
m_endPreambleDetectionEvents.clear();
}
m_endPreambleDetectionEvents.clear();
}
void

View File

@@ -437,11 +437,9 @@ class PhyEntity : public SimpleRefCount<PhyEntity>
*/
bool NoEndPreambleDetectionEvents() const;
/**
* Cancel and eventually clear all end preamble detection events.
*
* \param clear whether to clear the end preamble detection events' list
* Cancel all end preamble detection events.
*/
void CancelRunningEndPreambleDetectionEvents(bool clear = false);
void CancelRunningEndPreambleDetectionEvents();
/**
* Return the STA ID that has been assigned to the station this PHY belongs to.