19 m_records{{{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}}
45 NS_ABORT_MSG_IF(aifsn == 1 || aifsn > 15,
"Invalid AIFSN value: " << +aifsn);
47 m_records[aci].aifsnField |= (aifsn & 0x0f);
48 m_records[aci].aifsnField |= (aci & 0x03) << 5;
57 auto eCwMin = std::log2(cwMin + 1);
58 NS_ABORT_MSG_IF(std::trunc(eCwMin) != eCwMin,
"CWmin is not a power of 2 minus 1");
60 m_records[aci].cwMinMax |= (
static_cast<uint8_t
>(eCwMin) & 0x0f);
69 auto eCwMax = std::log2(cwMax + 1);
70 NS_ABORT_MSG_IF(std::trunc(eCwMax) != eCwMax,
"CWmax is not a power of 2 minus 1");
72 m_records[aci].cwMinMax |= (
static_cast<uint8_t
>(eCwMax) & 0x0f) << 4;
80 "Timer value is below 8.192 ms");
84 NS_ABORT_MSG_IF(std::trunc(value) != value,
"Timer value is not a multiple of 8 TUs (8192 us)");
86 m_records[aci].muEdcaTimer =
static_cast<uint8_t
>(value);
99 return (
m_records[aci].aifsnField & 0x0f);
106 uint8_t eCwMin = (
m_records[aci].cwMinMax & 0x0f);
107 return static_cast<uint16_t
>(std::exp2(eCwMin) - 1);
114 uint8_t eCwMax = ((
m_records[aci].cwMinMax >> 4) & 0x0f);
115 return static_cast<uint16_t
>(std::exp2(eCwMax) - 1);
138 start.WriteU8(record.aifsnField);
139 start.WriteU8(record.cwMinMax);
140 start.WriteU8(record.muEdcaTimer);
151 record.aifsnField = i.
ReadU8();
152 record.cwMinMax = i.
ReadU8();
153 record.muEdcaTimer = i.
ReadU8();
161 os <<
"MU EDCA Parameter Set=[QoS Info: " << +
m_qosInfo <<
", MU Parameter Records=";
164 os <<
"{AIFSN: " << +record.aifsnField <<
", CWmin/max: " << +record.cwMinMax
165 <<
", MU EDCA Timer: " << +record.muEdcaTimer <<
"}, ";
iterator in a Buffer instance
WifiInformationElementId ElementIdExt() const override
Get the wifi information element ID extension.
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)
uint16_t GetMuCwMin(uint8_t aci) const
Get the CWmin value encoded by the ECWmin subfield of the ECWmin/ECWmax field in the MU AC Parameter ...
void SetMuCwMin(uint8_t aci, uint16_t cwMin)
Set the ECWmin subfield of the ECWmin/ECWmax field in the MU AC Parameter Record field corresponding ...
void SetMuEdcaTimer(uint8_t aci, Time timer)
Set the MU EDCA Timer field in the MU AC Parameter Record field corresponding to the given AC Index (...
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
void SetMuAifsn(uint8_t aci, uint8_t aifsn)
Set the AIFSN subfield of the ACI/AIFSN field in the MU AC Parameter Record field corresponding to th...
void SetQosInfo(uint8_t qosInfo)
Set the QoS Info field in the MuEdcaParameterSet information element.
uint8_t GetMuAifsn(uint8_t aci) const
Get the AIFSN subfield of the ACI/AIFSN field in the MU AC Parameter Record field corresponding to th...
void Print(std::ostream &os) const override
Generate human-readable form of IE.
uint16_t GetMuCwMax(uint8_t aci) const
Get the CWmax value encoded by the ECWmax subfield of the ECWmin/ECWmax field in the MU AC Parameter ...
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
uint8_t GetQosInfo() const
Return the QoS Info field in the MuEdcaParameterSet information element.
std::array< ParameterRecord, 4 > m_records
MU AC Parameter Record fields.
Time GetMuEdcaTimer(uint8_t aci) const
Get the MU EDCA Timer value encoded in the MU AC Parameter Record field corresponding to the given AC...
uint8_t m_qosInfo
QoS info field.
void SetMuCwMax(uint8_t aci, uint16_t cwMax)
Set the ECWmax subfield of the ECWmin/ECWmax field in the MU AC Parameter Record field corresponding ...
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
Simulation virtual time values and global simulation resolution.
bool IsStrictlyPositive() const
Exactly equivalent to t > 0.
int64_t GetMicroSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
#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.