21 #include <ns3/object.h>
25 #include "ns3/interference-helper.h"
26 #include "ns3/yans-wifi-phy.h"
40 virtual void DoRun (
void);
53 bool CheckPayloadDuration (uint32_t size,
WifiMode payloadMode,
WifiPreamble preamble, uint32_t knownDurationMicroSeconds);
66 bool CheckTxDuration (uint32_t size,
WifiMode payloadMode,
WifiPreamble preamble,
double knownDurationMicroSeconds);
94 if (calculatedDurationMicroSeconds != knownDurationMicroSeconds)
96 std::cerr <<
" size=" << size
97 <<
" mode=" << payloadMode
98 <<
" known=" << knownDurationMicroSeconds
99 <<
" calculated=" << calculatedDurationMicroSeconds
108 if (calculatedDurationMicroSeconds != knownDurationMicroSeconds + 6)
110 std::cerr <<
" size=" << size
111 <<
" mode=" << payloadMode
112 <<
" known=" << knownDurationMicroSeconds
113 <<
" calculated=" << calculatedDurationMicroSeconds
125 txVector.
SetMode (payloadMode);
137 if (calculatedDurationMicroSeconds != knownDurationMicroSeconds)
139 std::cerr <<
" size=" << size
140 <<
" mode=" << payloadMode
141 <<
" preamble=" << preamble
142 <<
" known=" << knownDurationMicroSeconds
143 <<
" calculated=" << calculatedDurationMicroSeconds
152 if (calculatedDurationMicroSeconds != knownDurationMicroSeconds + 6)
154 std::cerr <<
" size=" << size
155 <<
" mode=" << payloadMode
156 <<
" preamble=" << preamble
157 <<
" known=" << knownDurationMicroSeconds
158 <<
" calculated=" << calculatedDurationMicroSeconds
288 :
TestSuite (
"devices-wifi-tx-duration", UNIT)
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
static TxDurationTestSuite g_txDurationTestSuite
enum WifiModulationClass GetModulationClass() const
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetStbc(bool stbc)
Sets if STBC is being used.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
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()
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
void AddTestCase(TestCase *testCase, enum TestDuration duration)
Add an individual child TestCase to this test suite.
Time CalculateTxDuration(uint32_t size, WifiTxVector txvector, enum WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag)
void SetNss(uint8_t nss)
Sets the number of Nss refer to IEEE 802.11n Table 20-28 for explanation and range.
static const double CHANNEL_1_MHZ
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool CheckPayloadDuration(uint32_t size, WifiMode payloadMode, WifiPreamble preamble, uint32_t knownDurationMicroSeconds)
Check if the payload tx duration returned by InterferenceHelper corresponds to a known value of the p...
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
static const double CHANNEL_36_MHZ
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 IEEE 802.11n Table 20-6 for explanation.
Time GetPayloadDuration(uint32_t size, WifiTxVector txvector, WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag)