some debugging. Max rate test was inverted.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Fri, 14 Dec 2007 15:43:52 +0100
changeset 2278 4b05fbf5c6e3
parent 2277 51c66e7993c0
child 2279 ff1d63db246d
some debugging. Max rate test was inverted.
src/devices/wifi/amrr-mac-stations.cc
--- a/src/devices/wifi/amrr-mac-stations.cc	Fri Dec 14 15:18:14 2007 +0100
+++ b/src/devices/wifi/amrr-mac-stations.cc	Fri Dec 14 15:43:52 2007 +0100
@@ -116,7 +116,8 @@
 bool
 AmrrMacStation::IsMaxRate (void) const
 {
-  return (m_txrate + 1 < GetNSupportedModes ());
+  NS_ASSERT (m_txrate + 1 <= GetNSupportedModes ());
+  return (m_txrate + 1 == GetNSupportedModes ());
 }
 bool
 AmrrMacStation::IsSuccess (void) const
@@ -160,12 +161,15 @@
       return;
     }
   m_nextModeUpdate = Simulator::Now () + m_stations->m_updatePeriod;
+  NS_LOG_DEBUG ("Update");
 
   bool needChange = false;
 
   if (IsSuccess () && IsEnough ()) 
     {
       m_success++;
+      NS_LOG_DEBUG ("success="<<m_success<<" successThreshold="<<m_successThreshold<<
+                    " rate="<<m_txrate<<" n-supported-rates="<<GetNSupportedModes ());
       if (m_success >= m_successThreshold &&
           !IsMaxRate ()) 
         {
@@ -205,6 +209,7 @@
     }
   if (IsEnough () || needChange) 
     {
+      NS_LOG_DEBUG ("Reset");
       ResetCnt ();
     }
 }