LEFT | RIGHT |
(no file at all) | |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2009 CTTC | 3 * Copyright (c) 2009 CTTC |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 TxDurationTest::~TxDurationTest () | 74 TxDurationTest::~TxDurationTest () |
75 { | 75 { |
76 } | 76 } |
77 | 77 |
78 bool | 78 bool |
79 TxDurationTest::CheckPayloadDuration (uint32_t size, WifiMode payloadMode, uint3
2_t knownDurationMicroSeconds) | 79 TxDurationTest::CheckPayloadDuration (uint32_t size, WifiMode payloadMode, uint3
2_t knownDurationMicroSeconds) |
80 { | 80 { |
81 WifiTxVector txVector; | 81 WifiTxVector txVector; |
82 txVector.SetMode (payloadMode); | 82 txVector.SetMode (payloadMode); |
83 uint32_t calculatedDurationMicroSeconds = WifiPhy::GetPayloadDurationMicroSeco
nds (size, txVector); | 83 WifiPreamble preamble = WIFI_PREAMBLE_NONE; |
| 84 uint32_t calculatedDurationMicroSeconds = WifiPhy::GetPayloadDurationMicroSeco
nds (size, txVector,preamble,0,0); |
84 if (calculatedDurationMicroSeconds != knownDurationMicroSeconds) | 85 if (calculatedDurationMicroSeconds != knownDurationMicroSeconds) |
85 { | 86 { |
86 std::cerr << " size=" << size | 87 std::cerr << " size=" << size |
87 << " mode=" << payloadMode | 88 << " mode=" << payloadMode |
88 << " known=" << knownDurationMicroSeconds | 89 << " known=" << knownDurationMicroSeconds |
89 << " calculated=" << calculatedDurationMicroSeconds | 90 << " calculated=" << calculatedDurationMicroSeconds |
90 << std::endl; | 91 << std::endl; |
91 return false; | 92 return false; |
92 } | 93 } |
93 return true; | 94 return true; |
94 } | 95 } |
95 | 96 |
96 bool | 97 bool |
97 TxDurationTest::CheckTxDuration (uint32_t size, WifiMode payloadMode, WifiPreamb
le preamble, double knownDurationMicroSeconds) | 98 TxDurationTest::CheckTxDuration (uint32_t size, WifiMode payloadMode, WifiPreamb
le preamble, double knownDurationMicroSeconds) |
98 { | 99 { |
99 WifiTxVector txVector; | 100 WifiTxVector txVector; |
100 txVector.SetMode (payloadMode); | 101 txVector.SetMode (payloadMode); |
101 txVector.SetNss(1); | 102 txVector.SetNss(1); |
102 txVector.SetStbc(0); | 103 txVector.SetStbc(0); |
103 txVector.SetNess(0); | 104 txVector.SetNess(0); |
104 double calculatedDurationMicroSeconds = WifiPhy::CalculateTxDuration (size, tx
Vector, preamble).GetMicroSeconds (); | 105 double calculatedDurationMicroSeconds = WifiPhy::CalculateTxDuration (size, tx
Vector, preamble,0,0).GetMicroSeconds (); |
105 if (calculatedDurationMicroSeconds != knownDurationMicroSeconds) | 106 if (calculatedDurationMicroSeconds != knownDurationMicroSeconds) |
106 { | 107 { |
107 std::cerr << " size=" << size | 108 std::cerr << " size=" << size |
108 << " mode=" << payloadMode | 109 << " mode=" << payloadMode |
109 << " preamble=" << preamble | 110 << " preamble=" << preamble |
110 << " known=" << knownDurationMicroSeconds | 111 << " known=" << knownDurationMicroSeconds |
111 << " calculated=" << calculatedDurationMicroSeconds | 112 << " calculated=" << calculatedDurationMicroSeconds |
112 << std::endl; | 113 << std::endl; |
113 return false; | 114 return false; |
114 } | 115 } |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 206 |
206 TxDurationTestSuite::TxDurationTestSuite () | 207 TxDurationTestSuite::TxDurationTestSuite () |
207 : TestSuite ("devices-wifi-tx-duration", UNIT) | 208 : TestSuite ("devices-wifi-tx-duration", UNIT) |
208 { | 209 { |
209 AddTestCase (new TxDurationTest, TestCase::QUICK); | 210 AddTestCase (new TxDurationTest, TestCase::QUICK); |
210 } | 211 } |
211 | 212 |
212 static TxDurationTestSuite g_txDurationTestSuite; | 213 static TxDurationTestSuite g_txDurationTestSuite; |
213 } // namespace ns3 | 214 } // namespace ns3 |
214 | 215 |
LEFT | RIGHT |