A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
channel-manager.h
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or modify
3
* it under the terms of the GNU General Public License version 2 as
4
* published by the Free Software Foundation;
5
*
6
* This program is distributed in the hope that it will be useful,
7
* but WITHOUT ANY WARRANTY; without even the implied warranty of
8
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
* GNU General Public License for more details.
10
*
11
* You should have received a copy of the GNU General Public License
12
* along with this program; if not, write to the Free Software
13
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14
*
15
* Author: Junling Bu <linlinjavaer@gmail.com>
16
*/
17
#ifndef CHANNEL_MANAGER_H
18
#define CHANNEL_MANAGER_H
19
#include "ns3/object.h"
20
#include "ns3/wifi-mode.h"
21
#include "ns3/wifi-phy-common.h"
22
23
#include <map>
24
#include <vector>
25
26
namespace
ns3
27
{
28
42
#define CH172 172
43
#define CH174 174
44
#define CH176 176
45
#define CH178 178
46
#define CH180 180
47
#define CH182 182
48
#define CH184 184
49
50
#define SCH1 172
51
#define SCH2 174
52
#define SCH3 176
53
#define CCH 178
54
#define SCH4 180
55
#define SCH5 182
56
#define SCH6 184
57
63
class
ChannelManager
:
public
Object
64
{
65
public
:
70
static
TypeId
GetTypeId
();
71
ChannelManager
();
72
~ChannelManager
()
override
;
73
77
static
uint32_t
GetCch
();
81
static
std::vector<uint32_t>
GetSchs
();
87
static
std::vector<uint32_t>
GetWaveChannels
();
91
static
uint32_t
GetNumberOfWaveChannels
();
96
static
bool
IsCch
(uint32_t channelNumber);
101
static
bool
IsSch
(uint32_t channelNumber);
106
static
bool
IsWaveChannel
(uint32_t channelNumber);
107
114
uint32_t
GetOperatingClass
(uint32_t channelNumber);
119
bool
GetManagementAdaptable
(uint32_t channelNumber);
124
WifiMode
GetManagementDataRate
(uint32_t channelNumber);
129
WifiPreamble
GetManagementPreamble
(uint32_t channelNumber);
134
uint32_t
GetManagementPowerLevel
(uint32_t channelNumber);
135
136
protected
:
137
void
DoDispose
()
override
;
138
139
private
:
141
static
const
uint32_t
DEFAULT_OPERATING_CLASS
= 17;
142
144
struct
WaveChannel
145
{
146
uint32_t
channelNumber
;
147
uint32_t
operatingClass
;
148
bool
adaptable
;
149
WifiMode
dataRate
;
150
WifiPreamble
preamble
;
151
uint32_t
txPowerLevel
;
152
157
WaveChannel
(uint32_t
channel
)
158
:
channelNumber
(
channel
),
159
operatingClass
(
DEFAULT_OPERATING_CLASS
),
160
adaptable
(true),
161
dataRate
(
WifiMode
(
"OfdmRate6MbpsBW10MHz"
)),
162
preamble
(
WIFI_PREAMBLE_LONG
),
163
txPowerLevel
(4)
164
{
165
}
166
};
167
168
std::map<uint32_t, WaveChannel*>
m_channels
;
169
};
170
171
}
// namespace ns3
172
#endif
/* CHANNEL_MANAGER_H */
ns3::ChannelManager
manage 7 WaveChannels and the tx information such as data rate and txPowerLevel.
Definition:
channel-manager.h:64
ns3::ChannelManager::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
channel-manager.cc:30
ns3::ChannelManager::GetSchs
static std::vector< uint32_t > GetSchs()
Definition:
channel-manager.cc:64
ns3::ChannelManager::ChannelManager
ChannelManager()
Definition:
channel-manager.cc:39
ns3::ChannelManager::IsCch
static bool IsCch(uint32_t channelNumber)
Definition:
channel-manager.cc:101
ns3::ChannelManager::GetWaveChannels
static std::vector< uint32_t > GetWaveChannels()
Definition:
channel-manager.cc:78
ns3::ChannelManager::GetManagementAdaptable
bool GetManagementAdaptable(uint32_t channelNumber)
Definition:
channel-manager.cc:145
ns3::ChannelManager::GetNumberOfWaveChannels
static uint32_t GetNumberOfWaveChannels()
Definition:
channel-manager.cc:93
ns3::ChannelManager::DoDispose
void DoDispose() override
Destructor implementation.
Definition:
channel-manager.cc:173
ns3::ChannelManager::GetManagementPreamble
WifiPreamble GetManagementPreamble(uint32_t channelNumber)
Definition:
channel-manager.cc:159
ns3::ChannelManager::DEFAULT_OPERATING_CLASS
static const uint32_t DEFAULT_OPERATING_CLASS
1609.4-2010 Annex H
Definition:
channel-manager.h:141
ns3::ChannelManager::GetCch
static uint32_t GetCch()
Definition:
channel-manager.cc:57
ns3::ChannelManager::GetManagementPowerLevel
uint32_t GetManagementPowerLevel(uint32_t channelNumber)
Definition:
channel-manager.cc:166
ns3::ChannelManager::GetManagementDataRate
WifiMode GetManagementDataRate(uint32_t channelNumber)
Definition:
channel-manager.cc:152
ns3::ChannelManager::IsSch
static bool IsSch(uint32_t channelNumber)
Definition:
channel-manager.cc:108
ns3::ChannelManager::GetOperatingClass
uint32_t GetOperatingClass(uint32_t channelNumber)
Definition:
channel-manager.cc:138
ns3::ChannelManager::m_channels
std::map< uint32_t, WaveChannel * > m_channels
list of channels
Definition:
channel-manager.h:168
ns3::ChannelManager::IsWaveChannel
static bool IsWaveChannel(uint32_t channelNumber)
Definition:
channel-manager.cc:123
ns3::ChannelManager::~ChannelManager
~ChannelManager() override
Definition:
channel-manager.cc:51
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:60
ns3::WifiMode
represent a single transmission mode
Definition:
wifi-mode.h:50
ns3::WifiPreamble
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition:
wifi-phy-common.h:79
ns3::WIFI_PREAMBLE_LONG
@ WIFI_PREAMBLE_LONG
Definition:
wifi-phy-common.h:80
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
third.channel
channel
Definition:
third.py:81
ns3::ChannelManager::WaveChannel
WaveChannel structure.
Definition:
channel-manager.h:145
ns3::ChannelManager::WaveChannel::operatingClass
uint32_t operatingClass
operating class
Definition:
channel-manager.h:147
ns3::ChannelManager::WaveChannel::dataRate
WifiMode dataRate
data rate
Definition:
channel-manager.h:149
ns3::ChannelManager::WaveChannel::channelNumber
uint32_t channelNumber
channel number
Definition:
channel-manager.h:146
ns3::ChannelManager::WaveChannel::preamble
WifiPreamble preamble
preamble
Definition:
channel-manager.h:150
ns3::ChannelManager::WaveChannel::WaveChannel
WaveChannel(uint32_t channel)
initializor
Definition:
channel-manager.h:157
ns3::ChannelManager::WaveChannel::adaptable
bool adaptable
adaptable?
Definition:
channel-manager.h:148
ns3::ChannelManager::WaveChannel::txPowerLevel
uint32_t txPowerLevel
transmit power level
Definition:
channel-manager.h:151
src
wave
model
channel-manager.h
Generated on Fri Mar 31 2023 13:30:52 for ns-3 by
1.9.1