10#ifndef WIFI_PHY_OPERATING_CHANNEL_H
11#define WIFI_PHY_OPERATING_CHANNEL_H
54std::ostream&
operator<<(std::ostream& os,
const FrequencyChannelInfo& info);
128 static const std::set<FrequencyChannelInfo>
147 void Set(
const std::vector<FrequencyChannelInfo>& segments,
WifiStandard standard);
175 std::optional<uint8_t> previousChannelNumber = std::nullopt);
186 uint8_t
GetNumber(std::size_t segment = 0)
const;
343 const std::set<uint8_t>& primaryIndices)
const;
Class that keeps track of all information about the current PHY operating channel.
MHz_u GetTotalWidth() const
Return the width of the whole operating channel.
bool IsSet() const
Return true if a valid channel has been set, false otherwise.
std::set< ConstIterator, Compare > ConstIteratorSet
Typedef for a set of const iterator pointing to the segments of a channel.
uint8_t GetNumber(std::size_t segment=0) const
Return the channel number for a given frequency segment.
bool operator==(const WifiPhyOperatingChannel &other) const
Check if the given WifiPhyOperatingChannel is equivalent.
WifiPhyOperatingChannel()
Create an uninitialized PHY operating channel.
WifiChannelWidthType GetWidthType() const
Return the width type of the operating channel.
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.
MHz_u GetSecondaryChannelCenterFrequency(MHz_u secondaryChannelWidth) const
Get the center frequency of the secondary channel of the given width.
static const std::set< FrequencyChannelInfo > m_frequencyChannels
Available frequency channels.
std::set< FrequencyChannelInfo >::const_iterator ConstIterator
Typedef for a const iterator pointing to a channel in the set of available channels.
bool operator!=(const WifiPhyOperatingChannel &other) const
Check if the given WifiPhyOperatingChannel is different.
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 wid...
bool IsDsss() const
Return whether the operating channel is a DSSS channel.
void SetPrimary20Index(uint8_t index)
Set the index of the primary 20 MHz channel (0 indicates the 20 MHz subchannel with the lowest center...
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 ...
uint8_t GetSecondarySegmentIndex(MHz_u secondaryChannelWidth) const
Get the index of the segment that contains a given secondary channel.
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...
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 cha...
std::size_t GetNSegments() const
Get the number of frequency segments in the operating channel.
void Set(const std::vector< FrequencyChannelInfo > &segments, WifiStandard standard)
Set the channel according to the specified parameters if a unique frequency channel matches the speci...
void SetDefault(MHz_u width, WifiStandard standard, WifiPhyBand band)
Set the default channel of the given width and for the given standard and band.
ConstIteratorSet m_channelIts
const iterators pointing to the configured frequency channel
MHz_u GetWidth(std::size_t segment=0) const
Return the channel width for a given frequency segment.
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 th...
bool Is80211p() const
Return whether the operating channel is an 802.11p channel.
MHz_u GetPrimaryChannelCenterFrequency(MHz_u primaryChannelWidth) const
Get the center frequency of the primary channel of the given width.
std::vector< uint8_t > GetNumbers() const
Return the channel number per segment.
std::vector< MHz_u > GetFrequencies() const
Return the center frequency per segment.
bool IsOfdm() const
Return whether the operating channel is an OFDM channel.
MHz_u GetFrequency(std::size_t segment=0) const
Return the center frequency for a given frequency segment.
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.
uint8_t m_primary20Index
index of the primary20 channel (0 indicates the 20 MHz subchannel with the lowest center frequency)
std::vector< MHz_u > GetWidths() const
Return the channel width per segment.
uint8_t GetPrimarySegmentIndex(MHz_u primaryChannelWidth) const
Get the index of the segment that contains a given primary channel.
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.
virtual ~WifiPhyOperatingChannel()
uint8_t GetPrimaryChannelNumber(MHz_u primaryChannelWidth, WifiStandard standard) const
Get channel number of the primary channel.
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
FrequencyChannelType
Enumeration of frequency channel types.
WifiPhyBand
Identifies the PHY band.
WifiChannelWidthType
Enumeration of the possible channel widths.
@ WIFI_PHY_BAND_UNSPECIFIED
Unspecified.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
A structure containing the information about a frequency channel.
WifiPhyBand band
the PHY band
uint8_t number
the channel number
auto operator<=>(const FrequencyChannelInfo &info) const =default
spaceship operator.
MHz_u width
the channel width
MHz_u frequency
the center frequency
FrequencyChannelType type
the frequency channel type
Comparison functor used to sort the segments by increasing frequencies.
bool operator()(const ConstIterator &a, const ConstIterator &b) const
Functional operator for sorting the frequency segments.
Declaration of the following enums: