29 m_records {{{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}}
34 MuEdcaParameterSet::ElementId ()
const
40 MuEdcaParameterSet::ElementIdExt ()
const
46 MuEdcaParameterSet::IsPresent (
void)
const
48 auto timerNotNull = [](
const ParameterRecord &r) {
return r.muEdcaTimer != 0; };
50 bool isPresent = std::all_of (m_records.begin (), m_records.end (), timerNotNull);
55 NS_ABORT_MSG_IF (std::any_of (m_records.begin (), m_records.end (), timerNotNull),
56 "MU EDCA Timers must be either all zero or all non-zero.");
61 MuEdcaParameterSet::SetQosInfo (uint8_t qosInfo)
67 MuEdcaParameterSet::SetMuAifsn (uint8_t aci, uint8_t aifsn)
70 NS_ABORT_MSG_IF (aifsn == 1 || aifsn > 15,
"Invalid AIFSN value: " << +aifsn);
72 m_records[aci].aifsnField |= (aifsn & 0x0f);
73 m_records[aci].aifsnField |= (aci & 0x03) << 5;
77 MuEdcaParameterSet::SetMuCwMin (uint8_t aci, uint16_t cwMin)
82 auto eCwMin = std::log2 (cwMin + 1);
83 NS_ABORT_MSG_IF (std::trunc (eCwMin) != eCwMin,
"CWmin is not a power of 2 minus 1");
85 m_records[aci].cwMinMax |= (
static_cast<uint8_t
> (eCwMin) & 0x0f);
89 MuEdcaParameterSet::SetMuCwMax (uint8_t aci, uint16_t cwMax)
94 auto eCwMax = std::log2 (cwMax + 1);
95 NS_ABORT_MSG_IF (std::trunc (eCwMax) != eCwMax,
"CWmax is not a power of 2 minus 1");
97 m_records[aci].cwMinMax |= (
static_cast<uint8_t
> (eCwMax) & 0x0f) << 4;
101 MuEdcaParameterSet::SetMuEdcaTimer (uint8_t aci,
Time timer)
105 "Timer value is below 8.192 ms");
109 NS_ABORT_MSG_IF (std::trunc (value) != value,
"Timer value is not a multiple of 8 TUs (8192 us)");
111 m_records[aci].muEdcaTimer =
static_cast<uint8_t
> (value);
115 MuEdcaParameterSet::GetQosInfo (
void)
const
121 MuEdcaParameterSet::GetMuAifsn (uint8_t aci)
const
124 return (m_records[aci].aifsnField & 0x0f);
128 MuEdcaParameterSet::GetMuCwMin (uint8_t aci)
const
131 uint8_t eCwMin = (m_records[aci].cwMinMax & 0x0f);
132 return static_cast<uint16_t
> (std::exp2 (eCwMin) - 1);
136 MuEdcaParameterSet::GetMuCwMax (uint8_t aci)
const
139 uint8_t eCwMax = ((m_records[aci].cwMinMax >> 4) & 0x0f);
140 return static_cast<uint16_t
> (std::exp2 (eCwMax) - 1);
144 MuEdcaParameterSet::GetMuEdcaTimer (uint8_t aci)
const
147 return MicroSeconds (m_records[aci].muEdcaTimer * 8192);
151 MuEdcaParameterSet::GetInformationFieldSize ()
const
165 return WifiInformationElement::Serialize (i);
169 MuEdcaParameterSet::GetSerializedSize ()
const
175 return WifiInformationElement::GetSerializedSize ();
183 start.WriteU8 (GetQosInfo ());
184 for (
const auto& record : m_records)
186 start.WriteU8 (record.aifsnField);
187 start.WriteU8 (record.cwMinMax);
188 start.WriteU8 (record.muEdcaTimer);
198 for (
auto& record : m_records)
200 record.aifsnField = i.
ReadU8 ();
201 record.cwMinMax = i.
ReadU8 ();
202 record.muEdcaTimer = i.
ReadU8 ();
iterator in a Buffer instance
Simulation virtual time values and global simulation resolution.
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
bool IsStrictlyPositive(void) const
Exactly equivalent to t > 0.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
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.
MU AC Parameter Record type.