diff --git a/src/wifi/model/eht/default-emlsr-manager.cc b/src/wifi/model/eht/default-emlsr-manager.cc index 1f39656e2..320e53119 100644 --- a/src/wifi/model/eht/default-emlsr-manager.cc +++ b/src/wifi/model/eht/default-emlsr-manager.cc @@ -101,7 +101,17 @@ DefaultEmlsrManager::NotifyMainPhySwitch(uint8_t currLinkId, uint8_t nextLinkId, { // switch channel on Aux PHY so that it operates on the link on which the main PHY was // operating - SwitchAuxPhy(nextLinkId, currLinkId); + auto auxPhy = GetStaMac()->GetWifiPhy(nextLinkId); + + NS_LOG_DEBUG("Aux PHY (" << auxPhy << ") operating on link " << +nextLinkId + << " will switch to link " << +currLinkId << " in " + << duration.As(Time::US)); + Simulator::Schedule(duration, + &DefaultEmlsrManager::SwitchAuxPhy, + this, + auxPhy, + nextLinkId, + currLinkId); return; } diff --git a/src/wifi/model/eht/emlsr-manager.cc b/src/wifi/model/eht/emlsr-manager.cc index b669ae0d3..a333458c2 100644 --- a/src/wifi/model/eht/emlsr-manager.cc +++ b/src/wifi/model/eht/emlsr-manager.cc @@ -637,11 +637,9 @@ EmlsrManager::SwitchMainPhy(uint8_t linkId, } void -EmlsrManager::SwitchAuxPhy(uint8_t currLinkId, uint8_t nextLinkId) +EmlsrManager::SwitchAuxPhy(Ptr auxPhy, uint8_t currLinkId, uint8_t nextLinkId) { - NS_LOG_FUNCTION(this << currLinkId << nextLinkId); - - auto auxPhy = GetStaMac()->GetWifiPhy(currLinkId); + NS_LOG_FUNCTION(this << auxPhy << currLinkId << nextLinkId); auto newAuxPhyChannel = GetChannelForAuxPhy(nextLinkId); diff --git a/src/wifi/model/eht/emlsr-manager.h b/src/wifi/model/eht/emlsr-manager.h index 9c2aa46d6..d49df27c8 100644 --- a/src/wifi/model/eht/emlsr-manager.h +++ b/src/wifi/model/eht/emlsr-manager.h @@ -337,10 +337,11 @@ class EmlsrManager : public Object * Switch channel on the Aux PHY operating on the given current link so that it operates * on the given next link. * + * \param auxPhy the Aux PHY * \param currLinkId the ID of the link on which the aux PHY is currently operating * \param nextLinkId the ID of the link on which the aux PHY will be operating */ - void SwitchAuxPhy(uint8_t currLinkId, uint8_t nextLinkId); + void SwitchAuxPhy(Ptr auxPhy, uint8_t currLinkId, uint8_t nextLinkId); /** * Set the CCA ED threshold (if needed) on the given PHY that is switching channel to