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
.AddAttribute(
"Support160MHzOperation"
,
43
"Whether or not 160 MHz operation is to be supported."
,
44
BooleanValue
(
true
),
45
MakeBooleanAccessor
(&
VhtConfiguration::m_160MHzSupported
),
46
MakeBooleanChecker
())
47
.AddAttribute(
"SecondaryCcaSensitivityThresholds"
,
48
"Tuple {threshold for 20MHz PPDUs, threshold for 40MHz PPDUs, threshold "
49
"for 80MHz PPDUs} "
50
"describing the CCA sensitivity thresholds for PPDUs that do not occupy "
51
"the primary channel. "
52
"The power of a received PPDU that does not occupy the primary channel "
53
"should be higher than "
54
"the threshold (dBm) associated to the PPDU bandwidth to allow the PHY "
55
"layer to declare CCA BUSY state."
,
56
StringValue
(
"{-72.0, -72.0, -69.0}"
),
57
MakeTupleAccessor<DoubleValue, DoubleValue, DoubleValue>
(
58
&
VhtConfiguration::SetSecondaryCcaSensitivityThresholds
,
59
&
VhtConfiguration::GetSecondaryCcaSensitivityThresholds
),
60
MakeTupleChecker<DoubleValue, DoubleValue, DoubleValue>
(
61
MakeDoubleChecker<dBm_u>
(),
62
MakeDoubleChecker<dBm_u>
(),
63
MakeDoubleChecker<dBm_u>
()));
64
return
tid;
65
}
66
67
void
68
VhtConfiguration::Set160MHzOperationSupported
(
bool
enable)
69
{
70
NS_LOG_FUNCTION
(
this
<< enable);
71
m_160MHzSupported
= enable;
72
}
73
74
bool
75
VhtConfiguration::Get160MHzOperationSupported
()
const
76
{
77
return
m_160MHzSupported
;
78
}
79
80
void
81
VhtConfiguration::SetSecondaryCcaSensitivityThresholds
(
82
const
SecondaryCcaSensitivityThresholds
& thresholds)
83
{
84
NS_LOG_FUNCTION
(
this
);
85
m_secondaryCcaSensitivityThresholds
[
MHz_u
{20}] = std::get<0>(thresholds);
86
m_secondaryCcaSensitivityThresholds
[
MHz_u
{40}] = std::get<1>(thresholds);
87
m_secondaryCcaSensitivityThresholds
[
MHz_u
{80}] = std::get<2>(thresholds);
88
}
89
90
VhtConfiguration::SecondaryCcaSensitivityThresholds
91
VhtConfiguration::GetSecondaryCcaSensitivityThresholds
()
const
92
{
93
return
{
m_secondaryCcaSensitivityThresholds
.at(
MHz_u
{20}),
94
m_secondaryCcaSensitivityThresholds
.at(
MHz_u
{40}),
95
m_secondaryCcaSensitivityThresholds
.at(
MHz_u
{80})};
96
}
97
98
const
std::map<MHz_u, dBm_u>&
99
VhtConfiguration::GetSecondaryCcaSensitivityThresholdsPerBw
()
const
100
{
101
return
m_secondaryCcaSensitivityThresholds
;
102
}
103
104
}
// namespace ns3
double
ns3::BooleanValue
Definition
boolean.h:26
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
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::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:68
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:81
ns3::VhtConfiguration::GetSecondaryCcaSensitivityThresholdsPerBw
const std::map< MHz_u, dBm_u > & GetSecondaryCcaSensitivityThresholdsPerBw() const
Definition
vht-configuration.cc:99
ns3::VhtConfiguration::Get160MHzOperationSupported
bool Get160MHzOperationSupported() const
Definition
vht-configuration.cc:75
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:91
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::MakeBooleanAccessor
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Definition
boolean.h:70
vht-configuration.h
src
wifi
model
vht
vht-configuration.cc
Generated on Tue Apr 8 2025 15:27:20 for ns-3 by
1.11.0