26 #include "ns3/he-ru.h"
269 NS_FATAL_ERROR (
"Error in creation of WifiMode named " << uniqueName << std::endl
270 <<
"Code rate must be WIFI_CODE_RATE_UNDEFINED iff Modulation Class is WIFI_MOD_CLASS_DSSS or WIFI_MOD_CLASS_HR_DSSS");
330 WifiModeItemList::const_iterator i;
334 if (i->uniqueUid == name)
345 << name <<
"\". Valid options are:");
366 for (WifiModeItemList::const_iterator i =
m_itemList.begin ();
369 if (i->uniqueUid == uniqueUid)
375 uint32_t uid =
static_cast<uint32_t
> (
m_itemList.size ());
390 static bool isFirstTime =
true;
394 uint32_t uid = factory.
AllocateUid (
"Invalid-WifiMode");
402 item->
GetPhyRateCallback = MakeNullCallback<uint64_t, uint16_t, uint16_t, uint8_t> ();
bool IsNull(void) 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 CreateWifiMode(std::string uniqueName, WifiModulationClass modClass, bool isMandatory, CodeRateCallback codeRateCallback, ConstellationSizeCallback constellationSizeCallback, PhyRateCallback phyRateCallback, PhyRateFromTxVectorCallback phyRateFromTxVectorCallback, DataRateCallback dataRateCallback, DataRateFromTxVectorCallback dataRateFromTxVectorCallback, ModeAllowedCallback isModeAllowedCallback)
static WifiMode CreateWifiMcs(std::string uniqueName, uint8_t mcsValue, WifiModulationClass modClass, CodeRateCallback codeRateCallback, ConstellationSizeCallback constellationSizeCallback, PhyRateCallback phyRateCallback, PhyRateFromTxVectorCallback phyRateFromTxVectorCallback, DataRateCallback dataRateCallback, DataRateFromTxVectorCallback dataRateFromTxVectorCallback, NonHtReferenceRateCallback nonHtReferenceRateCallback, ModeAllowedCallback isModeAllowedCallback)
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.
friend class WifiMode
allow WifiMode class access
represent a single transmission mode
WifiMode()
Create an invalid WifiMode.
uint16_t GetConstellationSize(void) const
uint64_t GetNonHtReferenceRate(void) const
uint8_t GetMcsValue(void) const
bool IsHigherDataRate(WifiMode mode) const
WifiModulationClass GetModulationClass() const
uint64_t GetPhyRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
uint32_t GetUid(void) const
std::string GetUniqueName(void) const
WifiCodeRate GetCodeRate(void) 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
bool IsMandatory(void) const
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
#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 ATTRIBUTE_HELPER_CPP(type)
Define the attribute value, accessor and checkers for class type
#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.
const uint16_t WIFI_CODE_RATE_UNDEFINED
undefined coding rate
bool operator==(const EventId &a, const EventId &b)
bool operator<(const EventId &a, const EventId &b)
uint16_t WifiCodeRate
These constants define the various convolutional coding rates used for the OFDM transmission modes in...
bool operator!=(Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > a, Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > b)
Inequality test.
std::istream & operator>>(std::istream &is, Angles &a)
std::ostream & operator<<(std::ostream &os, const Angles &a)
This is the data associated to a unique WifiMode.
WifiModulationClass modClass
modulation class
uint8_t mcsValue
MCS value.
DataRateFromTxVectorCallback GetDataRateFromTxVectorCallback
Callback to calculate data rate in bps of this WifiModeItem using a TXVECTOR as input.
PhyRateFromTxVectorCallback GetPhyRateFromTxVectorCallback
Callback to calculate PHY rate in bps of this WifiModeItem using a TXVECTOR as input.
std::string uniqueUid
unique UID
bool isMandatory
flag to indicate whether this mode is mandatory
ModeAllowedCallback IsModeAllowedCallback
Callback to check whether the combination of <MCS, channel width (MHz), NSS> is allowed.
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.