wifi: Add methods to check the type of the operating channel
This commit is contained in:
committed by
Stefano Avallone
parent
258920c0d6
commit
983dbc2254
@@ -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<FrequencyChannelType> (*m_channelIt) == WIFI_PHY_OFDM_CHANNEL;
|
||||
}
|
||||
|
||||
bool
|
||||
WifiPhyOperatingChannel::IsDsss (void) const
|
||||
{
|
||||
NS_ASSERT (IsSet ());
|
||||
return std::get<FrequencyChannelType> (*m_channelIt) == WIFI_PHY_DSSS_CHANNEL;
|
||||
}
|
||||
|
||||
bool
|
||||
WifiPhyOperatingChannel::Is80211p (void) const
|
||||
{
|
||||
NS_ASSERT (IsSet ());
|
||||
return std::get<FrequencyChannelType> (*m_channelIt) == WIFI_PHY_80211p_CHANNEL;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
WifiPhyOperatingChannel::GetPrimaryChannelIndex (uint16_t primaryChannelWidth) const
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user