src/wifi/model/arf-wifi-manager.cc
changeset 10139 17a71cd49da3
parent 9894 ac4e52a91d5d
child 10410 4d4eb8097fa3
equal deleted inserted replaced
10138:2f8e35b43d11 10139:17a71cd49da3
    20 
    20 
    21 #include "arf-wifi-manager.h"
    21 #include "arf-wifi-manager.h"
    22 #include "ns3/assert.h"
    22 #include "ns3/assert.h"
    23 #include "ns3/log.h"
    23 #include "ns3/log.h"
    24 #include "ns3/uinteger.h"
    24 #include "ns3/uinteger.h"
       
    25 
       
    26 #define Min(a,b) ((a < b) ? a : b)
    25 
    27 
    26 NS_LOG_COMPONENT_DEFINE ("ns3::ArfWifiManager");
    28 NS_LOG_COMPONENT_DEFINE ("ns3::ArfWifiManager");
    27 
    29 
    28 
    30 
    29 namespace ns3 {
    31 namespace ns3 {
   186 ArfWifiManager::DoReportFinalDataFailed (WifiRemoteStation *station)
   188 ArfWifiManager::DoReportFinalDataFailed (WifiRemoteStation *station)
   187 {
   189 {
   188   NS_LOG_FUNCTION (this << station);
   190   NS_LOG_FUNCTION (this << station);
   189 }
   191 }
   190 
   192 
   191 WifiMode
   193 WifiTxVector
   192 ArfWifiManager::DoGetDataMode (WifiRemoteStation *st, uint32_t size)
   194 ArfWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint32_t size)
   193 {
   195 {
   194   NS_LOG_FUNCTION (this << st << size);
   196   NS_LOG_FUNCTION (this << st << size);
   195   ArfWifiRemoteStation *station = (ArfWifiRemoteStation *) st;
   197   ArfWifiRemoteStation *station = (ArfWifiRemoteStation *) st;
   196   return GetSupported (station, station->m_rate);
   198   return WifiTxVector (GetSupported (station, station->m_rate), GetDefaultTxPowerLevel (), GetLongRetryCount (station), GetShortGuardInterval (station), Min (GetNumberOfReceiveAntennas (station),GetNumberOfTransmitAntennas()), GetNumberOfTransmitAntennas (station), GetStbc (station));
   197 }
   199 }
   198 WifiMode
   200 WifiTxVector
   199 ArfWifiManager::DoGetRtsMode (WifiRemoteStation *st)
   201 ArfWifiManager::DoGetRtsTxVector (WifiRemoteStation *st)
   200 {
   202 {
   201   NS_LOG_FUNCTION (this << st);
   203   NS_LOG_FUNCTION (this << st);
   202   /// \todo we could/should implement the Arf algorithm for
   204   /// \todo we could/should implement the Arf algorithm for
   203   /// RTS only by picking a single rate within the BasicRateSet.
   205   /// RTS only by picking a single rate within the BasicRateSet.
   204   ArfWifiRemoteStation *station = (ArfWifiRemoteStation *) st;
   206   ArfWifiRemoteStation *station = (ArfWifiRemoteStation *) st;
   205   return GetSupported (station, 0);
   207   return WifiTxVector (GetSupported (station, 0), GetDefaultTxPowerLevel (), GetLongRetryCount (station), GetShortGuardInterval (station), Min (GetNumberOfReceiveAntennas (station),GetNumberOfTransmitAntennas()), GetNumberOfTransmitAntennas (station), GetStbc (station));
   206 }
   208 }
   207 
   209 
   208 bool
   210 bool
   209 ArfWifiManager::IsLowLatency (void) const
   211 ArfWifiManager::IsLowLatency (void) const
   210 {
   212 {