A Discrete-Event Network Simulator
API
ns3::WifiPhyOperatingChannel Class Reference

Class that keeps track of all information about the current PHY operating channel. More...

#include "wifi-phy-operating-channel.h"

+ Collaboration diagram for ns3::WifiPhyOperatingChannel:

Public Member Functions

 WifiPhyOperatingChannel ()
 Create an uninitialized PHY operating channel. More...
 
virtual ~WifiPhyOperatingChannel ()
 
uint16_t GetFrequency (void) const
 Return the center frequency of the operating channel (in MHz). More...
 
uint8_t GetNumber (void) const
 Return the channel number identifying the whole operating channel. More...
 
uint16_t GetPrimaryChannelCenterFrequency (uint16_t primaryChannelWidth) const
 Get the center frequency of the primary channel of the given width. More...
 
uint8_t GetPrimaryChannelIndex (uint16_t primaryChannelWidth) const
 If the operating channel width is a multiple of 20 MHz, return the index of the primary channel of the given width within the operating channel (0 indicates the 20 MHz subchannel with the lowest center frequency). More...
 
uint16_t GetWidth (void) const
 Return the width of the whole operating channel (in MHz). More...
 
bool IsSet (void) const
 Return true if a valid channel has been set, false otherwise. More...
 
void Set (uint8_t number, uint16_t frequency, uint16_t width, WifiPhyStandard standard, WifiPhyBand band)
 Set the channel according to the specified parameters if a unique frequency channel matches the specified criteria, or abort the simulation otherwise. More...
 
void SetDefault (uint16_t width, WifiPhyStandard standard, WifiPhyBand band)
 Set the default channel of the given width and for the given PHY standard and band. More...
 
void SetPrimary20Index (uint8_t index)
 Set the index of the primary 20 MHz channel (0 indicates the 20 MHz subchannel with the lowest center frequency). More...
 

Private Types

typedef std::set< FrequencyChannelInfo >::const_iterator ConstIterator
 Typedef for a const iterator pointing to a channel in the set of available channels. More...
 

Private Member Functions

ConstIterator FindFirst (uint8_t number, uint16_t frequency, uint16_t width, WifiPhyStandard standard, WifiPhyBand band, ConstIterator start) const
 Find the first channel matching the specified parameters. More...
 

Private Attributes

ConstIterator m_channelIt
 const iterator pointing to the configured frequency channel More...
 
uint8_t m_primary20Index
 index of the primary20 channel (0 indicates the 20 MHz subchannel with the lowest center frequency) More...
 

Detailed Description

Class that keeps track of all information about the current PHY operating channel.

Definition at line 43 of file wifi-phy-operating-channel.h.

Member Typedef Documentation

◆ ConstIterator

typedef std::set<FrequencyChannelInfo>::const_iterator ns3::WifiPhyOperatingChannel::ConstIterator
private

Typedef for a const iterator pointing to a channel in the set of available channels.

Definition at line 130 of file wifi-phy-operating-channel.h.

Constructor & Destructor Documentation

◆ WifiPhyOperatingChannel()

ns3::WifiPhyOperatingChannel::WifiPhyOperatingChannel ( )

Create an uninitialized PHY operating channel.

Definition at line 30 of file wifi-phy-operating-channel.cc.

References NS_LOG_FUNCTION.

◆ ~WifiPhyOperatingChannel()

ns3::WifiPhyOperatingChannel::~WifiPhyOperatingChannel ( )
virtual

Definition at line 37 of file wifi-phy-operating-channel.cc.

References NS_LOG_FUNCTION_NOARGS.

Member Function Documentation

◆ FindFirst()

WifiPhyOperatingChannel::ConstIterator ns3::WifiPhyOperatingChannel::FindFirst ( uint8_t  number,
uint16_t  frequency,
uint16_t  width,
WifiPhyStandard  standard,
WifiPhyBand  band,
ConstIterator  start 
) const
private

Find the first channel matching the specified parameters.

Parameters
numberthe channel number (use 0 to leave it unspecified)
frequencythe channel center frequency in MHz (use 0 to leave it unspecified)
widththe channel width in MHz (use 0 to leave it unspecified)
standardthe PHY standard
bandthe PHY band
startan iterator pointing to the channel to start the search with
Returns
an iterator pointing to the found channel, if any, or to past-the-end of the set of available channels

Definition at line 90 of file wifi-phy-operating-channel.cc.

References third::channel, ns3::GetFrequencyChannelType(), ns3::GetMaximumChannelWidth(), ns3::WifiPhy::m_frequencyChannels, NS_LOG_FUNCTION, and visualizer.core::start().

Referenced by Set(), and SetDefault().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetFrequency()

uint16_t ns3::WifiPhyOperatingChannel::GetFrequency ( void  ) const

Return the center frequency of the operating channel (in MHz).

Returns
the center frequency of the operating channel (in MHz)

Definition at line 137 of file wifi-phy-operating-channel.cc.

References IsSet(), and NS_ASSERT.

Referenced by ns3::WifiPhy::GetFrequency(), and GetPrimaryChannelCenterFrequency().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNumber()

uint8_t ns3::WifiPhyOperatingChannel::GetNumber ( void  ) const

Return the channel number identifying the whole operating channel.

Returns
the channel number identifying the whole operating channel

Definition at line 130 of file wifi-phy-operating-channel.cc.

References IsSet(), and NS_ASSERT.

Referenced by ns3::WifiPhy::GetChannelNumber().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPrimaryChannelCenterFrequency()

uint16_t ns3::WifiPhyOperatingChannel::GetPrimaryChannelCenterFrequency ( uint16_t  primaryChannelWidth) const

Get the center frequency of the primary channel of the given width.

