A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
wifi-80211p-helper.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2008 INRIA
3
* Copyright (c) 2009 MIRKO BANCHI
4
* Copyright (c) 2013 Dalian University of Technology
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License version 2 as
8
* published by the Free Software Foundation;
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
*
19
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20
* Author: Mirko Banchi <mk.banchi@gmail.com>
21
* Author: Junling Bu <linlinjavaer@gmail.com>
22
*/
23
#include "
wifi-80211p-helper.h
"
24
25
#include "
wave-mac-helper.h
"
26
27
#include "ns3/log.h"
28
#include "ns3/string.h"
29
30
#include <typeinfo>
31
32
namespace
ns3
33
{
34
35
Wifi80211pHelper::Wifi80211pHelper
()
36
{
37
}
38
39
Wifi80211pHelper::~Wifi80211pHelper
()
40
{
41
}
42
43
Wifi80211pHelper
44
Wifi80211pHelper::Default
()
45
{
46
Wifi80211pHelper
helper;
47
helper.
SetStandard
(
WIFI_STANDARD_80211p
);
48
helper.
SetRemoteStationManager
(
"ns3::ConstantRateWifiManager"
,
49
"DataMode"
,
50
StringValue
(
"OfdmRate6MbpsBW10MHz"
),
51
"ControlMode"
,
52
StringValue
(
"OfdmRate6MbpsBW10MHz"
),
53
"NonUnicastMode"
,
54
StringValue
(
"OfdmRate6MbpsBW10MHz"
));
55
return
helper;
56
}
57
58
void
59
Wifi80211pHelper::SetStandard
(
WifiStandard
standard)
60
{
61
if
(standard ==
WIFI_STANDARD_80211p
)
62
{
63
WifiHelper::SetStandard
(standard);
64
}
65
else
66
{
67
NS_FATAL_ERROR
(
"wrong standard selected!"
);
68
}
69
}
70
71
void
72
Wifi80211pHelper::EnableLogComponents
()
73
{
74
WifiHelper::EnableLogComponents
();
75
76
LogComponentEnable
(
"OcbWifiMac"
,
LOG_LEVEL_ALL
);
77
LogComponentEnable
(
"VendorSpecificAction"
,
LOG_LEVEL_ALL
);
78
}
79
80
NetDeviceContainer
81
Wifi80211pHelper::Install
(
const
WifiPhyHelper
& phyHelper,
82
const
WifiMacHelper
& macHelper,
83
NodeContainer
c)
const
84
{
85
const
QosWaveMacHelper
* qosMac [[maybe_unused]] =
86
dynamic_cast<
const
QosWaveMacHelper
*
>
(&macHelper);
87
if
(qosMac ==
nullptr
)
88
{
89
const
NqosWaveMacHelper
* nqosMac [[maybe_unused]] =
90
dynamic_cast<
const
NqosWaveMacHelper
*
>
(&macHelper);
91
if
(nqosMac ==
nullptr
)
92
{
93
NS_FATAL_ERROR
(
"the macHelper should be either QosWaveMacHelper or NqosWaveMacHelper"
94
", or should be the subclass of QosWaveMacHelper or NqosWaveMacHelper"
);
95
}
96
}
97
98
return
WifiHelper::Install
(phyHelper, macHelper, c);
99
}
100
101
}
// namespace ns3
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition:
net-device-container.h:43
ns3::NodeContainer
keep track of a set of node pointers.
Definition:
node-container.h:40
ns3::NqosWaveMacHelper
Nqos Wave Mac Helper class.
Definition:
wave-mac-helper.h:35
ns3::QosWaveMacHelper
Qos Wave Mac Helper class.
Definition:
wave-mac-helper.h:73
ns3::StringValue
Hold variables of type string.
Definition:
string.h:56
ns3::Wifi80211pHelper
helps to create wifi 802.11p objects of WifiNetDevice class
Definition:
wifi-80211p-helper.h:41
ns3::Wifi80211pHelper::SetStandard
void SetStandard(WifiStandard standard) override
Definition:
wifi-80211p-helper.cc:59
ns3::Wifi80211pHelper::Default
static Wifi80211pHelper Default()
Definition:
wifi-80211p-helper.cc:44
ns3::Wifi80211pHelper::Wifi80211pHelper
Wifi80211pHelper()
Definition:
wifi-80211p-helper.cc:35
ns3::Wifi80211pHelper::~Wifi80211pHelper
~Wifi80211pHelper() override
Definition:
wifi-80211p-helper.cc:39
ns3::Wifi80211pHelper::Install
NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &macHelper, NodeContainer c) const override
Definition:
wifi-80211p-helper.cc:81
ns3::Wifi80211pHelper::EnableLogComponents
static void EnableLogComponents()
Helper to enable all WifiNetDevice log components with one statement.
Definition:
wifi-80211p-helper.cc:72
ns3::WifiHelper::SetRemoteStationManager
void SetRemoteStationManager(std::string type, Args &&... args)
Helper function used to set the station manager.
Definition:
wifi-helper.h:605
ns3::WifiHelper::SetStandard
virtual void SetStandard(WifiStandard standard)
Definition:
wifi-helper.cc:738
ns3::WifiHelper::Install
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer::Iterator first, NodeContainer::Iterator last) const
Definition:
wifi-helper.cc:756
ns3::WifiHelper::EnableLogComponents
static void EnableLogComponents()
Helper to enable all WifiNetDevice log components with one statement.
Definition:
wifi-helper.cc:880
ns3::WifiMacHelper
create MAC layers for a ns3::WifiNetDevice.
Definition:
wifi-mac-helper.h:48
ns3::WifiPhyHelper
create PHY objects
Definition:
wifi-helper.h:50
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition:
fatal-error.h:179
ns3::WifiStandard
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
Definition:
wifi-standards.h:38
ns3::WIFI_STANDARD_80211p
@ WIFI_STANDARD_80211p
Definition:
wifi-standards.h:43
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::LogComponentEnable
void LogComponentEnable(const std::string &name, LogLevel level)
Enable the logging output associated with that log component.
Definition:
log.cc:305
ns3::LOG_LEVEL_ALL
@ LOG_LEVEL_ALL
Print everything.
Definition:
log.h:116
wave-mac-helper.h
wifi-80211p-helper.h
src
wave
helper
wifi-80211p-helper.cc
Generated on Fri Mar 31 2023 13:30:52 for ns-3 by
1.9.1