A Discrete-Event Network Simulator
API
wifi-phy-operating-channel.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2021
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Stefano Avallone <stavallo@unina.it>
19  * Sébastien Deronne <sebastien.deronne@gmail.com>
20  */
21 
22 #ifndef WIFI_PHY_OPERATING_CHANNEL_H
23 #define WIFI_PHY_OPERATING_CHANNEL_H
24 
25 #include "wifi-phy-band.h"
26 #include "wifi-standards.h"
27 #include <tuple>
28 #include <set>
29 
30 namespace ns3 {
31 
35 typedef std::tuple<uint8_t, uint16_t, uint16_t, FrequencyChannelType, WifiPhyBand> FrequencyChannelInfo;
36 
37 
44 {
45 public:
50 
51  virtual ~WifiPhyOperatingChannel ();
52 
58  bool IsSet (void) const;
72  void Set (uint8_t number, uint16_t frequency, uint16_t width,
73  WifiPhyStandard standard, WifiPhyBand band);
83  void SetDefault (uint16_t width, WifiPhyStandard standard, WifiPhyBand band);
84 
90  uint8_t GetNumber (void) const;
96  uint16_t GetFrequency (void) const;
102  uint16_t GetWidth (void) const;
103 
112  uint8_t GetPrimaryChannelIndex (uint16_t primaryChannelWidth) const;
119  void SetPrimary20Index (uint8_t index);
126  uint16_t GetPrimaryChannelCenterFrequency (uint16_t primaryChannelWidth) const;
127 
128 private:
130  typedef std::set<FrequencyChannelInfo>::const_iterator ConstIterator;
131 
144  ConstIterator FindFirst (uint8_t number, uint16_t frequency, uint16_t width,
145  WifiPhyStandard standard, WifiPhyBand band,
146  ConstIterator start) const;
147 
151 };
152 
153 } //namespace ns3
154 
155 #endif /* WIFI_PHY_OPERATING_CHANNEL_H */
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiPhyOperatingChannel::~WifiPhyOperatingChannel
virtual ~WifiPhyOperatingChannel()
Definition: wifi-phy-operating-channel.cc:37
ns3::WifiPhyOperatingChannel::m_primary20Index
uint8_t m_primary20Index
index of the primary20 channel (0 indicates the 20 MHz subchannel with the lowest center frequency)
Definition: wifi-phy-operating-channel.h:149
ns3::WifiPhyOperatingChannel::IsSet
bool IsSet(void) const
Return true if a valid channel has been set, false otherwise.
Definition: wifi-phy-operating-channel.cc:43
wifi-phy-band.h
ns3::WifiPhyStandard
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
Definition: wifi-standards.h:35
ns3::WifiPhyOperatingChannel::GetWidth
uint16_t GetWidth(void) const
Return the width of the whole operating channel (in MHz).
Definition: wifi-phy-operating-channel.cc:144
wifi-standards.h
visualizer.core.start
def start()
Definition: core.py:1855
ns3::WifiPhyOperatingChannel
Class that keeps track of all information about the current PHY operating channel.
Definition: wifi-phy-operating-channel.h:44
ns3::WifiPhyOperatingChannel::WifiPhyOperatingChannel
WifiPhyOperatingChannel()
Create an uninitialized PHY operating channel.
Definition: wifi-phy-operating-channel.cc:30
ns3::FrequencyChannelInfo
std::tuple< uint8_t, uint16_t, uint16_t, FrequencyChannelType, WifiPhyBand > FrequencyChannelInfo
A tuple (number, frequency, width, type, band) identifying a frequency channel.
Definition: wifi-phy-operating-channel.h:35
ns3::WifiPhyOperatingChannel::SetPrimary20Index
void SetPrimary20Index(uint8_t index)
Set the index of the primary 20 MHz channel (0 indicates the 20 MHz subchannel with the lowest center...
Definition: wifi-phy-operating-channel.cc:178
ns3::WifiPhyOperatingChannel::m_channelIt
ConstIterator m_channelIt
const iterator pointing to the configured frequency channel
Definition: wifi-phy-operating-channel.h:148
ns3::WifiPhyOperatingChannel::ConstIterator
std::set< FrequencyChannelInfo >::const_iterator ConstIterator
Typedef for a const iterator pointing to a channel in the set of available channels.
Definition: wifi-phy-operating-channel.h:130
ns3::WifiPhyOperatingChannel::GetPrimaryChannelIndex
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 th...
Definition: wifi-phy-operating-channel.cc:151
ns3::WifiPhyOperatingChannel::Set
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 speci...
Definition: wifi-phy-operating-channel.cc:49
ns3::WifiPhyBand
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:33
ns3::WifiPhyOperatingChannel::GetFrequency
uint16_t GetFrequency(void) const
Return the center frequency of the operating channel (in MHz).
Definition: wifi-phy-operating-channel.cc:137
ns3::WifiPhyOperatingChannel::SetDefault
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.
Definition: wifi-phy-operating-channel.cc:71
ns3::WifiPhyOperatingChannel::FindFirst
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.
Definition: wifi-phy-operating-channel.cc:90
ns3::WifiPhyOperatingChannel::GetPrimaryChannelCenterFrequency
uint16_t GetPrimaryChannelCenterFrequency(uint16_t primaryChannelWidth) const
Get the center frequency of the primary channel of the given width.
Definition: wifi-phy-operating-channel.cc:187
ns3::WifiPhyOperatingChannel::GetNumber
uint8_t GetNumber(void) const
Return the channel number identifying the whole operating channel.
Definition: wifi-phy-operating-channel.cc:130