[Ns-developers] problem with channel switching
Venkat Ch
venkatch at gmail.com
Mon Feb 20 22:05:35 PST 2006
Hello All,
I am modifying ns-2 code to support dynamic channel switching in 802.11.
I am doing the following.
I am trying to switch the channel at fixed at intervals ...
For eg
time 0(Working on channel 1)-------------------1(Switch to channel
2)----1.5(Switch back to channel 1)----------------2 (Switch to
channel2) ----2.5---
And so son ...
So to do that what i did was as follows.
I created a new channel object and called the following function
setNewChnl in mac/mac-802_11.cc
void Mac802_11::setNewChnl(WirelessChannel* chan)
{
Phy *down = (Phy * ) downtarget_;
cur_chan = (WirelessChannel *) down->channel();
down->setchnl(chan);
}
In the above function the index of the cur_chan is 0 and the index of chan is 1.
But when I try to print the index value of the channel in sendDown
function I could see the a value of 0 only ( I should get 1).
The statement added by me in sendDown( in mac/wireless-phy.cc) function is ...
printf("\n index of the channel is %d: sendDown: wireless-phy.cc
",channel_->index());
Can you please tell me why the channel is not getting changed, even
though I explicity created a new channel object and assigned it to
channel_ (present in the class Phy)?
Thanks & Regards
Venkat
--
Only a life lived for others is a life worth of living
More information about the Ns-developers
mailing list