diff --git a/src/wifi/model/wifi-phy-operating-channel.cc b/src/wifi/model/wifi-phy-operating-channel.cc index 956967095..d930846ee 100644 --- a/src/wifi/model/wifi-phy-operating-channel.cc +++ b/src/wifi/model/wifi-phy-operating-channel.cc @@ -393,6 +393,27 @@ WifiPhyOperatingChannel::GetWidth (void) const return std::get<2> (*m_channelIt); } +bool +WifiPhyOperatingChannel::IsOfdm (void) const +{ + NS_ASSERT (IsSet ()); + return std::get (*m_channelIt) == WIFI_PHY_OFDM_CHANNEL; +} + +bool +WifiPhyOperatingChannel::IsDsss (void) const +{ + NS_ASSERT (IsSet ()); + return std::get (*m_channelIt) == WIFI_PHY_DSSS_CHANNEL; +} + +bool +WifiPhyOperatingChannel::Is80211p (void) const +{ + NS_ASSERT (IsSet ()); + return std::get (*m_channelIt) == WIFI_PHY_80211p_CHANNEL; +} + uint8_t WifiPhyOperatingChannel::GetPrimaryChannelIndex (uint16_t primaryChannelWidth) const { diff --git a/src/wifi/model/wifi-phy-operating-channel.h b/src/wifi/model/wifi-phy-operating-channel.h index 4b250e3b0..108ac033c 100644 --- a/src/wifi/model/wifi-phy-operating-channel.h +++ b/src/wifi/model/wifi-phy-operating-channel.h @@ -113,6 +113,24 @@ public: * \return the width of the whole operating channel (in MHz) */ uint16_t GetWidth (void) const; + /** + * Return whether the operating channel is an OFDM channel. + * + * \return whether the operating channel is an OFDM channel + */ + bool IsOfdm (void) const; + /** + * Return whether the operating channel is a DSSS channel. + * + * \return whether the operating channel is a DSSS channel + */ + bool IsDsss (void) const; + /** + * Return whether the operating channel is an 802.11p channel. + * + * \return whether the operating channel is an 802.11p channel + */ + bool Is80211p (void) const; /** * If the operating channel width is a multiple of 20 MHz, return the index of the