diff --git a/src/wifi/helper/spectrum-wifi-helper.cc b/src/wifi/helper/spectrum-wifi-helper.cc index abd21004d..cf74ce265 100644 --- a/src/wifi/helper/spectrum-wifi-helper.cc +++ b/src/wifi/helper/spectrum-wifi-helper.cc @@ -148,7 +148,7 @@ SpectrumWifiPhyHelper::Create(Ptr node, Ptr device) const } InstallPhyInterfaces(i, phy); phy->SetChannelSwitchedCallback( - MakeCallback(&SpectrumWifiPhyHelper::SpectrumChannelSwitched, this).Bind(phy)); + MakeCallback(&SpectrumWifiPhyHelper::SpectrumChannelSwitched).Bind(phy)); phy->SetDevice(device); phy->SetMobility(node->GetObject()); ret.emplace_back(phy); @@ -178,9 +178,8 @@ SpectrumWifiPhyHelper::InstallPhyInterfaces(uint8_t linkId, Ptr } void -SpectrumWifiPhyHelper::SpectrumChannelSwitched(Ptr phy) const +SpectrumWifiPhyHelper::SpectrumChannelSwitched(Ptr phy) { - NS_LOG_FUNCTION(this << phy); for (const auto& otherPhy : phy->GetDevice()->GetPhys()) { auto spectrumPhy = DynamicCast(otherPhy); diff --git a/src/wifi/helper/spectrum-wifi-helper.h b/src/wifi/helper/spectrum-wifi-helper.h index 481f2ece2..85d955653 100644 --- a/src/wifi/helper/spectrum-wifi-helper.h +++ b/src/wifi/helper/spectrum-wifi-helper.h @@ -119,12 +119,6 @@ class SpectrumWifiPhyHelper : public WifiPhyHelper */ void InstallPhyInterfaces(uint8_t linkId, Ptr phy) const; - /** - * Function that is notified when a spectrum channel switched - * \param phy spectrum PHY instance that has switched its channel - */ - void SpectrumChannelSwitched(Ptr phy) const; - /** * \param channel The channel to inspect to possibly add a WifiBandwidthFilter * @@ -133,6 +127,12 @@ class SpectrumWifiPhyHelper : public WifiPhyHelper */ void AddWifiBandwidthFilter(Ptr channel); + /** + * Function that is notified when a spectrum channel switched + * \param phy spectrum PHY instance that has switched its channel + */ + static void SpectrumChannelSwitched(Ptr phy); + std::map> m_channels; ///< the spectrum channels std::map> m_interfacesMap; ///< map of the spectrum PHY interfaces to be added to the PHY instance