User Manual, Developers Guide and API Documentation

OFDMAAccessFunc.cpp

Go to the documentation of this file.
00001 /******************************************************************************
00002  * WiMeMac                                                                    *
00003  * This file is part of openWNS (open Wireless Network Simulator)
00004  * _____________________________________________________________________________
00005  *
00006  * Copyright (C) 2004-2011
00007  * Chair of Communication Networks (ComNets)
00008  * Kopernikusstr. 5, D-52074 Aachen, Germany
00009  * phone: ++49-241-80-27910,
00010  * fax: ++49-241-80-22242
00011  * email: info@openwns.org
00012  * www: http://www.openwns.org
00013  * _____________________________________________________________________________
00014  *
00015  * openWNS is free software; you can redistribute it and/or modify it under the
00016  * terms of the GNU Lesser General Public License version 2 as published by the
00017  * Free Software Foundation;
00018  *
00019  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00020  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00021  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00022  * details.
00023  *
00024  * You should have received a copy of the GNU Lesser General Public License
00025  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00026  *
00027  ******************************************************************************/
00028 
00029 #include <WIMEMAC/convergence/OFDMAAccessFunc.hpp>
00030 #include <WIMEMAC/convergence/IPhyServices.hpp>
00031 
00032 
00033 
00034 using namespace wimemac::convergence;
00035 
00036 void StopTransmission::operator()()
00037 {
00038     phyUser->getDataTransmissionService()->stopTransmission( compound, subBand );
00039 }
00040 
00041 void StartTransmission::operator()()
00042 {
00043     wns::Power defaultTxPower = phyUser->getDataTransmissionService()->getMaxPowerPerSubband();
00044     phyUser->getDataTransmissionService()->startUnicast( compound, dstStation, subBand, defaultTxPower, 1);
00045 }
00046 
00047 void StartBroadcastTransmission::operator()()
00048 {
00049     wns::Power defaultTxPower = phyUser->getDataTransmissionService()->getMaxPowerPerSubband();
00050     phyUser->getDataTransmissionService()->startBroadcast( compound, subBand, defaultTxPower, 1);
00051 }
00052 
00053 void BroadcastOFDMAAccessFunc::operator()(IPhyServices* phyUser_, const wns::ldk::CompoundPtr& compound_ )
00054 {
00055     assure(transmissionStart < transmissionStop, "transmissionStart is larger than transmissionStop");
00056 
00057     StartBroadcastTransmission start ( phyUser_, compound_ );
00058     wns::simulator::getEventScheduler()->schedule( start, transmissionStart );
00059 
00060     StopTransmission stop ( phyUser_, compound_ );
00061     wns::simulator::getEventScheduler()->schedule( stop, transmissionStop );
00062 }
00063 
00064 
00065 void OmniUnicastOFDMAAccessFunc::operator()(IPhyServices* phyUser_, const wns::ldk::CompoundPtr& compound_ )
00066 {
00067     StartTransmission start ( phyUser_, compound_, destination );
00068     wns::simulator::getEventScheduler()->schedule( start,  transmissionStart );
00069 
00070     StopTransmission stop ( phyUser_, compound_ );
00071     wns::simulator::getEventScheduler()->schedule( stop, transmissionStop );
00072 }
00073 
00074 

Generated on Fri May 25 03:32:15 2012 for openWNS by  doxygen 1.5.5