Class that keeps track of all information about the current PHY operating channel. More...
#include "wifi-phy-operating-channel.h"
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_u > | GetFrequencies () 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_u > | GetWidths () 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< FrequencyChannelInfo > | m_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) | |
Class that keeps track of all information about the current PHY operating channel.
Definition at line 61 of file wifi-phy-operating-channel.h.
using ns3::WifiPhyOperatingChannel::ConstIterator = std::set<FrequencyChannelInfo>::const_iterator |
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.
using ns3::WifiPhyOperatingChannel::ConstIteratorSet = std::set<ConstIterator, Compare> |
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.
ns3::WifiPhyOperatingChannel::WifiPhyOperatingChannel | ( | ) |
Create an uninitialized PHY operating channel.
Definition at line 277 of file wifi-phy-operating-channel.cc.
ns3::WifiPhyOperatingChannel::WifiPhyOperatingChannel | ( | ConstIterator | it | ) |
Create a PHY operating channel from an iterator pointing to a channel in the set of available channels.
it | the iterator pointing to a channel in the set of available channels |
Definition at line 282 of file wifi-phy-operating-channel.cc.
ns3::WifiPhyOperatingChannel::WifiPhyOperatingChannel | ( | const ConstIteratorSet & | its | ) |
Create a PHY operating channel from iterators pointing to multiple frequency segments in the set of available channels.
its | the 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.
|
virtual |
Definition at line 296 of file wifi-phy-operating-channel.cc.
References NS_LOG_FUNCTION_NOARGS.
|
static |
Find the first frequency segment matching the specified parameters.
number | the channel number (use 0 to leave it unspecified) |
frequency | the channel center frequency in MHz (use 0 to leave it unspecified) |
width | the channel width (use 0 to leave it unspecified) |
standard | the standard (use WIFI_STANDARD_UNSPECIFIED not to check whether a channel is suitable for a specific standard) |
band | the PHY band |
start | an iterator pointing to the channel to start the search with |
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().
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.
ru | the given RU |
width | the 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 |
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().
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.
width | the width of the primary channel |
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().
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.
primaryIndices | the channel indices of all the 20 MHz channels included in the primary channel |
Definition at line 775 of file wifi-phy-operating-channel.cc.
References GetTotalWidth().
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.
width | the width of the secondary channel |
Definition at line 769 of file wifi-phy-operating-channel.cc.
References GetAll20MHzChannelIndicesInPrimary(), and GetAll20MHzChannelIndicesInSecondary().
Referenced by Get20MHzIndicesCoveringRu(), GetAll20MHzChannelIndicesInPrimary(), GetAll20MHzChannelIndicesInSecondary(), and Wifi20MHzChannelIndicesTest::RunOne().
|
static |
Get the default channel number for a given segment of the given width and for the given standard and band.
width | the channel width |
standard | the standard |
band | the PHY band |
previousChannelNumber | the 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 |
Definition at line 391 of file wifi-phy-operating-channel.cc.
References FindFirst(), and m_frequencyChannels.
Referenced by ns3::WifiPhy::DoChannelSwitch(), and SetDefault().
std::vector< MHz_u > ns3::WifiPhyOperatingChannel::GetFrequencies | ( | ) | const |
Return the center frequency per segment.
Segments are ordered by increasing frequencies.
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().
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.
segment | the index of the frequency segment (if operating channel is non-contiguous) |
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().
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.
Definition at line 923 of file wifi-phy-operating-channel.cc.
References m_channelIts.
Referenced by ns3::SpectrumWifiPhy::FinalizeChannelSwitch(), and SetWifiOperatingChannelTest::RunOne().
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.
segment | the index of the frequency segment (if operating channel is non-contiguous) |
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().
std::vector< uint8_t > ns3::WifiPhyOperatingChannel::GetNumbers | ( | ) | const |
Return the channel number per segment.
Segments are ordered by increasing frequencies.
Definition at line 535 of file wifi-phy-operating-channel.cc.
References IsSet(), m_channelIts, and NS_ASSERT.
WifiPhyBand ns3::WifiPhyOperatingChannel::GetPhyBand | ( | ) | const |
Return 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().
WifiPhyOperatingChannel ns3::WifiPhyOperatingChannel::GetPrimaryChannel | ( | MHz_u | primaryChannelWidth | ) | const |
Get a WifiPhyOperatingChannel object corresponding to the primary channel of the given width.
primaryChannelWidth | the width of the primary channel in MHz |
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.
MHz_u ns3::WifiPhyOperatingChannel::GetPrimaryChannelCenterFrequency | ( | MHz_u | primaryChannelWidth | ) | const |
Get the center frequency of the primary channel of the given width.
primaryChannelWidth | the width of the primary channel |
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().
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.
primaryChannelWidth | the width of the primary 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().
uint8_t ns3::WifiPhyOperatingChannel::GetPrimaryChannelNumber | ( | MHz_u | primaryChannelWidth, |
WifiStandard | standard ) const |
Get channel number of the primary channel.
primaryChannelWidth | the width of the primary channel |
standard | the standard |
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().
uint8_t ns3::WifiPhyOperatingChannel::GetPrimarySegmentIndex | ( | MHz_u | primaryChannelWidth | ) | const |
Get the index of the segment that contains a given primary channel.
primaryChannelWidth | the width of the primary channel |
Definition at line 652 of file wifi-phy-operating-channel.cc.
References GetPrimaryChannelIndex(), GetTotalWidth(), and m_channelIts.
Referenced by GetPrimaryChannelCenterFrequency().
MHz_u ns3::WifiPhyOperatingChannel::GetSecondaryChannelCenterFrequency | ( | MHz_u | secondaryChannelWidth | ) | const |
Get the center frequency of the secondary channel of the given width.
secondaryChannelWidth | the width of the secondary channel |
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().
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.
secondaryChannelWidth | the width of the secondary channel |
Definition at line 634 of file wifi-phy-operating-channel.cc.
References GetPrimaryChannelIndex().
Referenced by WifiPhyChannel80Plus80Test::DoRun(), ns3::PhyEntity::GetSecondaryBand(), GetSecondaryChannelCenterFrequency(), and GetSecondarySegmentIndex().
uint8_t ns3::WifiPhyOperatingChannel::GetSecondarySegmentIndex | ( | MHz_u | secondaryChannelWidth | ) | const |
Get the index of the segment that contains a given secondary channel.
secondaryChannelWidth | the width of 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().
MHz_u ns3::WifiPhyOperatingChannel::GetTotalWidth | ( | ) | const |
Return 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().
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.
segment | the index of the frequency segment (if operating channel is non-contiguous) |
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().
std::vector< MHz_u > ns3::WifiPhyOperatingChannel::GetWidths | ( | ) | const |
Return the channel width per segment.
Segments are ordered by increasing frequencies.
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().
WifiChannelWidthType ns3::WifiPhyOperatingChannel::GetWidthType | ( | ) | const |
Return 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().
bool ns3::WifiPhyOperatingChannel::Is80211p | ( | ) | const |
Return 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.
bool ns3::WifiPhyOperatingChannel::IsDsss | ( | ) | const |
Return 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.
bool ns3::WifiPhyOperatingChannel::IsOfdm | ( | ) | const |
Return 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().
bool ns3::WifiPhyOperatingChannel::IsSet | ( | ) | const |
Return 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().
bool ns3::WifiPhyOperatingChannel::operator!= | ( | const WifiPhyOperatingChannel & | other | ) | const |
Check if the given WifiPhyOperatingChannel is different.
other | another WifiPhyOperatingChannel |
Definition at line 935 of file wifi-phy-operating-channel.cc.
bool ns3::WifiPhyOperatingChannel::operator== | ( | const WifiPhyOperatingChannel & | other | ) | const |
Check if the given WifiPhyOperatingChannel is equivalent.
Note that the primary20 channels are not compared.
other | another WifiPhyOperatingChannel |
Definition at line 929 of file wifi-phy-operating-channel.cc.
References m_channelIts.
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.
segments | the frequency segments |
standard | the 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().
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.
width | the channel width |
standard | the standard |
band | the 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().
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).
index | the 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().
|
private |
const iterators pointing to the configured frequency channel
Definition at line 418 of file wifi-phy-operating-channel.h.
Referenced by GetFrequencies(), GetFrequency(), GetNSegments(), GetNumber(), GetNumbers(), GetPhyBand(), GetPrimarySegmentIndex(), GetSecondarySegmentIndex(), GetTotalWidth(), GetWidth(), GetWidths(), GetWidthType(), Is80211p(), IsDsss(), IsOfdm(), IsSet(), operator==(), and Set().
|
static |
Available frequency channels.
Definition at line 129 of file wifi-phy-operating-channel.h.
Referenced by ReducedNeighborReportTest::DoRun(), FindFirst(), GetDefaultChannelNumber(), ns3::ReducedNeighborReport::GetOperatingChannel(), GetPrimaryChannel(), GetPrimaryChannelNumber(), ReducedNeighborReportTest::GetReducedNeighborReport(), and Set().
|
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().