A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
vht-configuration.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 Sébastien Deronne
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Sébastien Deronne <sebastien.deronne@gmail.com>
7
*/
8
9
#include "
vht-configuration.h
"
10
11
#include "ns3/boolean.h"
12
#include "ns3/double.h"
13
#include "ns3/log.h"
14
#include "ns3/string.h"
15
#include "ns3/tuple.h"
16
17
namespace
ns3
18
{
19
20
NS_LOG_COMPONENT_DEFINE
(
"VhtConfiguration"
);
21
22
NS_OBJECT_ENSURE_REGISTERED
(
VhtConfiguration
);
23
24
VhtConfiguration::VhtConfiguration
()
25
{
26
NS_LOG_FUNCTION
(
this
);
27
}
28
29
VhtConfiguration::~VhtConfiguration
()
30
{
31
NS_LOG_FUNCTION
(
this
);
32
}
33
34
TypeId
35
VhtConfiguration::GetTypeId
()
36
{
37
static
ns3::TypeId
tid =
38
ns3::TypeId
(
"ns3::VhtConfiguration"
)
39
.
SetParent
<
Object
>()
40
.SetGroupName(
"Wifi"
)
41
.AddConstructor<
VhtConfiguration
>()
42
// NS_DEPRECATED_3_45
43
.AddAttribute(
"Support160MHzOperation"
,
44
"Whether or not 160 MHz operation is to be supported."
,
45
BooleanValue
(
true
),
46
MakeBooleanAccessor
(&
VhtConfiguration::m_160MHzSupported
),
47
MakeBooleanChecker
(),
48
TypeId::SupportLevel::OBSOLETE
,
49
"Set an initial channel via WifiPhy::ChannelSettings whose width "
50
"corresponds to the maximum desired width instead"
)
51
.AddAttribute(
"SecondaryCcaSensitivityThresholds"
,
52
"Tuple {threshold for 20MHz PPDUs, threshold for 40MHz PPDUs, threshold "
53
"for 80MHz PPDUs} "
54
"describing the CCA sensitivity thresholds for PPDUs that do not occupy "
55
"the primary channel. "
56
"The power of a received PPDU that does not occupy the primary channel "
57
"should be higher than "
58
"the threshold (dBm) associated to the PPDU bandwidth to allow the PHY "
59
"layer to declare CCA BUSY state."
,
60
StringValue
(
"{-72.0, -72.0, -69.0}"
),
61
MakeTupleAccessor<DoubleValue, DoubleValue, DoubleValue>
(
62
&
VhtConfiguration::SetSecondaryCcaSensitivityThresholds
,
63
&
VhtConfiguration::GetSecondaryCcaSensitivityThresholds
),
64
MakeTupleChecker<DoubleValue, DoubleValue, DoubleValue>
(
65
MakeDoubleChecker<dBm_u>
(),
66
MakeDoubleChecker<dBm_u>
(),
67
MakeDoubleChecker<dBm_u>
()));
68
return
tid;
69
}
70
71
void
72
VhtConfiguration::Set160MHzOperationSupported
(
bool
enable)
73
{
74
NS_LOG_FUNCTION
(
this
<< enable);
75
m_160MHzSupported
= enable;
76
}
77
78
bool
79
VhtConfiguration::Get160MHzOperationSupported
()
const
80
{
81
return
m_160MHzSupported
;
82
}
83
84
void
85
VhtConfiguration::SetSecondaryCcaSensitivityThresholds
(
86
const
SecondaryCcaSensitivityThresholds
& thresholds)
87
{
88
NS_LOG_FUNCTION
(
this
);
89
m_secondaryCcaSensitivityThresholds
[
MHz_u
{20}] = std::get<0>(thresholds);
90
m_secondaryCcaSensitivityThresholds
[
MHz_u
{40}] = std::get<1>(thresholds);
91
m_secondaryCcaSensitivityThresholds
[
MHz_u
{80}] = std::get<2>(thresholds);
92
}
93
94
VhtConfiguration::SecondaryCcaSensitivityThresholds
95
VhtConfiguration::GetSecondaryCcaSensitivityThresholds
()
const
96
{
97
return
{
m_secondaryCcaSensitivityThresholds
.at(
MHz_u
{20}),
98
m_secondaryCcaSensitivityThresholds
.at(
MHz_u
{40}),
99
m_secondaryCcaSensitivityThresholds
.at(
MHz_u
{80})};
100
}
101
102
const
std::map<MHz_u, dBm_u>&
103
VhtConfiguration::GetSecondaryCcaSensitivityThresholdsPerBw
()
const
104
{
105
return
m_secondaryCcaSensitivityThresholds
;
106
}
107
108
}
// namespace ns3
ns3::BooleanValue
Definition
boolean.h:26
ns3::Object::Object
Object()
Constructor.
Definition
object.cc:96
ns3::StringValue
Hold variables of type string.
Definition
string.h:45
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:49
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition
type-id.cc:1001
ns3::TypeId::SupportLevel::OBSOLETE
@ OBSOLETE
Attribute or trace source is not used anymore; simulation fails.
Definition
type-id.h:66
ns3::VhtConfiguration
VHT configuration.
Definition
vht-configuration.h:31
ns3::VhtConfiguration::Set160MHzOperationSupported
void Set160MHzOperationSupported(bool enable)
Enable or disable 160 MHz operation support.
Definition
vht-configuration.cc:72
ns3::VhtConfiguration::SecondaryCcaSensitivityThresholds
std::tuple< dBm_u, dBm_u, dBm_u > SecondaryCcaSensitivityThresholds
Tuple identifying CCA sensitivity thresholds for secondary channels.
Definition
vht-configuration.h:58
ns3::VhtConfiguration::SetSecondaryCcaSensitivityThresholds
void SetSecondaryCcaSensitivityThresholds(const SecondaryCcaSensitivityThresholds &thresholds)
Sets the CCA sensitivity thresholds for PPDUs that do not occupy the primary channel.
Definition
vht-configuration.cc:85
ns3::VhtConfiguration::GetSecondaryCcaSensitivityThresholdsPerBw
const std::map< MHz_u, dBm_u > & GetSecondaryCcaSensitivityThresholdsPerBw() const
Definition
vht-configuration.cc:103
ns3::VhtConfiguration::Get160MHzOperationSupported
bool Get160MHzOperationSupported() const
Definition
vht-configuration.cc:79
ns3::VhtConfiguration::VhtConfiguration
VhtConfiguration()
Definition
vht-configuration.cc:24
ns3::VhtConfiguration::m_160MHzSupported
bool m_160MHzSupported
whether 160 MHz operation is supported
Definition
vht-configuration.h:81
ns3::VhtConfiguration::~VhtConfiguration
~VhtConfiguration() override
Definition
vht-configuration.cc:29
ns3::VhtConfiguration::GetSecondaryCcaSensitivityThresholds
SecondaryCcaSensitivityThresholds GetSecondaryCcaSensitivityThresholds() const
Definition
vht-configuration.cc:95
ns3::VhtConfiguration::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
vht-configuration.cc:35
ns3::VhtConfiguration::m_secondaryCcaSensitivityThresholds
std::map< MHz_u, dBm_u > m_secondaryCcaSensitivityThresholds
CCA sensitivity thresholds for signals that do not occupy the primary channel, indexed by signal band...
Definition
vht-configuration.h:85
ns3::MakeTupleChecker
Ptr< const AttributeChecker > MakeTupleChecker(Ts... checkers)
Create a TupleChecker from AttributeCheckers associated with TupleValue elements.
Definition
tuple.h:532
ns3::MakeTupleAccessor
Ptr< const AttributeAccessor > MakeTupleAccessor(T1 a1)
Create an AttributeAccessor for a class data member of type tuple, or a lone class get functor or set...
Definition
tuple.h:539
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:191
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition
log-macros-enabled.h:229
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition
object-base.h:35
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::MakeBooleanChecker
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition
boolean.cc:113
ns3::MakeDoubleChecker
Ptr< const AttributeChecker > MakeDoubleChecker()
Definition
double.h:82
ns3::MHz_u
double MHz_u
MHz weak type.
Definition
wifi-units.h:31
ns3::MakeBooleanAccessor
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Definition
boolean.h:70
vht-configuration.h
src
wifi
model
vht
vht-configuration.cc
Generated on Wed Jun 11 2025 13:15:40 for ns-3 by
1.13.2