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