A Discrete-Event Network Simulator
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
17namespace ns3
18{
19
20NS_LOG_COMPONENT_DEFINE("VhtConfiguration");
21
22NS_OBJECT_ENSURE_REGISTERED(VhtConfiguration);
23
28
33
36{
37 static ns3::TypeId tid =
38 ns3::TypeId("ns3::VhtConfiguration")
40 .SetGroupName("Wifi")
41 .AddConstructor<VhtConfiguration>()
42 .AddAttribute("Support160MHzOperation",
43 "Whether or not 160 MHz operation is to be supported.",
44 BooleanValue(true),
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}"),
65 return tid;
66}
67
68void
70{
71 NS_LOG_FUNCTION(this << enable);
72 m_160MHzSupported = enable;
73}
74
75bool
80
81void
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
98
99const std::map<MHz_u, dBm_u>&
104
105} // namespace ns3
A base class which provides memory management and object aggregation.
Definition object.h:78
Hold variables of type string.
Definition string.h:45
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
VHT configuration.
void Set160MHzOperationSupported(bool enable)
Enable or disable 160 MHz operation support.
std::tuple< dBm_u, dBm_u, dBm_u > SecondaryCcaSensitivityThresholds
Tuple identifying CCA sensitivity thresholds for secondary channels.
void SetSecondaryCcaSensitivityThresholds(const SecondaryCcaSensitivityThresholds &thresholds)
Sets the CCA sensitivity thresholds for PPDUs that do not occupy the primary channel.
const std::map< MHz_u, dBm_u > & GetSecondaryCcaSensitivityThresholdsPerBw() const
bool Get160MHzOperationSupported() const
bool m_160MHzSupported
whether 160 MHz operation is supported
SecondaryCcaSensitivityThresholds GetSecondaryCcaSensitivityThresholds() const
static TypeId GetTypeId()
Get the type ID.
std::map< MHz_u, dBm_u > m_secondaryCcaSensitivityThresholds
CCA sensitivity thresholds for signals that do not occupy the primary channel, indexed by signal band...
Ptr< const AttributeChecker > MakeTupleChecker(Ts... checkers)
Create a TupleChecker from AttributeCheckers associated with TupleValue elements.
Definition tuple.h:529
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
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition boolean.cc:113
Ptr< const AttributeChecker > MakeDoubleChecker()
Definition double.h:82
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Definition boolean.h:70