Adds multi channel support to Mac80211. More...
#include <Mac80211MultiChannel.h>
Inherits Mac80211.
Public Member Functions | |
void | switchChannel (int channel) |
Tells the MAC layer to switch to the passed channel. | |
int | getChannel () |
Returns the currently used channel. | |
Protected Member Functions | |
virtual void | initialize (int stage) |
Initialization of the module and some variables. |
Adds multi channel support to Mac80211.
Multi channel support enables the MAC layer to change the channel for transmission and reception during simulation.
Definition at line 30 of file Mac80211MultiChannel.h.
int Mac80211MultiChannel::getChannel | ( | ) |
Returns the currently used channel.
Definition at line 43 of file Mac80211MultiChannel.cc.
References MacToPhyInterface::getCurrentRadioChannel(), and BaseMacLayer::phy.
{ return phy->getCurrentRadioChannel(); }
void Mac80211MultiChannel::initialize | ( | int | stage | ) | [protected, virtual] |
Initialization of the module and some variables.
First we have to initialize the module from which we derived ours, in this case BaseLayer.
Reimplemented from Mac80211.
Definition at line 23 of file Mac80211MultiChannel.cc.
{ Mac80211::initialize(stage); if(stage == 0) { } else if(stage == 1) { } }
void Mac80211MultiChannel::switchChannel | ( | int | channel | ) |
Tells the MAC layer to switch to the passed channel.
This method can be used by upper layers to change the channel.
channel | The channel to switch to, must be 1<=channel<=14. |
Definition at line 33 of file Mac80211MultiChannel.cc.
References Mac80211::centerFreq, BaseMacLayer::phy, and MacToPhyInterface::setCurrentRadioChannel().
{ if(!(1 <= channel && channel <= 14)) { opp_error("Invalid channel %d. Mac tried to switch to a channel not" " supported by this protocoll.", channel); } phy->setCurrentRadioChannel(channel); centerFreq = CENTER_FREQUENCIES[channel]; }