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),
53  MakeUintegerChecker<uint8_t> ())
54  .AddAttribute ("MpduBufferSize",
55  "The MPDU buffer size for receiving A-MPDUs",
56  UintegerValue (64),
59  MakeUintegerChecker<uint16_t> (64, 256))
60  ;
61  return tid;
62 }
63 
64 void
66 {
67  NS_LOG_FUNCTION (this << guardInterval);
68  NS_ASSERT (guardInterval == NanoSeconds (800) || guardInterval == NanoSeconds (1600) || guardInterval == NanoSeconds (3200));
69  m_guardInterval = guardInterval;
70 }
71 
72 Time
74 {
75  return m_guardInterval;
76 }
77 
78 void
80 {
81  NS_LOG_FUNCTION (this << size);
82  m_mpduBufferSize = size;
83 }
84 
85 uint16_t
87 {
88  return m_mpduBufferSize;
89 }
90 
91 } //namespace ns3
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
#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
#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
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
Time GetGuardInterval(void) const
uint16_t m_mpduBufferSize
MPDU buffer size.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:449
AttributeValue implementation for Time.
Definition: nstime.h:1132
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1094
Hold an unsigned integer type.
Definition: uinteger.h:44
HE configurationThis object stores HE configuration information, for use in modifying AP or STA behav...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetMpduBufferSize(uint16_t size)
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:1133
void SetGuardInterval(Time guardInterval)
static TypeId GetTypeId(void)
Get the type ID.
uint16_t GetMpduBufferSize(void) const
uint8_t m_bssColor
BSS color.
A base class which provides memory management and object aggregation.
Definition: object.h:87
Time m_guardInterval
Supported HE guard interval.
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
a unique identifier for an interface.
Definition: type-id.h:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923