Bugzilla – Bug 679
channel switching causes error
Last modified: 2010-01-13 13:26:05 EDT
You need to log in before you can comment on or make changes to this bug.
I am using the latest dev version of ns-3. I added the following lines into third.cc to see if I can figure out how to use ChannelNumber: insert at line 86 (above the phy.SetChannel (channel.Create ()); line: YansWifiPhy testCN; testCN.SetChannelNumber (1000); When I do this I get an error: "assert failed. file=../src/devices/wifi/wifi-phy-state-helper.cc, line=379, cond="IsStateSwitching()" line 379 is NS_ASSERT(IsStateSwitching()); I checked in yans-wifi-phy.cc for the same assert, and on line 311 it is NS_ASSERT(!IsStateSwitching()); When I added the ! to line 379 of wifi-phy-state-helper.cc so that it would be the same as line 311 of yans-wifi-phy.cc, the error went away. I'm not sure if I did something wrong with my attempt at using ChannelNumber, or if the ! got lost.
Sorry, can't reproduce on current ns-3-dev. Patch according to your description attached below. Please check that bug still exist. (In reply to comment #0) > I am using the latest dev version of ns-3. > > I added the following lines into third.cc to see if I can figure out > how to use ChannelNumber: > insert at line 86 (above the phy.SetChannel (channel.Create ()); line: > YansWifiPhy testCN; > testCN.SetChannelNumber (1000); > > > When I do this I get an error: > "assert failed. file=../src/devices/wifi/wifi-phy-state-helper.cc, > line=379, cond="IsStateSwitching()" > line 379 is NS_ASSERT(IsStateSwitching()); > > > I checked in yans-wifi-phy.cc for the same assert, and on line 311 it > is NS_ASSERT(!IsStateSwitching()); > > > When I added the ! to line 379 of wifi-phy-state-helper.cc so that it > would be the same as line 311 of yans-wifi-phy.cc, the error went > away. > > > I'm not sure if I did something wrong with my attempt at using > ChannelNumber, or if the ! got lost.
Created an attachment (id=716) [details] Can't reproduce
I think this may have been a case of trying to change channels when the sender was sending. As far as I can tell, that will still cause an assert error in the code. I'm not sure if there is a way to allow channel switching to be scheduled even when a node is sending, even if you let the node finish sending and then switch the channel. Michael