A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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:

Classes

struct  Compare
 Comparison functor used to sort the segments by increasing frequencies. More...
 

Public Types

using ConstIterator = std::set<FrequencyChannelInfo>::const_iterator
 Typedef for a const iterator pointing to a channel in the set of available channels.
 
using ConstIteratorSet = std::set<ConstIterator, Compare>
 Typedef for a set of const iterator pointing to the segments of a channel.
 

Public Member Functions

 WifiPhyOperatingChannel ()
 Create an uninitialized PHY operating channel.
 
 WifiPhyOperatingChannel (const ConstIteratorSet &its)
 Create a PHY operating channel from iterators pointing to multiple frequency segments in the set of available channels.
 
 WifiPhyOperatingChannel (ConstIterator it)
 Create a PHY operating channel from an iterator pointing to a channel in the set of available channels.
 
virtual ~WifiPhyOperatingChannel ()
 
std::set< uint8_t > Get20MHzIndicesCoveringRu (HeRu::RuSpec ru, MHz_u width) const
 Get the channel indices of the minimum subset of 20 MHz channels containing the given RU.
 
std::set< uint8_t > GetAll20MHzChannelIndicesInPrimary (MHz_u width) const
 Get the channel indices of all the 20 MHz channels included in the primary channel of the given width, if such primary channel exists, or an empty set, otherwise.
 
std::set< uint8_t > GetAll20MHzChannelIndicesInSecondary (const std::set< uint8_t > &primaryIndices) const
 Get the channel indices of all the 20 MHz channels included in the secondary channel corresponding to the given primary channel, if such secondary channel exists, or an empty set, otherwise.
 
std::set< uint8_t > GetAll20MHzChannelIndicesInSecondary (MHz_u width) const
 Get the channel indices of all the 20 MHz channels included in the secondary channel of the given width, if such secondary channel exists, or an empty set, otherwise.
 
std::vector< MHz_uGetFrequencies () const
 Return the center frequency per segment.
 
MHz_u GetFrequency (std::size_t segment=0) const
 Return the center frequency for a given frequency segment.
 
std::size_t GetNSegments () const
 Get the number of frequency segments in the operating channel.
 
uint8_t GetNumber (std::size_t segment=0) const
 Return the channel number for a given frequency segment.
 
std::vector< uint8_t > GetNumbers () const
 Return the channel number per segment.
 
WifiPhyBand GetPhyBand () const
 Return the PHY band of the operating channel.
 
WifiPhyOperatingChannel GetPrimaryChannel (MHz_u primaryChannelWidth) const
 Get a WifiPhyOperatingChannel object corresponding to the primary channel of the given width.
 
MHz_u GetPrimaryChannelCenterFrequency (MHz_u primaryChannelWidth) const
 Get the center frequency of the primary channel of the given width.
 
uint8_t GetPrimaryChannelIndex (MHz_u 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).
 
uint8_t GetPrimaryChannelNumber (MHz_u primaryChannelWidth, WifiStandard standard) const
 Get channel number of the primary channel.
 
uint8_t GetPrimarySegmentIndex (MHz_u primaryChannelWidth) const
 Get the index of the segment that contains a given primary channel.
 
MHz_u GetSecondaryChannelCenterFrequency (MHz_u secondaryChannelWidth) const
 Get the center frequency of the secondary channel of the given width.
 
uint8_t GetSecondaryChannelIndex (MHz_u secondaryChannelWidth) const
 If the operating channel width is made of a multiple of 20 MHz, return the index of the secondary channel of the given width within the operating channel (0 indicates the 20 MHz subchannel with the lowest center frequency).
 
uint8_t GetSecondarySegmentIndex (MHz_u secondaryChannelWidth) const
 Get the index of the segment that contains a given secondary channel.
 
MHz_u GetTotalWidth () const
 Return the width of the whole operating channel.
 
MHz_u GetWidth (std::size_t segment=0) const
 Return the channel width for a given frequency segment.
 
std::vector< MHz_uGetWidths () const
 Return the channel width per segment.
 
WifiChannelWidthType GetWidthType () const
 Return the width type of the operating channel.
 
bool Is80211p () const
 Return whether the operating channel is an 802.11p channel.
 
bool IsDsss () const
 Return whether the operating channel is a DSSS channel.
 
bool IsOfdm () const
 Return whether the operating channel is an OFDM channel.
 
