diff --git a/src/wifi/model/wifi-spectrum-phy-interface.cc b/src/wifi/model/wifi-spectrum-phy-interface.cc index 8ee0b907c..ca42ef2e3 100644 --- a/src/wifi/model/wifi-spectrum-phy-interface.cc +++ b/src/wifi/model/wifi-spectrum-phy-interface.cc @@ -44,6 +44,7 @@ WifiSpectrumPhyInterface::WifiSpectrumPhyInterface(FrequencyRange freqRange) : m_frequencyRange{freqRange}, m_centerFrequency{0}, m_channelWidth{0}, + m_bands{}, m_ruBands{} { NS_LOG_FUNCTION(this << freqRange); @@ -57,6 +58,7 @@ WifiSpectrumPhyInterface::DoDispose() m_spectrumWifiPhy = nullptr; m_netDevice = nullptr; m_channel = nullptr; + m_bands.clear(); m_ruBands.clear(); } @@ -155,6 +157,18 @@ WifiSpectrumPhyInterface::GetChannelWidth() const return m_channelWidth; } +void +WifiSpectrumPhyInterface::SetBands(WifiSpectrumPhyInterface::WifiSpectrumBands&& bands) +{ + m_bands = std::move(bands); +} + +const WifiSpectrumPhyInterface::WifiSpectrumBands& +WifiSpectrumPhyInterface::GetBands() const +{ + return m_bands; +} + void WifiSpectrumPhyInterface::SetRuBands(HePhy::RuBands&& ruBands) { diff --git a/src/wifi/model/wifi-spectrum-phy-interface.h b/src/wifi/model/wifi-spectrum-phy-interface.h index e967ca470..a050fa059 100644 --- a/src/wifi/model/wifi-spectrum-phy-interface.h +++ b/src/wifi/model/wifi-spectrum-phy-interface.h @@ -126,6 +126,22 @@ class WifiSpectrumPhyInterface : public SpectrumPhy uint32_t bandBandwidth, uint16_t guardBandwidth); + /// vector of spectrum bands handled by this interface + using WifiSpectrumBands = std::vector; + + /** + * Set the vector of spectrum bands handled by this interface + * + * \param bands vector of spectrum bands + */ + void SetBands(WifiSpectrumBands&& bands); + /** + * Get the vector of spectrum bands handled by this interface + * + * \return the vector of spectrum bands + */ + const WifiSpectrumBands& GetBands() const; + /** * Set the HE RU spectrum bands handled by this interface (if any) * @@ -150,6 +166,8 @@ class WifiSpectrumPhyInterface : public SpectrumPhy uint16_t m_channelWidth; ///< channel width in MHz Ptr m_rxSpectrumModel; ///< receive spectrum model + WifiSpectrumBands + m_bands; /**< Store all the distinct spectrum bands associated with every channels widths */ HePhy::RuBands m_ruBands; /**< Store all the distinct spectrum bands associated with every RU */ };