A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
spectrum-wifi-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2008 INRIA
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18
*/
19
20
#ifndef SPECTRUM_WIFI_HELPER_H
21
#define SPECTRUM_WIFI_HELPER_H
22
23
#include "
wifi-helper.h
"
24
25
#include <map>
26
#include <set>
27
28
namespace
ns3
29
{
30
31
class
SpectrumChannel;
32
class
SpectrumWifiPhy;
33
44
class
SpectrumWifiPhyHelper
:
public
WifiPhyHelper
45
{
46
public
:
52
SpectrumWifiPhyHelper
(uint8_t nLinks = 1);
53
59
void
SetChannel
(
const
Ptr<SpectrumChannel>
channel
);
65
void
SetChannel
(
const
std::string& channelName);
66
75
void
AddChannel
(
const
Ptr<SpectrumChannel>
channel
,
76
const
FrequencyRange
& freqRange =
WHOLE_WIFI_SPECTRUM
);
85
void
AddChannel
(
const
std::string& channelName,
86
const
FrequencyRange
& freqRange =
WHOLE_WIFI_SPECTRUM
);
87
96
void
AddPhyToFreqRangeMapping
(uint8_t linkId,
const
FrequencyRange
& freqRange);
97
101
void
ResetPhyToFreqRangeMapping
();
102
103
private
:
111
std::vector<Ptr<WifiPhy>>
Create
(
Ptr<Node>
node,
Ptr<WifiNetDevice>
device)
const override
;
112
120
void
InstallPhyInterfaces
(uint8_t linkId,
Ptr<SpectrumWifiPhy>
phy
)
const
;
121
128
void
AddWifiBandwidthFilter
(
Ptr<SpectrumChannel>
channel
);
129
134
static
void
SpectrumChannelSwitched
(
Ptr<SpectrumWifiPhy>
phy
);
135
136
std::map<FrequencyRange, Ptr<SpectrumChannel>>
m_channels
;
137
std::map<uint8_t
/* linkId */
, std::set<FrequencyRange>>
138
m_interfacesMap
;
140
};
141
142
}
// namespace ns3
143
144
#endif
/* SPECTRUM_WIFI_HELPER_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::SpectrumWifiPhyHelper
Make it easy to create and manage PHY objects for the spectrum model.
Definition:
spectrum-wifi-helper.h:45
ns3::SpectrumWifiPhyHelper::Create
std::vector< Ptr< WifiPhy > > Create(Ptr< Node > node, Ptr< WifiNetDevice > device) const override
Definition:
spectrum-wifi-helper.cc:127
ns3::SpectrumWifiPhyHelper::ResetPhyToFreqRangeMapping
void ResetPhyToFreqRangeMapping()
Reset mapping of the spectrum PHY interfaces added to the PHY instances.
Definition:
spectrum-wifi-helper.cc:121
ns3::SpectrumWifiPhyHelper::SpectrumWifiPhyHelper
SpectrumWifiPhyHelper(uint8_t nLinks=1)
Create a PHY helper.
Definition:
spectrum-wifi-helper.cc:42
ns3::SpectrumWifiPhyHelper::m_interfacesMap
std::map< uint8_t, std::set< FrequencyRange > > m_interfacesMap
map of the spectrum PHY interfaces to be added to the PHY instance corresponding to a given link ID
Definition:
spectrum-wifi-helper.h:138
ns3::SpectrumWifiPhyHelper::AddChannel
void AddChannel(const Ptr< SpectrumChannel > channel, const FrequencyRange &freqRange=WHOLE_WIFI_SPECTRUM)
Definition:
spectrum-wifi-helper.cc:67
ns3::SpectrumWifiPhyHelper::InstallPhyInterfaces
void InstallPhyInterfaces(uint8_t linkId, Ptr< SpectrumWifiPhy > phy) const
Install PHY interfaces to the PHY instance of a given link based on the currently configured mapping ...
Definition:
spectrum-wifi-helper.cc:161
ns3::SpectrumWifiPhyHelper::SetChannel
void SetChannel(const Ptr< SpectrumChannel > channel)
Definition:
spectrum-wifi-helper.cc:55
ns3::SpectrumWifiPhyHelper::SpectrumChannelSwitched
static void SpectrumChannelSwitched(Ptr< SpectrumWifiPhy > phy)
Function that is notified when a spectrum channel switched.
Definition:
spectrum-wifi-helper.cc:181
ns3::SpectrumWifiPhyHelper::AddPhyToFreqRangeMapping
void AddPhyToFreqRangeMapping(uint8_t linkId, const FrequencyRange &freqRange)
Add a given spectrum PHY interface to the PHY instance corresponding of a given link.
Definition:
spectrum-wifi-helper.cc:108
ns3::SpectrumWifiPhyHelper::AddWifiBandwidthFilter
void AddWifiBandwidthFilter(Ptr< SpectrumChannel > channel)
Definition:
spectrum-wifi-helper.cc:82
ns3::SpectrumWifiPhyHelper::m_channels
std::map< FrequencyRange, Ptr< SpectrumChannel > > m_channels
the spectrum channels
Definition:
spectrum-wifi-helper.h:136
ns3::WifiPhyHelper
create PHY objects
Definition:
wifi-helper.h:49
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WHOLE_WIFI_SPECTRUM
constexpr FrequencyRange WHOLE_WIFI_SPECTRUM
Identifier for the frequency range covering the whole wifi spectrum.
Definition:
wifi-spectrum-value-helper.h:381
third.channel
channel
Definition:
third.py:88
third.phy
phy
Definition:
third.py:89
ns3::FrequencyRange
Struct defining a frequency range between minFrequency (MHz) and maxFrequency (MHz).
Definition:
wifi-spectrum-value-helper.h:333
wifi-helper.h
src
wifi
helper
spectrum-wifi-helper.h
Generated on Sun Mar 3 2024 17:11:10 for ns-3 by
1.9.1