wifi: Delete PHY entities before changing PHY band

This commit is contained in:
Stefano Avallone
2021-11-30 11:19:00 +01:00
parent 52d84a6346
commit 02c078b3c0

View File

@@ -631,7 +631,7 @@ Ptr<PhyEntity>
WifiPhy::GetPhyEntity (WifiModulationClass modulation) const
{
const auto it = m_phyEntities.find (modulation);
NS_ABORT_MSG_IF (it == m_phyEntities.end (), "Unsupported Wi-Fi modulation class");
NS_ABORT_MSG_IF (it == m_phyEntities.end (), "Unsupported Wi-Fi modulation class " << modulation);
return it->second;
}
@@ -891,6 +891,10 @@ WifiPhy::ConfigureStandard (WifiPhyStandard standard)
return;
}
// this function is called when changing PHY band, hence we have to delete
// the previous PHY entities
m_phyEntities.clear ();
switch (standard)
{
case WIFI_PHY_STANDARD_80211a: