OLD | NEW |
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) 2005,2006,2007 INRIA | 3 * Copyright (c) 2005,2006,2007 INRIA |
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 * | 133 * |
134 * \returns the data bit rate of this signal. | 134 * \returns the data bit rate of this signal. |
135 */ | 135 */ |
136 uint64_t GetDataRate (uint8_t channelWidth, uint16_t guardInterval, uint8_t ns
s) const; | 136 uint64_t GetDataRate (uint8_t channelWidth, uint16_t guardInterval, uint8_t ns
s) const; |
137 /** | 137 /** |
138 * \param txVector the WifiTxVector of the signal | 138 * \param txVector the WifiTxVector of the signal |
139 * | 139 * |
140 * \returns the data bit rate of this signal. | 140 * \returns the data bit rate of this signal. |
141 */ | 141 */ |
142 uint64_t GetDataRate (WifiTxVector txVector) const; | 142 uint64_t GetDataRate (WifiTxVector txVector) const; |
143 /* | 143 /** |
144 * \param channelWidth the considered channel width in MHz | 144 * \param channelWidth the considered channel width in MHz |
145 * | 145 * |
146 * \returns the data bit rate of this non-HT or non-VHT signal. | 146 * \returns the data bit rate of this non-HT or non-VHT signal. |
147 */ | 147 */ |
148 uint64_t GetDataRate (uint8_t channelWidth) const; | 148 uint64_t GetDataRate (uint8_t channelWidth) const; |
149 | 149 |
150 /** | 150 /** |
151 * \returns the coding rate of this transmission mode | 151 * \returns the coding rate of this transmission mode |
152 */ | 152 */ |
153 WifiCodeRate GetCodeRate (void) const; | 153 WifiCodeRate GetCodeRate (void) const; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 /** | 186 /** |
187 * \returns the rate (in bps) of the non-HT Reference Rate | 187 * \returns the rate (in bps) of the non-HT Reference Rate |
188 * which corresponds to the HT MCS of this WifiMode. | 188 * which corresponds to the HT MCS of this WifiMode. |
189 * | 189 * |
190 * To convert an HT MCS to is corresponding non-HT Reference Rate | 190 * To convert an HT MCS to is corresponding non-HT Reference Rate |
191 * use the modulation and coding rate of the HT MCS | 191 * use the modulation and coding rate of the HT MCS |
192 * and lookup in Table 9-5 of IEEE 802.11-2012. | 192 * and lookup in Table 9-5 of IEEE 802.11-2012. |
193 */ | 193 */ |
194 uint64_t GetNonHtReferenceRate (void) const; | 194 uint64_t GetNonHtReferenceRate (void) const; |
195 /** | 195 /** |
| 196 * \param mode wifi mode |
196 * \returns true if this WifiMode has a | 197 * \returns true if this WifiMode has a |
197 * a code rate strictly higher than mode. | 198 * a code rate strictly higher than mode. |
198 */ | 199 */ |
199 bool IsHigherCodeRate (WifiMode mode) const; | 200 bool IsHigherCodeRate (WifiMode mode) const; |
200 /** | 201 /** |
| 202 * \param mode wifi mode |
201 * \returns true if this WifiMode has a | 203 * \returns true if this WifiMode has a |
202 * a rate strictly higher than mode. | 204 * a rate strictly higher than mode. |
203 */ | 205 */ |
204 bool IsHigherDataRate (WifiMode mode) const; | 206 bool IsHigherDataRate (WifiMode mode) const; |
205 | 207 |
206 /** | 208 /** |
207 * Create an invalid WifiMode. Calling any method on the | 209 * Create an invalid WifiMode. Calling any method on the |
208 * instance created will trigger an assert. This is useful | 210 * instance created will trigger an assert. This is useful |
209 * to separate the declaration of a WifiMode variable from | 211 * to separate the declaration of a WifiMode variable from |
210 * its initialization. | 212 * its initialization. |
(...skipping 10 matching lines...) Expand all Loading... |
221 | 223 |
222 private: | 224 private: |
223 friend class WifiModeFactory; | 225 friend class WifiModeFactory; |
224 friend class WifiPhyTag; // access the UID-based constructor | 226 friend class WifiPhyTag; // access the UID-based constructor |
225 /** | 227 /** |
226 * Create a WifiMode from a given unique ID. | 228 * Create a WifiMode from a given unique ID. |
227 * | 229 * |
228 * \param uid unique ID | 230 * \param uid unique ID |
229 */ | 231 */ |
230 WifiMode (uint32_t uid); | 232 WifiMode (uint32_t uid); |
231 uint32_t m_uid; | 233 uint32_t m_uid; ///< UID |
232 }; | 234 }; |
233 | 235 |
| 236 /// equality operator |
234 bool operator == (const WifiMode &a, const WifiMode &b); | 237 bool operator == (const WifiMode &a, const WifiMode &b); |
235 std::ostream & operator << (std::ostream & os, const WifiMode &mode); | 238 std::ostream & operator << (std::ostream & os, const WifiMode &mode); |
236 std::istream & operator >> (std::istream &is, WifiMode &mode); | 239 std::istream & operator >> (std::istream &is, WifiMode &mode); |
237 | 240 |
238 ATTRIBUTE_HELPER_HEADER (WifiMode); | 241 ATTRIBUTE_HELPER_HEADER (WifiMode); |
239 | 242 |
240 /** | 243 /** |
241 * In various parts of the code, folk are interested in maintaining a | 244 * In various parts of the code, folk are interested in maintaining a |
242 * list of transmission modes. The vector class provides a good basis | 245 * list of transmission modes. The vector class provides a good basis |
243 * for this, but we here add some syntactic sugar by defining a | 246 * for this, but we here add some syntactic sugar by defining a |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 static WifiModeFactory* GetFactory (); | 310 static WifiModeFactory* GetFactory (); |
308 WifiModeFactory (); | 311 WifiModeFactory (); |
309 | 312 |
310 /** | 313 /** |
311 * This is the data associated to a unique WifiMode. | 314 * This is the data associated to a unique WifiMode. |
312 * The integer stored in a WifiMode is in fact an index | 315 * The integer stored in a WifiMode is in fact an index |
313 * in an array of WifiModeItem objects. | 316 * in an array of WifiModeItem objects. |
314 */ | 317 */ |
315 struct WifiModeItem | 318 struct WifiModeItem |
316 { | 319 { |
317 std::string uniqueUid; | 320 std::string uniqueUid; ///< unique UID |
318 WifiModulationClass modClass; | 321 WifiModulationClass modClass; ///< modulation class |
319 uint16_t constellationSize; | 322 uint16_t constellationSize; ///< constellation size |
320 WifiCodeRate codingRate; | 323 WifiCodeRate codingRate; ///< coding rate |
321 bool isMandatory; | 324 bool isMandatory; ///< is mandatory? |
322 uint8_t mcsValue; | 325 uint8_t mcsValue; ///< MCS value |
323 }; | 326 }; |
324 | 327 |
325 /** | 328 /** |
326 * Search and return WifiMode from a given name. | 329 * Search and return WifiMode from a given name. |
327 * | 330 * |
328 * \param name human-readable WifiMode | 331 * \param name human-readable WifiMode |
329 * | 332 * |
330 * \return WifiMode | 333 * \return WifiMode |
331 */ | 334 */ |
332 WifiMode Search (std::string name) const; | 335 WifiMode Search (std::string name) const; |
(...skipping 11 matching lines...) Expand all Loading... |
344 * \param uid | 347 * \param uid |
345 * | 348 * |
346 * \return WifiModeItem at the given uid | 349 * \return WifiModeItem at the given uid |
347 */ | 350 */ |
348 WifiModeItem* Get (uint32_t uid); | 351 WifiModeItem* Get (uint32_t uid); |
349 | 352 |
350 /** | 353 /** |
351 * typedef for a vector of WifiModeItem. | 354 * typedef for a vector of WifiModeItem. |
352 */ | 355 */ |
353 typedef std::vector<WifiModeItem> WifiModeItemList; | 356 typedef std::vector<WifiModeItem> WifiModeItemList; |
354 WifiModeItemList m_itemList; | 357 WifiModeItemList m_itemList; ///< item list |
355 }; | 358 }; |
356 | 359 |
357 } //namespace ns3 | 360 } //namespace ns3 |
358 | 361 |
359 #endif /* WIFI_MODE_H */ | 362 #endif /* WIFI_MODE_H */ |
OLD | NEW |