bool IsSet () const
 Return true if a valid channel has been set, false otherwise.
 
bool operator!= (const WifiPhyOperatingChannel &other) const
 Check if the given WifiPhyOperatingChannel is different.
 
bool operator== (const WifiPhyOperatingChannel &other) const
 Check if the given WifiPhyOperatingChannel is equivalent.
 
void Set (const std::vector< FrequencyChannelInfo > &segments, WifiStandard standard)
 Set the channel according to the specified parameters if a unique frequency channel matches the specified criteria, or abort the simulation otherwise.
 
void SetDefault (MHz_u width, WifiStandard standard, WifiPhyBand band)
 Set the default channel of the given width and for the given standard and band.
 
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 among all segments).
 

Static Public Member Functions

static ConstIterator FindFirst (uint8_t number, MHz_u frequency, MHz_u width, WifiStandard standard, WifiPhyBand band, ConstIterator start=m_frequencyChannels.begin())
 Find the first frequency segment matching the specified parameters.
 
static uint8_t GetDefaultChannelNumber (MHz_u width, WifiStandard standard, WifiPhyBand band, std::optional< uint8_t > previousChannelNumber=std::nullopt)
 Get the default channel number for a given segment of the given width and for the given standard and band.
 

Static Public Attributes

static const std::set< FrequencyChannelInfom_frequencyChannels
 Available frequency channels.
 

Private Attributes

ConstIteratorSet m_channelIts
 const iterators pointing to the configured frequency channel
 
uint8_t m_primary20Index
 index of the primary20 channel (0 indicates the 20 MHz subchannel with the lowest center frequency)
 

Detailed Description

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

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

Member Typedef Documentation

◆ ConstIterator

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

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

◆ ConstIteratorSet

Typedef for a set of const iterator pointing to the segments of a channel.

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

Constructor & Destructor Documentation

◆ WifiPhyOperatingChannel() [1/3]

ns3::WifiPhyOperatingChannel::WifiPhyOperatingChannel ( )

Create an uninitialized PHY operating channel.

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

◆ WifiPhyOperatingChannel() [2/3]

ns3::WifiPhyOperatingChannel::WifiPhyOperatingChannel ( ConstIterator it)

Create a PHY operating channel from an iterator pointing to a channel in the set of available channels.

Parameters
itthe iterator pointing to a channel in the set of available channels

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

◆ WifiPhyOperatingChannel() [3/3]

ns3::WifiPhyOperatingChannel::WifiPhyOperatingChannel ( const ConstIteratorSet & its)

Create a PHY operating channel from iterators pointing to multiple frequency segments in the set of available channels.

Parameters
itsthe iterators pointing to frequency segments in the set of available channels

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

References NS_ASSERT_MSG, and NS_LOG_FUNCTION.

◆ ~WifiPhyOperatingChannel()

ns3::WifiPhyOperatingChannel::~WifiPhyOperatingChannel ( )
virtual

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

References NS_LOG_FUNCTION_NOARGS.

Member Function Documentation

◆ FindFirst()

WifiPhyOperatingChannel::ConstIterator ns3::WifiPhyOperatingChannel::FindFirst ( uint8_t number,
MHz_u frequency,
MHz_u width,
WifiStandard standard,
WifiPhyBand band,
ConstIterator start = m_frequencyChannels.begin() )
static

