25 #include "ns3/he-ru.h"
196 "Trying to get HT reference rate for a non-HT rate");
297 << uniqueName << std::endl
298 <<
"Code rate must be WIFI_CODE_RATE_UNDEFINED iff Modulation Class is "
299 "WIFI_MOD_CLASS_DSSS or WIFI_MOD_CLASS_HR_DSSS");
355 if (i->uniqueUid == name)
365 NS_LOG_UNCOND(
"Could not find match for WifiMode named \"" << name <<
"\". Valid options are:");
388 if (i->uniqueUid == uniqueUid)
394 auto uid =
static_cast<uint32_t
>(
m_itemList.size());
409 static bool isFirstTime =
true;
413 uint32_t uid = factory.
AllocateUid(
"Invalid-WifiMode");
421 item->
GetPhyRateCallback = MakeNullCallback<uint64_t, const WifiTxVector&, uint16_t>();
bool IsNull() const
Check for null implementation.
create WifiMode class instances and keep track of them.
WifiModeItem * Get(uint32_t uid)
Return a WifiModeItem at the given UID index.
static WifiMode CreateWifiMcs(std::string uniqueName, uint8_t mcsValue, WifiModulationClass modClass, bool isMandatory, CodeRateCallback codeRateCallback, ConstellationSizeCallback constellationSizeCallback, PhyRateCallback phyRateCallback, DataRateCallback dataRateCallback, NonHtReferenceRateCallback nonHtReferenceRateCallback, AllowedCallback isAllowedCallback)
uint32_t AllocateUid(std::string uniqueUid)
Allocate a WifiModeItem from a given uniqueUid.
static WifiModeFactory * GetFactory()
Return a WifiModeFactory.
WifiModeItemList m_itemList
item list
WifiMode Search(std::string name) const
Search and return WifiMode from a given name.
static WifiMode CreateWifiMode(std::string uniqueName, WifiModulationClass modClass, bool isMandatory, CodeRateCallback codeRateCallback, ConstellationSizeCallback constellationSizeCallback, PhyRateCallback phyRateCallback, DataRateCallback dataRateCallback, AllowedCallback isAllowedCallback)
friend class WifiMode
allow WifiMode class access
represent a single transmission mode
WifiMode()
Create an invalid WifiMode.
std::string GetUniqueName() const
bool IsHigherDataRate(WifiMode mode) const
uint16_t GetConstellationSize() const
WifiModulationClass GetModulationClass() const
uint64_t GetPhyRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
uint64_t GetNonHtReferenceRate() const
WifiCodeRate GetCodeRate() const
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
bool IsHigherCodeRate(WifiMode mode) const
bool IsAllowed(uint16_t channelWidth, uint8_t nss) const
uint8_t GetMcsValue() const
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
void SetNss(uint8_t nss)
Sets the number of Nss.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_UNCOND(msg)
Output the requested message unconditionally.
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
@ WIFI_MOD_CLASS_HR_DSSS
HR/DSSS (Clause 16)
@ WIFI_MOD_CLASS_UNKNOWN
Modulation class unknown or unspecified.
@ WIFI_MOD_CLASS_HT
HT (Clause 19)
@ WIFI_MOD_CLASS_DSSS
DSSS (Clause 15)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool operator!=(Callback< R, Args... > a, Callback< R, Args... > b)
Inequality test.
bool operator==(const EventId &a, const EventId &b)
ATTRIBUTE_HELPER_CPP(ValueClassTest)
bool operator<(const EventId &a, const EventId &b)
std::istream & operator>>(std::istream &is, Angles &a)
std::ostream & operator<<(std::ostream &os, const Angles &a)
WifiCodeRate
These constants define the various convolutional coding rates used for the OFDM transmission modes in...
@ WIFI_CODE_RATE_UNDEFINED
undefined coding rate
This is the data associated to a unique WifiMode.
WifiModulationClass modClass
modulation class
uint8_t mcsValue
MCS value.
AllowedCallback IsAllowedCallback
Callback to check whether a given combination of is allowed.
std::string uniqueUid
unique UID
bool isMandatory
flag to indicate whether this mode is mandatory
PhyRateCallback GetPhyRateCallback
Callback to calculate PHY rate in bps of this WifiModeItem.
DataRateCallback GetDataRateCallback
Callback to calculate data rate in bps of this WifiModeItem.
NonHtReferenceRateCallback GetNonHtReferenceRateCallback
Callback to calculate non-HT reference rate of this WifiModeItem.
ConstellationSizeCallback GetConstellationSizeCallback
Callback to retrieve constellation size of this WifiModeItem.
CodeRateCallback GetCodeRateCallback
Callback to retrieve code rate of this WifiModeItem.