Bug 1907- Add IsMcsSupported()
authorSébastien Deronne <sebastien.deronne@gmail.com>
Fri, 06 Jun 2014 10:15:54 -0700
changeset 10801 02d564a4c823
parent 10800 85f484cffccd
child 10802 779b67cc3a46
Bug 1907- Add IsMcsSupported()
src/wifi/model/yans-wifi-phy.cc
src/wifi/model/yans-wifi-phy.h
--- a/src/wifi/model/yans-wifi-phy.cc	Fri Jun 06 10:11:35 2014 -0700
+++ b/src/wifi/model/yans-wifi-phy.cc	Fri Jun 06 10:15:54 2014 -0700
@@ -508,7 +508,7 @@
     case YansWifiPhy::IDLE:
       if (rxPowerW > m_edThresholdW)
         {
-          if (IsModeSupported (txMode))
+          if (IsModeSupported (txMode) || IsMcsSupported(txMode))
             {
               NS_LOG_DEBUG ("sync to signal (power=" << rxPowerW << "W)");
               // sync to signal
@@ -600,6 +600,18 @@
     }
   return false;
 }
+bool
+YansWifiPhy::IsMcsSupported (WifiMode mode)
+{
+  for (uint32_t i = 0; i < GetNMcs (); i++)
+    {
+      if (mode == McsToWifiMode(GetMcs (i)))
+        {
+          return true;
+        }
+    }
+  return false;
+}
 uint32_t
 YansWifiPhy::GetNTxPower (void) const
 {
--- a/src/wifi/model/yans-wifi-phy.h	Fri Jun 06 10:11:35 2014 -0700
+++ b/src/wifi/model/yans-wifi-phy.h	Fri Jun 06 10:15:54 2014 -0700
@@ -261,6 +261,7 @@
   virtual uint32_t GetNModes (void) const;
   virtual WifiMode GetMode (uint32_t mode) const;
   virtual bool IsModeSupported (WifiMode mode) const;
+  virtual bool IsMcsSupported (WifiMode mode);
   virtual double CalculateSnr (WifiMode txMode, double ber) const;
   virtual Ptr<WifiChannel> GetChannel (void) const;