User Manual, Developers Guide and API Documentation

ARQ.hpp

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 #ifndef WIMEMAC_ARQ_ARQ_H
00030 #define WIMEMAC_ARQ_ARQ_H
00031 #include <WNS/ldk/fu/Plain.hpp>
00032 #include <WNS/logger/Logger.hpp>
00033 #include <WNS/service/dll/Address.hpp>
00034 #include <WIMEMAC/arq/ARQCommand.hpp>
00035 #include <WNS/StaticFactory.hpp>
00036 #include <WNS/ldk/CommandTypeSpecifier.hpp>
00037 #include <WIMEMAC/lowerMAC/IManagerServices.hpp>
00038 #include <DLL/UpperConvergence.hpp>
00039 
00040 #include <WIMEMAC/drp/DRPScheduler.hpp>
00041 #include <boost/bind.hpp>
00042 #include <WNS/events/scheduler/Callable.hpp>
00043 
00044 namespace wimemac { namespace arq {
00045 
00046 
00047 
00048         /*
00049         * @brief ARQ for WiMedia
00050     */
00051 
00052     class ARQ:
00053         public wns::ldk::fu::Plain<ARQ, ARQCommand>
00054     {
00055         public:
00056 
00057             ARQ(wns::ldk::fun::FUN* _fun, const wns::pyconfig::View& config_ );
00058             void doOnData(const wns::ldk::CompoundPtr& );
00059             void doSendData(const wns::ldk::CompoundPtr& );
00060             bool doIsAccepting(const wns::ldk::CompoundPtr& compound) const;
00061             void doWakeup();
00062 
00063 
00064             bool
00065             hasCommandOf(const wns::ldk::CompoundPtr& compound) const;
00066 
00067             void
00068             CreateACK(const wns::ldk::CompoundPtr& compound);
00069 
00070 
00071 
00072         protected:
00073 
00074             virtual void onFUNCreated();
00075 
00076         private:
00077 
00078             wns::ldk::CompoundPtr currentBeacon;
00079             wns::logger::Logger logger;
00080 
00081             wns::service::dll::UnicastAddress ownaddress;
00082             wns::simulator::Time SIFS;
00083             wns::simulator::Time AckDuration;
00084 
00085             wns::ldk::fun::FUN* fun;
00086 
00087 
00088             wns::events::scheduler::Interface* scheduler;
00089             wns::events::scheduler::Callable call;
00090 
00091             int retrans;
00092             const std::string managerName;
00093 
00094         struct Friends
00095         {
00096             dll::UpperConvergence* Upper;
00097             wns::ldk::CommandReaderInterface* keyReader;
00098             wimemac::lowerMAC::IManagerServices* manager;
00099         } friends;
00100 
00101         void calculateSizes(const wns::ldk::CommandPool* commandPool, Bit& commandPoolSize, Bit& dataSize) const;
00102         void TransmitAck(const wns::ldk::CompoundPtr& compound);
00103 
00104     };
00105 }
00106 }
00107 #endif

Generated on Sun May 27 03:31:40 2012 for openWNS by  doxygen 1.5.5