A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
he-6ghz-band-capabilities.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Rami Abdallah <abdallah.rami@gmail.com>
7 */
8
10
11namespace ns3
12{
13
15 : m_capabilitiesInfo{}
16{
17}
18
24
30
31uint16_t
33{
34 // Return size of Element ID Extension and
35 // Capabilities Information field in octets
36 return 1 + /* Element ID Ext */ +2 /* Capabilities Information */;
37}
38
39void
41{
42 for (uint8_t i = 0; i <= 7; i++)
43 {
44 if ((1UL << (13 + i)) - 1 == maxAmpduLength)
45 {
47 return;
48 }
49 }
50 NS_ABORT_MSG("Invalid A-MPDU Max Length value");
51}
52
58
59void
61{
62 NS_ABORT_MSG_IF(length != 3895 && length != 7991 && length != 11454,
63 "Invalid MPDU Max Length value");
64 if (length == 11454)
65 {
67 }
68 else if (length == 7991)
69 {
71 }
72 else
73 {
75 }
76}
77
78uint16_t
80{
82 {
83 return 3895;
84 }
86 {
87 return 7991;
88 }
90 {
91 return 11454;
92 }
93 NS_ABORT_MSG("The value 3 is reserved");
94}
95
96void
108
109uint16_t
111{
112 Buffer::Iterator tmp = start;
113 uint16_t twoBytes = start.ReadLsbtohU16();
115 m_capabilitiesInfo.m_maxAmpduLengthExponent = (twoBytes >> 3) & 0x07;
116 m_capabilitiesInfo.m_maxMpduLength = (twoBytes >> 6) & 0x03;
117 m_capabilitiesInfo.m_smPowerSave = (twoBytes >> 9) & 0x03;
118 m_capabilitiesInfo.m_rdResponder = (twoBytes >> 11) & 0x01;
119 m_capabilitiesInfo.m_rxAntennaPatternConsistency = (twoBytes >> 12) & 0x01;
120 m_capabilitiesInfo.m_txAntennaPatternConsistency = (twoBytes >> 13) & 0x01;
121 return start.GetDistanceFrom(tmp);
122}
123
124void
125He6GhzBandCapabilities::Print(std::ostream& os) const
126{
127 os << "HE 6GHz Band Capabilities=[Capabilities Information|"
128 << " Min MPDU start spacing: " << +m_capabilitiesInfo.m_minMpduStartSpacing
129 << " Max A-MPDU Length Exp: " << +m_capabilitiesInfo.m_maxAmpduLengthExponent
130 << " Max MPDU Length: " << +m_capabilitiesInfo.m_maxMpduLength
131 << " SM Power Save: " << +m_capabilitiesInfo.m_smPowerSave
132 << " RD Responder: " << +m_capabilitiesInfo.m_rdResponder
133 << " RX Antenna Pattern: " << +m_capabilitiesInfo.m_rxAntennaPatternConsistency
134 << " TX Antenna Pattern: " << +m_capabilitiesInfo.m_txAntennaPatternConsistency << "]";
135}
136
137} // namespace ns3
iterator in a Buffer instance
Definition buffer.h:89
uint16_t ReadLsbtohU16()
Definition buffer.cc:1053
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
uint32_t GetMaxAmpduLength() const
Return the maximum A-MPDU length.
uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
void Print(std::ostream &os) const override
Generate human-readable form of IE.
WifiInformationElementId ElementIdExt() const override
Get the wifi information element ID extension.
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
uint16_t GetMaxMpduLength() const
Get the maximum MPDU length.
CapabilitiesInfo m_capabilitiesInfo
capabilities field
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
void SetMaxMpduLength(uint16_t length)
Set the maximum MPDU length.
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition abort.h:38
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition abort.h:97
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
uint8_t m_maxAmpduLengthExponent
Maximum A-MPDU Length Exponent (can also be set via convenient methods)
uint8_t m_maxMpduLength
Maximum MPDU Length (can also be set via convenient methods)
uint8_t m_minMpduStartSpacing
Minimum MPDU Start Spacing.
uint8_t m_rxAntennaPatternConsistency
Receive Antenna Pattern Consistency.
uint8_t m_txAntennaPatternConsistency
Transmit Antenna Pattern Consistency.
#define IE_EXTENSION
#define IE_EXT_HE_6GHZ_CAPABILITIES