![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /****************************************************************************** 00002 * WiFiMac * 00003 * This file is part of openWNS (open Wireless Network Simulator) 00004 * _____________________________________________________________________________ 00005 * 00006 * Copyright (C) 2004-2007 00007 * Chair of Communication Networks (ComNets) 00008 * Kopernikusstr. 16, 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 WIFIMAC_LOWERMAC_TIMING_DCF_HPP 00030 #define WIFIMAC_LOWERMAC_TIMING_DCF_HPP 00031 00032 #include <WIFIMAC/lowerMAC/timing/Backoff.hpp> 00033 #include <WIFIMAC/convergence/IChannelState.hpp> 00034 #include <WIFIMAC/convergence/IRxStartEnd.hpp> 00035 00036 #include <WNS/ldk/fu/Plain.hpp> 00037 #include <WNS/ldk/Command.hpp> 00038 00039 00040 namespace wifimac { namespace lowerMAC { namespace timing { 00041 00053 class DCF: 00054 public wns::ldk::fu::Plain<DCF, wns::ldk::EmptyCommand>, 00055 public virtual BackoffObserver 00056 { 00057 00058 public: 00059 00060 DCF(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config); 00061 00062 virtual 00063 ~DCF(); 00064 00066 void doSendData(const wns::ldk::CompoundPtr& compound); 00067 void doOnData(const wns::ldk::CompoundPtr& compound); 00068 bool doIsAccepting(const wns::ldk::CompoundPtr& compound) const; 00069 void doWakeup(); 00070 00071 virtual void onFUNCreated(); 00072 00074 void 00075 registerEOBObserver(BackoffObserver* observer) {backoff.registerEOBObserver(observer);} 00076 00079 wns::simulator::Time 00080 backoffFinishedAt() {return backoff.finishedAt();} 00081 00082 private: 00083 00085 virtual void backoffExpired(); 00086 00087 const std::string csName; 00088 const std::string rxStartEndName; 00089 const std::string arqCommandName; 00090 const bool backoffDisabled; 00091 00093 mutable Backoff backoff; 00094 00096 mutable bool sendNow; 00097 00098 wns::logger::Logger logger; 00099 }; 00100 } // timing 00101 } // lowerMAC 00102 } // wifimac 00103 00104 #endif // WIFIMAC_LOWERMAC_TIMING_DCF_HPP
1.5.5