1.1 --- a/src/devices/wifi/yans-wifi-phy.cc Fri Nov 13 14:51:59 2009 +0300
1.2 +++ b/src/devices/wifi/yans-wifi-phy.cc Fri Nov 13 18:20:50 2009 +0300
1.3 @@ -317,7 +317,15 @@
1.4 void
1.5 YansWifiPhy::SetChannelNumber (uint16_t nch)
1.6 {
1.7 - NS_ASSERT(!IsStateSwitching());
1.8 + if (Simulator::Now () == Seconds (0))
1.9 + {
1.10 + // this is not channel switch, this is initialization
1.11 + NS_LOG_DEBUG("start at channel " << nch);
1.12 + m_channelNumber = nch;
1.13 + return;
1.14 + }
1.15 +
1.16 + NS_ASSERT (!IsStateSwitching());
1.17 switch (m_state->GetState ()) {
1.18 case YansWifiPhy::SYNC:
1.19 NS_LOG_DEBUG ("drop packet because of channel switching while reception");