21 #include <ns3/object.h>
25 #include "ns3/interference-helper.h"
26 #include "ns3/wifi-phy.h"
37 virtual void DoRun (
void);
50 bool CheckPayloadDuration (uint32_t size,
WifiMode payloadMode, uint32_t knownDurationMicroSeconds);
63 bool CheckTxDuration (uint32_t size,
WifiMode payloadMode,
WifiPreamble preamble,
double knownDurationMicroSeconds);
83 uint32_t calculatedDurationMicroSeconds = WifiPhy::GetPayloadDurationMicroSeconds (size, txVector);
84 if (calculatedDurationMicroSeconds != knownDurationMicroSeconds)
86 std::cerr <<
" size=" << size
87 <<
" mode=" << payloadMode
88 <<
" known=" << knownDurationMicroSeconds
89 <<
" calculated=" << calculatedDurationMicroSeconds
100 txVector.
SetMode (payloadMode);
104 double calculatedDurationMicroSeconds = WifiPhy::CalculateTxDuration (size, txVector, preamble).GetMicroSeconds ();
105 if (calculatedDurationMicroSeconds != knownDurationMicroSeconds)
107 std::cerr <<
" size=" << size
108 <<
" mode=" << payloadMode
109 <<
" preamble=" << preamble
110 <<
" known=" << knownDurationMicroSeconds
111 <<
" calculated=" << calculatedDurationMicroSeconds
207 :
TestSuite (
"devices-wifi-tx-duration", UNIT)
bool CheckPayloadDuration(uint32_t size, WifiMode payloadMode, uint32_t knownDurationMicroSeconds)
Check if the payload tx duration returned by InterferenceHelper corresponds to a known value of the p...
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
static TxDurationTestSuite g_txDurationTestSuite
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetStbc(bool stbc)
Sets if STBC is being used.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
virtual void DoRun(void)
Implementation to actually run this TestCase.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
virtual ~TxDurationTest()
void SetNss(uint8_t nss)
Sets the number of Nss refer to IEEE802.11n Table 20-28 for explanation and range.
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
bool CheckTxDuration(uint32_t size, WifiMode payloadMode, WifiPreamble preamble, double knownDurationMicroSeconds)
Check if the overall tx duration returned by InterferenceHelper corresponds to a known value of the p...
void SetNess(uint8_t ness)
Sets the Ness number refer to IEEE802.11n Table 20-6 for explanation.