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) 2003,2007 INRIA | 3 * Copyright (c) 2003,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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 rateIndex = station->m_txrate; | 346 rateIndex = station->m_txrate; |
347 } | 347 } |
348 } | 348 } |
349 uint8_t channelWidth = GetChannelWidth (station); | 349 uint8_t channelWidth = GetChannelWidth (station); |
350 if (channelWidth > 20 && channelWidth != 22) | 350 if (channelWidth > 20 && channelWidth != 22) |
351 { | 351 { |
352 //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac | 352 //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac |
353 channelWidth = 20; | 353 channelWidth = 20; |
354 } | 354 } |
355 WifiMode mode = GetSupported (station, rateIndex); | 355 WifiMode mode = GetSupported (station, rateIndex); |
356 if (m_currentRate != mode.GetDataRate (channelWidth)) | 356 if (m_currentRate != mode.GetDataRate (static_cast<uint8_t>(channelWidth))) |
357 { | 357 { |
358 NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (channelWidth)); | 358 NS_LOG_DEBUG ("New datarate: " << mode.GetDataRate (static_cast<uint8_t>(c
hannelWidth))); |
359 m_currentRate = mode.GetDataRate (channelWidth); | 359 m_currentRate = mode.GetDataRate (static_cast<uint8_t>(channelWidth)); |
360 } | 360 } |
361 return WifiTxVector (mode, GetDefaultTxPowerLevel (), GetLongRetryCount (stati
on), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1, 0, chan
nelWidth, GetAggregation (station), false); | 361 return WifiTxVector (mode, GetDefaultTxPowerLevel (), static_cast<uint8_t>(Get
LongRetryCount (station)), GetPreambleForTransmission (mode, GetAddress (station
)), 800, 1, 1, 0, static_cast<uint8_t>(channelWidth), GetAggregation (station),
false); |
362 } | 362 } |
363 | 363 |
364 WifiTxVector | 364 WifiTxVector |
365 AmrrWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) | 365 AmrrWifiManager::DoGetRtsTxVector (WifiRemoteStation *st) |
366 { | 366 { |
367 NS_LOG_FUNCTION (this << st); | 367 NS_LOG_FUNCTION (this << st); |
368 AmrrWifiRemoteStation *station = (AmrrWifiRemoteStation *)st; | 368 AmrrWifiRemoteStation *station = (AmrrWifiRemoteStation *)st; |
369 uint8_t channelWidth = GetChannelWidth (station); | 369 uint8_t channelWidth = GetChannelWidth (station); |
370 if (channelWidth > 20 && channelWidth != 22) | 370 if (channelWidth > 20 && channelWidth != 22) |
371 { | 371 { |
372 //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac | 372 //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac |
373 channelWidth = 20; | 373 channelWidth = 20; |
374 } | 374 } |
375 UpdateMode (station); | 375 UpdateMode (station); |
376 WifiTxVector rtsTxVector; | 376 WifiTxVector rtsTxVector; |
377 WifiMode mode; | 377 WifiMode mode; |
378 if (GetUseNonErpProtection () == false) | 378 if (GetUseNonErpProtection () == false) |
379 { | 379 { |
380 mode = GetSupported (station, 0); | 380 mode = GetSupported (station, 0); |
381 } | 381 } |
382 else | 382 else |
383 { | 383 { |
384 mode = GetNonErpSupported (station, 0); | 384 mode = GetNonErpSupported (station, 0); |
385 } | 385 } |
386 rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), GetLongRetryCount
(station), GetPreambleForTransmission (mode, GetAddress (station)), 800, 1, 1,
0, channelWidth, GetAggregation (station), false); | 386 rtsTxVector = WifiTxVector (mode, GetDefaultTxPowerLevel (), static_cast<uint8
_t>(GetLongRetryCount (station)), GetPreambleForTransmission (mode, GetAddress (
station)), 800, 1, 1, 0, static_cast<int8_t>(channelWidth), GetAggregation (stat
ion), false); |
387 return rtsTxVector; | 387 return rtsTxVector; |
388 } | 388 } |
389 | 389 |
390 bool | 390 bool |
391 AmrrWifiManager::IsLowLatency (void) const | 391 AmrrWifiManager::IsLowLatency (void) const |
392 { | 392 { |
393 NS_LOG_FUNCTION (this); | 393 NS_LOG_FUNCTION (this); |
394 return true; | 394 return true; |
395 } | 395 } |
396 | 396 |
(...skipping 21 matching lines...) Expand all Loading... |
418 AmrrWifiManager::SetHeSupported (bool enable) | 418 AmrrWifiManager::SetHeSupported (bool enable) |
419 { | 419 { |
420 //HE is not supported by this algorithm. | 420 //HE is not supported by this algorithm. |
421 if (enable) | 421 if (enable) |
422 { | 422 { |
423 NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rat
es"); | 423 NS_FATAL_ERROR ("WifiRemoteStationManager selected does not support HE rat
es"); |
424 } | 424 } |
425 } | 425 } |
426 | 426 |
427 } //namespace ns3 | 427 } //namespace ns3 |
OLD | NEW |