diff -r d203296efb63 -r 072fb225b714 src/wifi/model/cara-wifi-manager.cc --- a/src/wifi/model/cara-wifi-manager.cc Fri May 06 13:21:20 2011 -0700 +++ b/src/wifi/model/cara-wifi-manager.cc Sat May 07 21:49:46 2011 +0200 @@ -3,7 +3,7 @@ * Copyright (c) 2004,2005,2006 INRIA * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as + * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation; * * This program is distributed in the hope that it will be useful, @@ -34,47 +34,49 @@ { uint32_t m_timer; uint32_t m_success; - uint32_t m_failed; + uint32_t m_failed; uint32_t m_rate; }; -NS_OBJECT_ENSURE_REGISTERED(CaraWifiManager); +NS_OBJECT_ENSURE_REGISTERED (CaraWifiManager); -TypeId +TypeId CaraWifiManager::GetTypeId (void) { - static TypeId tid = TypeId ("ns3::CaraWifiManager") - .SetParent () - .AddConstructor () - .AddAttribute ("ProbeThreshold", - "The number of consecutive transmissions failure to activate the RTS probe.", - UintegerValue (1), - MakeUintegerAccessor (&CaraWifiManager::m_probeThreshold), - MakeUintegerChecker ()) - .AddAttribute ("FailureThreshold", - "The number of consecutive transmissions failure to decrease the rate.", - UintegerValue (2), - MakeUintegerAccessor (&CaraWifiManager::m_failureThreshold), - MakeUintegerChecker ()) - .AddAttribute ("SuccessThreshold", - "The minimum number of sucessfull transmissions to try a new rate.", - UintegerValue (10), - MakeUintegerAccessor (&CaraWifiManager::m_successThreshold), - MakeUintegerChecker ()) - .AddAttribute ("Timeout", - "The 'timer' in the CARA algorithm", - UintegerValue (15), - MakeUintegerAccessor (&CaraWifiManager::m_timerTimeout), - MakeUintegerChecker ()) - ; - return tid; + static TypeId tid = TypeId ("ns3::CaraWifiManager") + .SetParent () + .AddConstructor () + .AddAttribute ("ProbeThreshold", + "The number of consecutive transmissions failure to activate the RTS probe.", + UintegerValue (1), + MakeUintegerAccessor (&CaraWifiManager::m_probeThreshold), + MakeUintegerChecker ()) + .AddAttribute ("FailureThreshold", + "The number of consecutive transmissions failure to decrease the rate.", + UintegerValue (2), + MakeUintegerAccessor (&CaraWifiManager::m_failureThreshold), + MakeUintegerChecker ()) + .AddAttribute ("SuccessThreshold", + "The minimum number of sucessfull transmissions to try a new rate.", + UintegerValue (10), + MakeUintegerAccessor (&CaraWifiManager::m_successThreshold), + MakeUintegerChecker ()) + .AddAttribute ("Timeout", + "The 'timer' in the CARA algorithm", + UintegerValue (15), + MakeUintegerAccessor (&CaraWifiManager::m_timerTimeout), + MakeUintegerChecker ()) + ; + return tid; } CaraWifiManager::CaraWifiManager () : WifiRemoteStationManager () -{} +{ +} CaraWifiManager::~CaraWifiManager () -{} +{ +} WifiRemoteStation * CaraWifiManager::DoCreateStation (void) const @@ -87,11 +89,12 @@ return station; } -void +void CaraWifiManager::DoReportRtsFailed (WifiRemoteStation *st) -{} +{ +} -void +void CaraWifiManager::DoReportDataFailed (WifiRemoteStation *st) { CaraWifiRemoteStation *station = (CaraWifiRemoteStation *) st; @@ -99,9 +102,9 @@ station->m_timer++; station->m_failed++; station->m_success = 0; - if (station->m_failed >= m_failureThreshold) + if (station->m_failed >= m_failureThreshold) { - NS_LOG_DEBUG ("self="<m_rate != 0) { station->m_rate--; @@ -110,47 +113,50 @@ station->m_timer = 0; } } -void +void CaraWifiManager::DoReportRxOk (WifiRemoteStation *st, - double rxSnr, WifiMode txMode) -{} -void + double rxSnr, WifiMode txMode) +{ +} +void CaraWifiManager::DoReportRtsOk (WifiRemoteStation *st, - double ctsSnr, WifiMode ctsMode, double rtsSnr) + double ctsSnr, WifiMode ctsMode, double rtsSnr) { - NS_LOG_DEBUG ("self="<m_timer++; station->m_success++; station->m_failed = 0; - NS_LOG_DEBUG ("self="<