From 3a155c2607f8b86da28d25f2b8518fbab90b3293 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Tue, 27 Apr 2021 22:49:56 +0200 Subject: [PATCH] wifi: Get the PHY band of the operating channel --- src/wifi/model/wifi-phy-operating-channel.cc | 7 +++++++ src/wifi/model/wifi-phy-operating-channel.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/src/wifi/model/wifi-phy-operating-channel.cc b/src/wifi/model/wifi-phy-operating-channel.cc index 0a211ea88..0d4df8fab 100644 --- a/src/wifi/model/wifi-phy-operating-channel.cc +++ b/src/wifi/model/wifi-phy-operating-channel.cc @@ -393,6 +393,13 @@ WifiPhyOperatingChannel::GetWidth (void) const return std::get<2> (*m_channelIt); } +WifiPhyBand +WifiPhyOperatingChannel::GetPhyBand (void) const +{ + NS_ASSERT (IsSet ()); + return std::get<4> (*m_channelIt); +} + bool WifiPhyOperatingChannel::IsOfdm (void) const { diff --git a/src/wifi/model/wifi-phy-operating-channel.h b/src/wifi/model/wifi-phy-operating-channel.h index 054654c26..d4470b0c7 100644 --- a/src/wifi/model/wifi-phy-operating-channel.h +++ b/src/wifi/model/wifi-phy-operating-channel.h @@ -113,6 +113,12 @@ public: * \return the width of the whole operating channel (in MHz) */ uint16_t GetWidth (void) const; + /** + * Return the PHY band of the operating channel + * + * \return the PHY band of the operating channel + */ + WifiPhyBand GetPhyBand (void) const; /** * Return whether the operating channel is an OFDM channel. *