|
|
| 46 |
* |
46 |
* |
| 47 |
* @param size size of payload in octets (includes everything after the PLCP header) |
47 |
* @param size size of payload in octets (includes everything after the PLCP header) |
| 48 |
* @param payloadMode the WifiMode used |
48 |
* @param payloadMode the WifiMode used |
| 49 |
* @param knownDurationMicroSeconds the known payload size |
49 |
* @param knownDurationMicroSeconds the known duration value of the transmission in microseconds |
| 50 |
* |
50 |
* |
| 51 |
* @return true if values correspond, false otherwise |
51 |
* @return true if values correspond, false otherwise |
| 52 |
*/ |
52 |
*/ |
|
|
| 59 |
* @param size size of payload in octets (includes everything after the PLCP header) |
59 |
* @param size size of payload in octets (includes everything after the PLCP header) |
| 60 |
* @param payloadMode the WifiMode used |
60 |
* @param payloadMode the WifiMode used |
| 61 |
* @param preamble the WifiPreamble used |
61 |
* @param preamble the WifiPreamble used |
| 62 |
* @param knownDurationMicroSeconds the known value of the transmission |
62 |
* @param knownDurationMicroSeconds the known duration value of the transmission in microseconds |
| 63 |
* |
63 |
* |
| 64 |
* @return true if values correspond, false otherwise |
64 |
* @return true if values correspond, false otherwise |
| 65 |
*/ |
65 |
*/ |
|
|
| 89 |
{ |
89 |
{ |
| 90 |
testedFrequency = CHANNEL_36_MHZ; |
90 |
testedFrequency = CHANNEL_36_MHZ; |
| 91 |
} |
91 |
} |
| 92 |
uint32_t calculatedDurationMicroSeconds = WifiPhy::GetPayloadDurationMicroSeconds (size, txVector, testedFrequency); |
92 |
double calculatedDurationMicroSeconds = WifiPhy::GetPayloadDurationMicroSeconds (size, txVector, testedFrequency); |
| 93 |
if (calculatedDurationMicroSeconds != knownDurationMicroSeconds) |
93 |
if (calculatedDurationMicroSeconds != knownDurationMicroSeconds) |
| 94 |
{ |
94 |
{ |
| 95 |
std::cerr << " size=" << size |
95 |
std::cerr << " size=" << size |
|
|
| 131 |
{ |
131 |
{ |
| 132 |
testedFrequency = CHANNEL_36_MHZ; |
132 |
testedFrequency = CHANNEL_36_MHZ; |
| 133 |
} |
133 |
} |
| 134 |
double calculatedDurationMicroSeconds = WifiPhy::CalculateTxDuration (size, txVector, preamble, testedFrequency).GetMicroSeconds (); |
134 |
double calculatedDurationMicroSeconds = ((double)WifiPhy::CalculateTxDuration (size, txVector, preamble, testedFrequency).GetNanoSeconds ())/1000; |
| 135 |
if (calculatedDurationMicroSeconds != knownDurationMicroSeconds) |
135 |
if (calculatedDurationMicroSeconds != knownDurationMicroSeconds) |
| 136 |
{ |
136 |
{ |
| 137 |
std::cerr << " size=" << size |
137 |
std::cerr << " size=" << size |
|
|
| 146 |
{ |
146 |
{ |
| 147 |
// Durations vary depending on frequency; test also 2.4 GHz (bug 1971) |
147 |
// Durations vary depending on frequency; test also 2.4 GHz (bug 1971) |
| 148 |
testedFrequency = CHANNEL_1_MHZ; |
148 |
testedFrequency = CHANNEL_1_MHZ; |
| 149 |
calculatedDurationMicroSeconds = WifiPhy::CalculateTxDuration (size, txVector, preamble, testedFrequency).GetMicroSeconds (); |
149 |
calculatedDurationMicroSeconds = ((double)WifiPhy::CalculateTxDuration (size, txVector, preamble, testedFrequency).GetNanoSeconds ())/1000; |
| 150 |
if (calculatedDurationMicroSeconds != knownDurationMicroSeconds + 6) |
150 |
if (calculatedDurationMicroSeconds != knownDurationMicroSeconds + 6) |
| 151 |
{ |
151 |
{ |
| 152 |
std::cerr << " size=" << size |
152 |
std::cerr << " size=" << size |
|
|
| 245 |
&& CheckTxDuration (1536,WifiPhy::GetOfdmRate65MbpsBW20MHz (), WIFI_PREAMBLE_HT_MF,228) |
245 |
&& CheckTxDuration (1536,WifiPhy::GetOfdmRate65MbpsBW20MHz (), WIFI_PREAMBLE_HT_MF,228) |
| 246 |
&& CheckTxDuration (76, WifiPhy::GetOfdmRate65MbpsBW20MHz (), WIFI_PREAMBLE_HT_MF,48) |
246 |
&& CheckTxDuration (76, WifiPhy::GetOfdmRate65MbpsBW20MHz (), WIFI_PREAMBLE_HT_MF,48) |
| 247 |
&& CheckTxDuration (14, WifiPhy::GetOfdmRate65MbpsBW20MHz (), WIFI_PREAMBLE_HT_MF,40 ) |
247 |
&& CheckTxDuration (14, WifiPhy::GetOfdmRate65MbpsBW20MHz (), WIFI_PREAMBLE_HT_MF,40 ) |
| 248 |
//should be 218.8, 38,8 and 31.6 but microseconds are only represented as integers will have to change Time to change that |
248 |
&& CheckTxDuration (1536, WifiPhy::GetOfdmRate65MbpsBW20MHzShGi (), WIFI_PREAMBLE_HT_GF,218.8) |
| 249 |
&& CheckTxDuration (1536, WifiPhy::GetOfdmRate65MbpsBW20MHzShGi (), WIFI_PREAMBLE_HT_GF,218) |
249 |
&& CheckTxDuration (76, WifiPhy::GetOfdmRate65MbpsBW20MHzShGi (), WIFI_PREAMBLE_HT_GF,38.8) |
| 250 |
&& CheckTxDuration (76, WifiPhy::GetOfdmRate65MbpsBW20MHzShGi (), WIFI_PREAMBLE_HT_GF,38) |
250 |
&& CheckTxDuration (14, WifiPhy::GetOfdmRate65MbpsBW20MHzShGi (), WIFI_PREAMBLE_HT_GF,31.6); |
| 251 |
&& CheckTxDuration (14, WifiPhy::GetOfdmRate65MbpsBW20MHzShGi (), WIFI_PREAMBLE_HT_GF,31); |
|
|
| 252 |
|
251 |
|
| 253 |
NS_TEST_EXPECT_MSG_EQ (retval, true, "an 802.11n duration failed"); |
252 |
NS_TEST_EXPECT_MSG_EQ (retval, true, "an 802.11n duration failed"); |
| 254 |
} |
253 |
} |