src/wifi/model/amrr-wifi-manager.cc
changeset 10139 17a71cd49da3
parent 9894 ac4e52a91d5d
child 10410 4d4eb8097fa3
equal deleted inserted replaced
10138:2f8e35b43d11 10139:17a71cd49da3
    21 #include "amrr-wifi-manager.h"
    21 #include "amrr-wifi-manager.h"
    22 #include "ns3/simulator.h"
    22 #include "ns3/simulator.h"
    23 #include "ns3/log.h"
    23 #include "ns3/log.h"
    24 #include "ns3/uinteger.h"
    24 #include "ns3/uinteger.h"
    25 #include "ns3/double.h"
    25 #include "ns3/double.h"
       
    26 
       
    27 #define Min(a,b) ((a < b) ? a : b)
    26 
    28 
    27 NS_LOG_COMPONENT_DEFINE ("AmrrWifiRemoteStation");
    29 NS_LOG_COMPONENT_DEFINE ("AmrrWifiRemoteStation");
    28 
    30 
    29 namespace ns3 {
    31 namespace ns3 {
    30 
    32 
   265     {
   267     {
   266       NS_LOG_DEBUG ("Reset");
   268       NS_LOG_DEBUG ("Reset");
   267       ResetCnt (station);
   269       ResetCnt (station);
   268     }
   270     }
   269 }
   271 }
   270 WifiMode
   272 WifiTxVector
   271 AmrrWifiManager::DoGetDataMode (WifiRemoteStation *st, uint32_t size)
   273 AmrrWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint32_t size)
   272 {
   274 {
   273   NS_LOG_FUNCTION (this << st << size);
   275   NS_LOG_FUNCTION (this << st << size);
   274   AmrrWifiRemoteStation *station = (AmrrWifiRemoteStation *)st;
   276   AmrrWifiRemoteStation *station = (AmrrWifiRemoteStation *)st;
   275   UpdateMode (station);
   277   UpdateMode (station);
   276   NS_ASSERT (station->m_txrate < GetNSupported (station));
   278   NS_ASSERT (station->m_txrate < GetNSupported (station));
   311         {
   313         {
   312           rateIndex = station->m_txrate;
   314           rateIndex = station->m_txrate;
   313         }
   315         }
   314     }
   316     }
   315 
   317 
   316   return GetSupported (station, rateIndex);
   318   return WifiTxVector (GetSupported (station, rateIndex), GetDefaultTxPowerLevel (), GetLongRetryCount (station), GetShortGuardInterval (station), Min (GetNumberOfReceiveAntennas (station),GetNumberOfTransmitAntennas()), GetNumberOfTransmitAntennas (station), GetStbc (station));
   317 }
   319 }
   318 WifiMode
   320 WifiTxVector
   319 AmrrWifiManager::DoGetRtsMode (WifiRemoteStation *st)
   321 AmrrWifiManager::DoGetRtsTxVector (WifiRemoteStation *st)
   320 {
   322 {
   321   NS_LOG_FUNCTION (this << st);
   323   NS_LOG_FUNCTION (this << st);
   322   AmrrWifiRemoteStation *station = (AmrrWifiRemoteStation *)st;
   324   AmrrWifiRemoteStation *station = (AmrrWifiRemoteStation *)st;
   323   UpdateMode (station);
   325   UpdateMode (station);
   324   /// \todo can we implement something smarter ?
   326   /// \todo can we implement something smarter ?
   325   return GetSupported (station, 0);
   327   return WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), GetShortGuardInterval (station), Min (GetNumberOfReceiveAntennas (station),GetNumberOfTransmitAntennas()), GetNumberOfTransmitAntennas (station), GetStbc (station));
   326 }
   328 }
   327 
   329 
   328 
   330 
   329 bool
   331 bool
   330 AmrrWifiManager::IsLowLatency (void) const
   332 AmrrWifiManager::IsLowLatency (void) const