Parameters
primaryChannelWidththe width of the primary channel in MHz
Returns
the center frequency of the primary channel of the given width

Definition at line 187 of file wifi-phy-operating-channel.cc.

References GetFrequency(), GetPrimaryChannelIndex(), GetWidth(), and NS_LOG_FUNCTION.

Referenced by ns3::PhyEntity::GetCenterFrequencyForChannelWidth(), and ns3::SpectrumWifiPhy::StartRx().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPrimaryChannelIndex()

uint8_t ns3::WifiPhyOperatingChannel::GetPrimaryChannelIndex ( uint16_t  primaryChannelWidth) const

If the operating channel width is a multiple of 20 MHz, return the index of the primary channel of the given width within the operating channel (0 indicates the 20 MHz subchannel with the lowest center frequency).

Otherwise, return 0.

Parameters
primaryChannelWidththe width of the primary channel in MHz
Returns
the index of the requested primary channel within the operating channel

Definition at line 151 of file wifi-phy-operating-channel.cc.

References GetWidth(), m_primary20Index, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by ns3::HePhy::GetCenterFrequencyForNonOfdmaPart(), ns3::HePhy::GetNonOfdmaBand(), ns3::WifiPhy::GetPrimaryBand(), GetPrimaryChannelCenterFrequency(), ns3::HePhy::GetRuBandForRx(), ns3::WifiPhy::Send(), and ns3::SpectrumWifiPhy::UpdateInterferenceHelperBands().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetWidth()

uint16_t ns3::WifiPhyOperatingChannel::GetWidth ( void  ) const

Return the width of the whole operating channel (in MHz).

Returns
the width of the whole operating channel (in MHz)

Definition at line 144 of file wifi-phy-operating-channel.cc.

References IsSet(), and NS_ASSERT.

Referenced by ns3::WifiPhy::GetChannelWidth(), GetPrimaryChannelCenterFrequency(), GetPrimaryChannelIndex(), and SetPrimary20Index().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsSet()

bool ns3::WifiPhyOperatingChannel::IsSet ( void  ) const

Return true if a valid channel has been set, false otherwise.

Returns
true if a valid channel has been set, false otherwise

Definition at line 43 of file wifi-phy-operating-channel.cc.

References m_channelIt, and ns3::WifiPhy::m_frequencyChannels.

Referenced by SetChannelFrequencyTest::DoRun(), GetFrequency(), GetNumber(), GetWidth(), ns3::WifiPhy::SetChannelNumber(), ns3::WifiPhy::SetChannelWidth(), ns3::WifiPhy::SetFrequency(), ns3::WifiPhy::SetOperatingChannel(), and ns3::WifiPhy::SetPrimary20Index().

+ Here is the caller graph for this function:

◆ Set()

void ns3::WifiPhyOperatingChannel::Set ( uint8_t  number,
uint16_t  frequency,
uint16_t  width,
WifiPhyStandard  standard,
WifiPhyBand  band 
)

Set the channel according to the specified parameters if a unique frequency channel matches the specified criteria, or abort the simulation otherwise.

If the channel width is a multiple of 20 MHz, the primary 20 MHz channel is set to the 20 MHz subchannel with the lowest center frequency.

Parameters
numberthe channel number (use 0 to leave it unspecified)
frequencythe channel center frequency in MHz (use 0 to leave it unspecified)
widththe channel width in MHz (use 0 to leave it unspecified)
standardthe PHY standard
bandthe PHY band

Definition at line 49 of file wifi-phy-operating-channel.cc.

References FindFirst(), m_channelIt, ns3::WifiPhy::m_frequencyChannels, m_primary20Index, and NS_LOG_FUNCTION.

Referenced by ns3::WifiPhy::ConfigureStandardAndBand(), and ns3::WifiPhy::SetOperatingChannel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetDefault()

void ns3::WifiPhyOperatingChannel::SetDefault ( uint16_t  width,
WifiPhyStandard  standard,
WifiPhyBand  band 
)

Set the default channel of the given width and for the given PHY standard and band.

If the channel width is a multiple of 20 MHz, the primary 20 MHz channel is set to the 20 MHz subchannel with the lowest center frequency.

Parameters
widththe channel width in MHz
standardthe PHY standard
bandthe PHY band

Definition at line 71 of file wifi-phy-operating-channel.cc.

References FindFirst(), m_channelIt, ns3::WifiPhy::m_frequencyChannels, m_primary20Index, and NS_LOG_FUNCTION.

Referenced by ns3::WifiPhy::ConfigureStandardAndBand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetPrimary20Index()

void ns3::WifiPhyOperatingChannel::SetPrimary20Index ( uint8_t  index)

Set the index of the primary 20 MHz channel (0 indicates the 20 MHz subchannel with the lowest center frequency).

Parameters
indexthe index of the primary 20 MHz channel

Definition at line 178 of file wifi-phy-operating-channel.cc.

References GetWidth(), m_primary20Index, NS_ABORT_MSG_IF, and NS_LOG_FUNCTION.

Referenced by ns3::WifiPhy::ConfigureStandardAndBand(), and ns3::WifiPhy::SetPrimary20Index().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_channelIt

ConstIterator ns3::WifiPhyOperatingChannel::m_channelIt
private

const iterator pointing to the configured frequency channel

Definition at line 148 of file wifi-phy-operating-channel.h.

Referenced by IsSet(), Set(), and SetDefault().

◆ m_primary20Index

uint8_t ns3::WifiPhyOperatingChannel::m_primary20Index
private

index of the primary20 channel (0 indicates the 20 MHz subchannel with the lowest center frequency)

Definition at line 149 of file wifi-phy-operating-channel.h.

Referenced by GetPrimaryChannelIndex(), Set(), SetDefault(), and SetPrimary20Index().


The documentation for this class was generated from the following files: