bugfix in YansWifiPhy::SetChannelNumber()
authorPavel Boyko <boyko@iitp.ru>
Fri, 13 Nov 2009 18:20:50 +0300
changeset 5512 28bccc88b34c
parent 5511 d77201fa5ee2
child 5513 2ef4be6c501a
bugfix in YansWifiPhy::SetChannelNumber()
src/devices/wifi/yans-wifi-phy.cc
--- a/src/devices/wifi/yans-wifi-phy.cc	Fri Nov 13 14:51:59 2009 +0300
+++ b/src/devices/wifi/yans-wifi-phy.cc	Fri Nov 13 18:20:50 2009 +0300
@@ -317,7 +317,15 @@
 void 
 YansWifiPhy::SetChannelNumber (uint16_t nch)
 {
-  NS_ASSERT(!IsStateSwitching()); 
+  if (Simulator::Now () == Seconds (0))
+    {
+      // this is not channel switch, this is initialization 
+      NS_LOG_DEBUG("start at channel " << nch);
+      m_channelNumber = nch;
+      return;
+    }
+
+  NS_ASSERT (!IsStateSwitching()); 
   switch (m_state->GetState ()) {
   case YansWifiPhy::SYNC:
     NS_LOG_DEBUG ("drop packet because of channel switching while reception");