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::Get160MHzOperationSupported
,
46
&
VhtConfiguration::Set160MHzOperationSupported
),
47
MakeBooleanChecker
())
48
.AddAttribute(
"SecondaryCcaSensitivityThresholds"
,
49
"Tuple {threshold for 20MHz PPDUs, threshold for 40MHz PPDUs, threshold "
50
"for 80MHz PPDUs} "
51
"describing the CCA sensitivity thresholds for PPDUs that do not occupy "
52
"the primary channel. "
53
"The power of a received PPDU that does not occupy the primary channel "
54
"should be higher than "
55
"the threshold (dBm) associated to the PPDU bandwidth to allow the PHY "
56
"layer to declare CCA BUSY state."
,
57
StringValue
(
"{-72.0, -72.0, -69.0}"
),
58
MakeTupleAccessor<DoubleValue, DoubleValue, DoubleValue>
(
59
&
VhtConfiguration::SetSecondaryCcaSensitivityThresholds
,
60
&
VhtConfiguration::GetSecondaryCcaSensitivityThresholds
),
61
MakeTupleChecker<DoubleValue, DoubleValue, DoubleValue>
(
62
MakeDoubleChecker<dBm_u>
(),
63
MakeDoubleChecker<dBm_u>
(),
64
MakeDoubleChecker<dBm_u>
()));
65
return
tid;
66
}
67
68
void
69
VhtConfiguration::Set160MHzOperationSupported
(
bool
enable)
70
{
71
NS_LOG_FUNCTION
(
this
<< enable);
72
m_160MHzSupported
= enable;
73
}
74
75
bool
76
VhtConfiguration::Get160MHzOperationSupported
()
const
77
{
78
return
m_160MHzSupported
;
79
}
80
81
void
82
VhtConfiguration::SetSecondaryCcaSensitivityThresholds
(
83
const
SecondaryCcaSensitivityThresholds
& thresholds)
84
{
85
NS_LOG_FUNCTION
(
this
);
86
m_secondaryCcaSensitivityThresholds
[20] = std::get<0>(thresholds);
87
m_secondaryCcaSensitivityThresholds
[40] = std::get<1>(thresholds);
88
m_secondaryCcaSensitivityThresholds
[80] = std::get<2>(thresholds);
89
}
90
91
VhtConfiguration::SecondaryCcaSensitivityThresholds
92
VhtConfiguration::GetSecondaryCcaSensitivityThresholds
()
const
93
{
94
return
{
m_secondaryCcaSensitivityThresholds
.at(20),
95
m_secondaryCcaSensitivityThresholds
.at(40),
96
m_secondaryCcaSensitivityThresholds
.at(80)};
97
}
98
99
const
std::map<MHz_u, dBm_u>&
100
VhtConfiguration::GetSecondaryCcaSensitivityThresholdsPerBw
()
const
101
{
102
return
m_secondaryCcaSensitivityThresholds
;
103
}
104
105
}
// namespace ns3
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:48
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition
type-id.cc:1001
ns3::VhtConfiguration
VHT configuration.
Definition
vht-configuration.h:30
ns3::VhtConfiguration::Set160MHzOperationSupported
void Set160MHzOperationSupported(bool enable)
Enable or disable 160 MHz operation support.
Definition
vht-configuration.cc:69
ns3::VhtConfiguration::SecondaryCcaSensitivityThresholds
std::tuple< dBm_u, dBm_u, dBm_u > SecondaryCcaSensitivityThresholds
Tuple identifying CCA sensitivity thresholds for secondary channels.
Definition
vht-configuration.h:54
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:82
ns3::VhtConfiguration::GetSecondaryCcaSensitivityThresholdsPerBw
const std::map< MHz_u, dBm_u > & GetSecondaryCcaSensitivityThresholdsPerBw() const
Definition
vht-configuration.cc:100
ns3::VhtConfiguration::Get160MHzOperationSupported
bool Get160MHzOperationSupported() const
Definition
vht-configuration.cc:76
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:78
ns3::VhtConfiguration::~VhtConfiguration
~VhtConfiguration() override
Definition
vht-configuration.cc:29
ns3::VhtConfiguration::GetSecondaryCcaSensitivityThresholds
SecondaryCcaSensitivityThresholds GetSecondaryCcaSensitivityThresholds() const
Definition
vht-configuration.cc:92
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:80
ns3::MakeTupleChecker
Ptr< const AttributeChecker > MakeTupleChecker(Ts... checkers)
Create a TupleChecker from AttributeCheckers associated with TupleValue elements.
Definition
tuple.h:529
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:536
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 Fri Nov 8 2024 13:59:08 for ns-3 by
1.11.0