From 31a6342b24efec1c66e7f091c7dd7cf5771a1e75 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Mon, 1 Jul 2024 17:31:06 +0200 Subject: [PATCH] wifi: No need for scheduling SwitchToSleep() after 728f4651 --- src/wifi/model/wifi-phy.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/wifi/model/wifi-phy.cc b/src/wifi/model/wifi-phy.cc index 0a2f4683e..4952e10af 100644 --- a/src/wifi/model/wifi-phy.cc +++ b/src/wifi/model/wifi-phy.cc @@ -1426,13 +1426,7 @@ WifiPhy::SetSleepMode() // The PHY object may be in CCA_BUSY state because it is receiving a preamble. Cancel // preamble events before switching to sleep state Reset(); - // It may happen that we request to switch to sleep at the same time the reception of - // a PPDU ends. In such a case, WifiPhyStateHelper::GetState() does not return RX - // (m_endRx equals now), we get here and set the state to SLEEP. However, - // WifiPhyStateHelper::DoSwitchFromRx() may be called after this function (at the same - // simulation time), thus hitting the assert that checks that the state is IDLE or - // CCA_BUSY. - Simulator::ScheduleNow(&WifiPhyStateHelper::SwitchToSleep, m_state); + m_state->SwitchToSleep(); break; case WifiPhyState::SLEEP: NS_LOG_DEBUG("already in sleep mode");