A Discrete-Event Network Simulator
API
he-configuration.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2018 University of Washington
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  */
19 
20 #include "ns3/log.h"
21 #include "ns3/nstime.h"
22 #include "ns3/uinteger.h"
23 #include "he-configuration.h"
24 
25 namespace ns3 {
26 
27 NS_LOG_COMPONENT_DEFINE ("HeConfiguration");
28 NS_OBJECT_ENSURE_REGISTERED (HeConfiguration);
29 
31 {
32  NS_LOG_FUNCTION (this);
33 }
34 
35 TypeId
37 {
38  static ns3::TypeId tid = ns3::TypeId ("ns3::HeConfiguration")
39  .SetParent<Object> ()
40  .SetGroupName ("Wifi")
41  .AddConstructor<HeConfiguration> ()
42  .AddAttribute ("GuardInterval",
43  "Specify the shortest guard interval duration that can be used for HE transmissions."
44  "Possible values are 800ns, 1600ns or 3200ns.",
45  TimeValue (NanoSeconds (3200)),
48  MakeTimeChecker (NanoSeconds (800), NanoSeconds (3200)))
49  .AddAttribute ("BssColor",
50  "The BSS color",
51  UintegerValue (0),
54  MakeUintegerChecker<uint8_t> ())
55  .AddAttribute ("MpduBufferSize",
56  "The MPDU buffer size for receiving A-MPDUs",
57  UintegerValue (64),
60  MakeUintegerChecker<uint16_t> (64, 256))
61  ;
62  return tid;
63 }
64 
65 void
67 {
68  NS_LOG_FUNCTION (this << guardInterval);
69  NS_ASSERT (guardInterval == NanoSeconds (800) || guardInterval == NanoSeconds (1600) || guardInterval == NanoSeconds (3200));
70  m_guardInterval = guardInterval;
71 }
72 
73 Time
75 {
76  return m_guardInterval;
77 }
78 
79 void
80 HeConfiguration::SetBssColor (uint8_t bssColor)
81 {
82  NS_LOG_FUNCTION (this << +bssColor);
83  m_bssColor = bssColor;
84 }
85 
86 uint8_t
88 {
89  return m_bssColor;
90 }
91 
92 void
94 {
95  NS_LOG_FUNCTION (this << size);
96  m_mpduBufferSize = size;
97 }
98 
99 uint16_t
101 {
102  return m_mpduBufferSize;
103 }
104 
105 } //namespace ns3
HE configuration.
static TypeId GetTypeId(void)
Get the type ID.
uint8_t GetBssColor(void) const
uint16_t m_mpduBufferSize
MPDU buffer size.
Time GetGuardInterval(void) const
void SetBssColor(uint8_t bssColor)
uint16_t GetMpduBufferSize(void) const
Time m_guardInterval
Supported HE guard interval.
void SetGuardInterval(Time guardInterval)
uint8_t m_bssColor
BSS color.
void SetMpduBufferSize(uint16_t size)
A base class which provides memory management and object aggregation.
Definition: object.h:88
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
AttributeValue implementation for Time.
Definition: nstime.h:1353
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
Hold an unsigned integer type.
Definition: uinteger.h:44
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:67
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: nstime.h:1354
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: uinteger.h:45
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
#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:45
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1313
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:533