Find the first frequency segment 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 (use 0 to leave it unspecified)
standardthe standard (use WIFI_STANDARD_UNSPECIFIED not to check whether a channel is suitable for a specific 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 435 of file wifi-phy-operating-channel.cc.

References ns3::GetFrequencyChannelType(), ns3::GetMaximumChannelWidth(), ns3::GetModulationClassForStandard(), m_frequencyChannels, ns3::WIFI_PHY_BAND_UNSPECIFIED, ns3::WIFI_STANDARD_UNSPECIFIED, and ns3::wifiStandards.

Referenced by TestPrimary20CoveredByPpdu::CreatePpdu(), ReducedNeighborReportTest::DoRun(), SpectrumWifiPhyMultipleInterfacesTest::DoRun(), TestNonHtDuplicatePhyReception::DoRun(), TestMultipleCtsResponsesFromMuRts::DoSetup(), TestNonHtDuplicatePhyReception::DoSetup(), TestPhyPaddingExclusion::DoSetup(), TestUlOfdmaPpduUid::DoSetup(), WifiPhyCcaThresholdsTest::DoSetup(), GetDefaultChannelNumber(), GetPrimaryChannel(), GetPrimaryChannelNumber(), SpectrumWifiPhyFilterTest::RunOne(), SpectrumWifiPhyGetBandTest::RunOne(), TestDlMuMimoPhyTransmission::RunOne(), TestDlOfdmaPhyPuncturing::RunOne(), TestDlOfdmaPhyTransmission::RunOne(), TestPrimary20CoveredByPpdu::RunOne(), TestUlMuMimoPhyTransmission::RunOne(), TestUlOfdmaPhyTransmission::RunOne(), WifiPhyCcaIndicationTest::RunOne(), WifiPhyCcaIndicationTest::SendHeSuPpdu(), Set(), SpectrumWifiPhy80Plus80Test::SwitchChannel(), and SpectrumWifiPhyTrackedBandsTest::SwitchChannel().

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

◆ Get20MHzIndicesCoveringRu()

std::set< uint8_t > ns3::WifiPhyOperatingChannel::Get20MHzIndicesCoveringRu ( HeRu::RuSpec ru,
MHz_u width ) const

Get the channel indices of the minimum subset of 20 MHz channels containing the given RU.

Parameters
ruthe given RU
widththe width of the channel to which the given RU refers to; normally, it is the width of the PPDU for which the RU is allocated
Returns
the channel indices of the minimum subset of 20 MHz channels containing the given RU

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

References GetAll20MHzChannelIndicesInPrimary(), GetAll20MHzChannelIndicesInSecondary(), ns3::HeRu::GetBandwidth(), ns3::HeRu::RuSpec::GetIndex(), ns3::HeRu::GetNRus(), ns3::HeRu::RuSpec::GetPrimary80MHz(), GetPrimaryChannelIndex(), ns3::HeRu::RuSpec::GetRuType(), GetTotalWidth(), m_primary20Index, NS_ABORT_MSG, NS_ASSERT, NS_ASSERT_MSG, ns3::HeRu::RU_106_TONE, ns3::HeRu::RU_242_TONE, ns3::HeRu::RU_26_TONE, ns3::HeRu::RU_2x996_TONE, ns3::HeRu::RU_484_TONE, ns3::HeRu::RU_52_TONE, and ns3::HeRu::RU_996_TONE.

Referenced by Wifi20MHzIndicesCoveringRuTest::RunOne().

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

◆ GetAll20MHzChannelIndicesInPrimary()

std::set< uint8_t > ns3::WifiPhyOperatingChannel::GetAll20MHzChannelIndicesInPrimary ( MHz_u width) const

Get the channel indices of all the 20 MHz channels included in the primary channel of the given width, if such primary channel exists, or an empty set, otherwise.

Parameters
widththe width of the primary channel
Returns
the channel indices of all the 20 MHz channels included in the primary channel of the given width, if such primary channel exists, or an empty set, otherwise

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

References GetAll20MHzChannelIndicesInSecondary(), GetTotalWidth(), and m_primary20Index.

Referenced by Get20MHzIndicesCoveringRu(), GetAll20MHzChannelIndicesInSecondary(), ns3::HePhy::GetPer20MHzDurations(), ns3::HePhy::GetTxPowerSpectralDensity(), and Wifi20MHzChannelIndicesTest::RunOne().

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

◆ GetAll20MHzChannelIndicesInSecondary() [1/2]

std::set< uint8_t > ns3::WifiPhyOperatingChannel::GetAll20MHzChannelIndicesInSecondary ( const std::set< uint8_t > & primaryIndices) const

Get the channel indices of all the 20 MHz channels included in the secondary channel corresponding to the given primary channel, if such secondary channel exists, or an empty set, otherwise.

Parameters
primaryIndicesthe channel indices of all the 20 MHz channels included in the primary channel
Returns
the channel indices of all the 20 MHz channels included in the secondary channel corresponding to the given primary channel, if such secondary channel exists, or an empty set, otherwise

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

References GetTotalWidth().

+ Here is the call graph for this function:

◆ GetAll20MHzChannelIndicesInSecondary() [2/2]

std::set< uint8_t > ns3::WifiPhyOperatingChannel::GetAll20MHzChannelIndicesInSecondary ( MHz_u width) const

Get the channel indices of all the 20 MHz channels included in the secondary channel of the given width, if such secondary channel exists, or an empty set, otherwise.

Parameters
widththe width of the secondary channel
Returns
the channel indices of all the 20 MHz channels included in the secondary channel of the given width, if such secondary channel exists, or an empty set, otherwise

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

References GetAll20MHzChannelIndicesInPrimary(), and GetAll20MHzChannelIndicesInSecondary().

Referenced by Get20MHzIndicesCoveringRu(), GetAll20MHzChannelIndicesInPrimary(), GetAll20MHzChannelIndicesInSecondary(), and Wifi20MHzChannelIndicesTest::RunOne().

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

◆ GetDefaultChannelNumber()

uint8_t ns3::WifiPhyOperatingChannel::GetDefaultChannelNumber ( MHz_u width,
WifiStandard standard,
WifiPhyBand band,
std::optional< uint8_t > previousChannelNumber = std::nullopt )
static

Get the default channel number for a given segment of the given width and for the given standard and band.

Parameters
widththe channel width
standardthe standard
bandthe PHY band
previousChannelNumberthe channel number of the previous (in frequency) segment (if non-contiguous operating channel is used). If there is no place for another segment that is not contiguous to that previous one (at a higher frequency), an error is thrown
Returns
the default channel number

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

References FindFirst(), and m_frequencyChannels.

Referenced by ns3::WifiPhy::DoChannelSwitch(), and SetDefault().

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

◆ GetFrequencies()

std::vector< MHz_u > ns3::WifiPhyOperatingChannel::GetFrequencies ( ) const

Return the center frequency per segment.

Segments are ordered by increasing frequencies.

Returns
the center frequency per segment

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

References IsSet(), m_channelIts, and NS_ASSERT.

Referenced by ns3::SpectrumWifiPhy::DoChannelSwitch(), ns3::SpectrumWifiPhy::FinalizeChannelSwitch(), ns3::HePhy::GetNonOfdmaBand(), ns3::HePhy::GetRuBandForRx(), and ns3::HePhy::GetRuBandForTx().

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

◆ GetFrequency()

MHz_u ns3::WifiPhyOperatingChannel::GetFrequency ( std::size_t segment = 0) const

Return the center frequency for a given frequency segment.

Segments are ordered by increasing frequencies, hence by default it returns the center frequency of the segment occuping the lowest frequencies when a non-contiguous operating channel is used.

Parameters
segmentthe index of the frequency segment (if operating channel is non-contiguous)
Returns
the center frequency for a given frequency segment

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

References IsSet(), m_channelIts, and NS_ASSERT.

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

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

◆ GetNSegments()

std::size_t ns3::WifiPhyOperatingChannel::GetNSegments ( ) const

Get the number of frequency segments in the operating channel.

This is only more than one if a non-contiguous operating channel is used.

Returns
the number of frequency segments

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

References m_channelIts.

Referenced by ns3::SpectrumWifiPhy::FinalizeChannelSwitch(), and SetWifiOperatingChannelTest::RunOne().

+ Here is the caller graph for this function:

◆ GetNumber()

uint8_t ns3::WifiPhyOperatingChannel::GetNumber ( std::size_t segment = 0) const

Return the channel number for a given frequency segment.

Segments are ordered by increasing frequencies, hence by default it returns the channel number of the segment occuping the lowest frequencies when a non-contiguous operating channel is used.

Parameters
segmentthe index of the frequency segment (if operating channel is non-contiguous)
Returns
the channel number for a given frequency segment

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

References IsSet(), m_channelIts, and NS_ASSERT.

Referenced by ns3::WifiPhy::GetChannelNumber(), and SetWifiOperatingChannelTest::RunOne().

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

◆ GetNumbers()

std::vector< uint8_t > ns3::WifiPhyOperatingChannel::GetNumbers ( ) const

Return the channel number per segment.

Segments are ordered by increasing frequencies.

Returns
the channel number per segment

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

References IsSet(), m_channelIts, and NS_ASSERT.

+ Here is the call graph for this function:

◆ GetPhyBand()

WifiPhyBand ns3::WifiPhyOperatingChannel::GetPhyBand ( ) const

Return the PHY band of the operating channel.

Returns
the PHY band of the operating channel

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

References IsSet(), m_channelIts, and NS_ASSERT.

Referenced by GetPrimaryChannel(), GetPrimaryChannelNumber(), ns3::HtPpdu::GetTxDuration(), ns3::OfdmPpdu::GetTxDuration(), SetWifiOperatingChannelTest::RunOne(), ns3::HePpdu::SetLSigHeader(), and ns3::HtPpdu::SetLSigHeader().

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

◆ GetPrimaryChannel()

WifiPhyOperatingChannel ns3::WifiPhyOperatingChannel::GetPrimaryChannel ( MHz_u primaryChannelWidth) const

Get a WifiPhyOperatingChannel object corresponding to the primary channel of the given width.

Parameters
primaryChannelWidththe width of the primary channel in MHz
Returns
a WifiPhyOperatingChannel object corresponding to the primary channel of the given width

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

References FindFirst(), GetPhyBand(), GetPrimaryChannelCenterFrequency(), GetPrimaryChannelIndex(), GetTotalWidth(), IsSet(), m_frequencyChannels, m_primary20Index, NS_ABORT_MSG_IF, NS_ASSERT_MSG, SetPrimary20Index(), and ns3::WIFI_STANDARD_UNSPECIFIED.

+ Here is the call graph for this function:

◆ GetPrimaryChannelCenterFrequency()

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

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

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

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

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

Referenced by ns3::PhyEntity::CanStartRx(), WifiPhyChannel80Plus80Test::DoRun(), ns3::HtPhy::GetCcaIndication(), ns3::VhtPhy::GetCcaIndication(), GetPrimaryChannel(), and GetPrimaryChannelNumber().

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

◆ GetPrimaryChannelIndex()

uint8_t ns3::WifiPhyOperatingChannel::GetPrimaryChannelIndex ( MHz_u 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
Returns
the index of the requested primary channel within the operating channel

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

References GetTotalWidth(), m_primary20Index, NS_ASSERT, and NS_LOG_DEBUG.

Referenced by WifiPhyChannel80Plus80Test::DoRun(), Get20MHzIndicesCoveringRu(), ns3::HePhy::GetCenterFrequenciesForNonHePart(), ns3::SpectrumWifiPhy::GetHeRuBands(), ns3::HePhy::GetNonOfdmaBand(), ns3::WifiPhy::GetPrimary20Index(), ns3::PhyEntity::GetPrimaryBand(), GetPrimaryChannel(), GetPrimaryChannelCenterFrequency(), GetPrimarySegmentIndex(), ns3::HePhy::GetRuBandForRx(), ns3::HePhy::GetRuBandForTx(), GetSecondaryChannelIndex(), ns3::EhtPhy::GetSigBSize(), ns3::HePhy::GetSigBSize(), ns3::HePhy::GetTxPowerSpectralDensity(), ns3::EhtPpdu::SetEhtPhyHeader(), ns3::HePpdu::SetHeSigHeader(), ns3::EhtPpdu::SetTxVectorFromPhyHeaders(), and ns3::HePpdu::SetTxVectorFromPhyHeaders().

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

◆ GetPrimaryChannelNumber()

uint8_t ns3::WifiPhyOperatingChannel::GetPrimaryChannelNumber ( MHz_u primaryChannelWidth,
WifiStandard standard ) const

Get channel number of the primary channel.

Parameters
primaryChannelWidththe width of the primary channel
standardthe standard
Returns
channel number of the primary channel

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

References FindFirst(), GetPhyBand(), GetPrimaryChannelCenterFrequency(), GetWidth(), IsSet(), m_frequencyChannels, NS_ABORT_MSG_IF, and NS_ASSERT_MSG.

Referenced by WifiPhyChannel80Plus80Test::DoRun().

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

◆ GetPrimarySegmentIndex()

uint8_t ns3::WifiPhyOperatingChannel::GetPrimarySegmentIndex ( MHz_u primaryChannelWidth) const

Get the index of the segment that contains a given primary channel.

Parameters
primaryChannelWidththe width of the primary channel
Returns
the index of the segment that contains the primary channel

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

References GetPrimaryChannelIndex(), GetTotalWidth(), and m_channelIts.

Referenced by GetPrimaryChannelCenterFrequency().

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

◆ GetSecondaryChannelCenterFrequency()

MHz_u ns3::WifiPhyOperatingChannel::GetSecondaryChannelCenterFrequency ( MHz_u secondaryChannelWidth) const

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

Parameters
secondaryChannelWidththe width of the secondary channel
Returns
the center frequency of the secondary channel of the given width

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

References GetFrequency(), GetSecondaryChannelIndex(), GetSecondarySegmentIndex(), and GetWidth().

Referenced by WifiPhyChannel80Plus80Test::DoRun(), ns3::HtPhy::GetCcaIndication(), and ns3::VhtPhy::GetCcaIndication().

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

◆ GetSecondaryChannelIndex()

uint8_t ns3::WifiPhyOperatingChannel::GetSecondaryChannelIndex ( MHz_u secondaryChannelWidth) const

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

Otherwise, return 0.

Parameters
secondaryChannelWidththe width of the secondary channel
Returns
the index of the requested secondary channel within the operating channel

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

References GetPrimaryChannelIndex().

Referenced by WifiPhyChannel80Plus80Test::DoRun(), ns3::PhyEntity::GetSecondaryBand(), GetSecondaryChannelCenterFrequency(), and GetSecondarySegmentIndex().

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

◆ GetSecondarySegmentIndex()

uint8_t ns3::WifiPhyOperatingChannel::GetSecondarySegmentIndex ( MHz_u secondaryChannelWidth) const

Get the index of the segment that contains a given secondary channel.

Parameters
secondaryChannelWidththe width of the secondary channel
Returns
the index of the segment that contains the secondary channel

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

References GetSecondaryChannelIndex(), GetTotalWidth(), GetWidth(), m_channelIts, and NS_ABORT_MSG_IF.

Referenced by GetSecondaryChannelCenterFrequency().

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

◆ GetTotalWidth()

MHz_u ns3::WifiPhyOperatingChannel::GetTotalWidth ( ) const

Return the width of the whole operating channel.

Returns
the width of the whole operating channel

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

References IsSet(), m_channelIts, and NS_ASSERT.

Referenced by Get20MHzIndicesCoveringRu(), GetAll20MHzChannelIndicesInPrimary(), GetAll20MHzChannelIndicesInSecondary(), ns3::WifiPhy::GetChannelWidth(), GetPrimaryChannel(), GetPrimaryChannelIndex(), GetPrimarySegmentIndex(), GetSecondarySegmentIndex(), GetWidthType(), and SetPrimary20Index().

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

◆ GetWidth()

MHz_u ns3::WifiPhyOperatingChannel::GetWidth ( std::size_t segment = 0) const

Return the channel width for a given frequency segment.

Segments are ordered by increasing frequencies, hence by default it returns the channel width of the segment occuping the lowest frequencies when a non-contiguous operating channel is used.

Parameters
segmentthe index of the frequency segment (if operating channel is non-contiguous)
Returns
the channel width for a given frequency segment

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

References IsSet(), m_channelIts, and NS_ASSERT.

Referenced by GetPrimaryChannelCenterFrequency(), GetPrimaryChannelNumber(), GetSecondaryChannelCenterFrequency(), GetSecondarySegmentIndex(), SetWifiOperatingChannelTest::RunOne(), and Wifi20MHzIndicesCoveringRuTest::RunOne().

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

◆ GetWidths()

std::vector< MHz_u > ns3::WifiPhyOperatingChannel::GetWidths ( ) const

Return the channel width per segment.

Segments are ordered by increasing frequencies.

Returns
the channel width per segment

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

References IsSet(), m_channelIts, and NS_ASSERT.

Referenced by ns3::SpectrumWifiPhy::DoChannelSwitch(), and ns3::SpectrumWifiPhy::FinalizeChannelSwitch().

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

◆ GetWidthType()

WifiChannelWidthType ns3::WifiPhyOperatingChannel::GetWidthType ( ) const

Return the width type of the operating channel.

Returns
the width type of the operating channel

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

References ns3::CW_10MHZ, ns3::CW_160MHZ, ns3::CW_20MHZ, ns3::CW_2160MHZ, ns3::CW_22MHZ, ns3::CW_40MHZ, ns3::CW_5MHZ, ns3::CW_80_PLUS_80MHZ, ns3::CW_80MHZ, GetTotalWidth(), IsSet(), m_channelIts, NS_ASSERT, and ns3::UNKNOWN.

Referenced by SetWifiOperatingChannelTest::RunOne().

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

◆ Is80211p()

bool ns3::WifiPhyOperatingChannel::Is80211p ( ) const

Return whether the operating channel is an 802.11p channel.

Returns
whether the operating channel is an 802.11p channel

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

References ns3::CH_80211P, IsSet(), m_channelIts, and NS_ASSERT.

+ Here is the call graph for this function:

◆ IsDsss()

bool ns3::WifiPhyOperatingChannel::IsDsss ( ) const

Return whether the operating channel is a DSSS channel.

Returns
whether the operating channel is a DSSS channel

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

References ns3::DSSS, IsSet(), m_channelIts, and NS_ASSERT.

+ Here is the call graph for this function:

◆ IsOfdm()

bool ns3::WifiPhyOperatingChannel::IsOfdm ( ) const

Return whether the operating channel is an OFDM channel.

Returns
whether the operating channel is an OFDM channel

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

References IsSet(), m_channelIts, NS_ASSERT, and ns3::OFDM.

Referenced by ns3::ChannelAccessManager::DoGrantDcfAccess(), and ns3::ChannelAccessManager::ResizeLastBusyStructs().

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

◆ IsSet()

bool ns3::WifiPhyOperatingChannel::IsSet ( ) 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 302 of file wifi-phy-operating-channel.cc.

References m_channelIts.

Referenced by ns3::WifiPhy::ConfigureStandard(), ns3::SpectrumWifiPhy::DoChannelSwitch(), GetFrequencies(), GetFrequency(), GetNumber(), GetNumbers(), GetPhyBand(), GetPrimaryChannel(), GetPrimaryChannelNumber(), GetTotalWidth(), ns3::HtPpdu::GetTxDuration(), ns3::OfdmPpdu::GetTxDuration(), GetWidth(), GetWidths(), GetWidthType(), Is80211p(), IsDsss(), IsOfdm(), ns3::HePpdu::SetLSigHeader(), and ns3::HtPpdu::SetLSigHeader().

+ Here is the caller graph for this function:

◆ operator!=()

bool ns3::WifiPhyOperatingChannel::operator!= ( const WifiPhyOperatingChannel & other) const

Check if the given WifiPhyOperatingChannel is different.

Parameters
otheranother WifiPhyOperatingChannel
Returns
true if the given WifiPhyOperatingChannel is different, false otherwise

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

◆ operator==()

bool ns3::WifiPhyOperatingChannel::operator== ( const WifiPhyOperatingChannel & other) const

Check if the given WifiPhyOperatingChannel is equivalent.

Note that the primary20 channels are not compared.

Parameters
otheranother WifiPhyOperatingChannel
Returns
true if the given WifiPhyOperatingChannel is equivalent, false otherwise

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

References m_channelIts.

◆ Set()

void ns3::WifiPhyOperatingChannel::Set ( const std::vector< FrequencyChannelInfo > & segments,
WifiStandard standard )

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
segmentsthe frequency segments
standardthe standard

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

References FindFirst(), m_channelIts, m_frequencyChannels, m_primary20Index, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Referenced by WifiPhyChannel80Plus80Test::DoRun(), SetWifiOperatingChannelTest::RunOne(), and SetDefault().

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

◆ SetDefault()

void ns3::WifiPhyOperatingChannel::SetDefault ( MHz_u width,
WifiStandard standard,
WifiPhyBand band )

Set the default channel of the given width and for the given 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
standardthe standard
bandthe PHY band

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

References GetDefaultChannelNumber(), NS_LOG_FUNCTION, and Set().

Referenced by Wifi20MHzChannelIndicesTest::DoRun(), and Wifi20MHzIndicesCoveringRuTest::DoRun().

+ 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 among all segments).

Parameters
indexthe index of the primary 20 MHz channel

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

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

Referenced by WifiPhyChannel80Plus80Test::DoRun(), GetPrimaryChannel(), Wifi20MHzChannelIndicesTest::RunOne(), and Wifi20MHzIndicesCoveringRuTest::RunOne().

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

Member Data Documentation

◆ m_channelIts

ConstIteratorSet ns3::WifiPhyOperatingChannel::m_channelIts
private

◆ m_frequencyChannels

◆ 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 419 of file wifi-phy-operating-channel.h.

Referenced by Get20MHzIndicesCoveringRu(), GetAll20MHzChannelIndicesInPrimary(), GetPrimaryChannel(), GetPrimaryChannelIndex(), Set(), and SetPrimary20Index().


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