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),
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}"),
64 return tid;
65}
66
67void
69{
70 NS_LOG_FUNCTION(this << enable);
71 m_160MHzSupported = enable;
72}
73
74bool
79
80void
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
97
98const std::map<MHz_u, dBm_u>&
103
104} // namespace ns3
AttributeValue implementation for Boolean.
Definition boolean.h:26
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:49
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 > MakeBooleanChecker()
Definition boolean.cc:113
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition boolean.h:70
Ptr< const AttributeChecker > MakeDoubleChecker()
Definition double.h:82
Ptr< const AttributeChecker > MakeTupleChecker(Ts... checkers)
Create a TupleChecker from AttributeCheckers associated with TupleValue elements.
Definition tuple.h:532
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
#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.