Mac80211MultiChannel.cc

00001 //
00002 // This program is free software: you can redistribute it and/or modify
00003 // it under the terms of the GNU Lesser General Public License as published by
00004 // the Free Software Foundation, either version 3 of the License, or
00005 // (at your option) any later version.
00006 // 
00007 // This program is distributed in the hope that it will be useful,
00008 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 // GNU Lesser General Public License for more details.
00011 // 
00012 // You should have received a copy of the GNU Lesser General Public License
00013 // along with this program.  If not, see http://www.gnu.org/licenses/.
00014 // 
00015 
00016 #include "Mac80211MultiChannel.h"
00017 #include "BasePhyLayer.h"
00018 
00019 Define_Module(Mac80211MultiChannel);
00020 
00021 
00022 
00023 void Mac80211MultiChannel::initialize(int stage)
00024 {
00025     Mac80211::initialize(stage);
00026 
00027     if(stage == 0) {
00028     }
00029     else if(stage == 1) {
00030     }
00031 }
00032 
00033 void Mac80211MultiChannel::switchChannel(int channel) {
00034   if(!(1 <= channel && channel <= 14)) {
00035     opp_error("Invalid channel %d. Mac tried to switch to a channel not"
00036           " supported by this protocoll.", channel);
00037   }
00038   phy->setCurrentRadioChannel(channel);
00039 
00040   centerFreq = CENTER_FREQUENCIES[channel];
00041 }
00042 
00043 int Mac80211MultiChannel::getChannel() {
00044   return phy->getCurrentRadioChannel();
00045 }