![]() |
User Manual, Developers Guide and API Documentation |
![]() |
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_LOWERMAC_TXOP_HPP 00030 #define WIMEMAC_LOWERMAC_TXOP_HPP 00031 00032 #include <WIMEMAC/convergence/PhyUser.hpp> 00033 #include <WIMEMAC/lowerMAC/IManagerServices.hpp> 00034 #include <WIMEMAC/lowerMAC/ITXOPWindow.hpp> 00035 #include <WIMEMAC/lowerMAC/ITXOPObserver.hpp> 00036 #include <WIMEMAC/management/ProtocolCalculator.hpp> 00037 00038 #include <WNS/ldk/fu/Plain.hpp> 00039 #include <WNS/ldk/Processor.hpp> 00040 #include <WNS/ldk/Delayed.hpp> 00041 #include <WNS/ldk/probe/Probe.hpp> 00042 00043 #include <WNS/events/CanTimeout.hpp> 00044 #include <WNS/probe/bus/ContextCollector.hpp> 00045 00046 #include <WNS/Observer.hpp> 00047 00048 namespace wimemac { namespace lowerMAC { 00062 class TXOP: 00063 public wns::ldk::fu::Plain<TXOP, wns::ldk::EmptyCommand>, 00064 public wns::ldk::Processor<TXOP>, 00065 public wns::ldk::probe::Probe 00066 { 00067 public: 00068 00069 TXOP(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config); 00070 00071 virtual 00072 ~TXOP(); 00073 00074 // observer TxStartEnd 00075 void 00076 onTxStart(const wns::ldk::CompoundPtr& compound); 00077 void 00078 onTxEnd(const wns::ldk::CompoundPtr& compound); 00079 00082 void 00083 registerObserver(wimemac::lowerMAC::ITXOPObserver *observer) {observers.push_back(observer);} 00084 00085 void closeTXOP(bool forwardCall = true); 00086 void setTXOPLimit(wns::simulator::Time limit); 00087 private: 00089 void processIncoming(const wns::ldk::CompoundPtr& compound); 00090 void processOutgoing(const wns::ldk::CompoundPtr& compound); 00091 00092 bool doIsAccepting(const wns::ldk::CompoundPtr& compound) const; 00093 00094 void onFUNCreated(); 00095 00098 const std::string managerName; 00099 const std::string protocolCalculatorName; 00100 const std::string txopWindowName; 00101 //const std::string raName; 00102 00104 const wns::simulator::Time sifsDuration; 00105 const wns::simulator::Time maximumACKDuration; 00106 const bool singleReceiver; 00107 00109 bool maxOutTXOP; 00110 00111 wns::simulator::Time txopLimit; 00112 wns::simulator::Time remainingTXOPDuration; 00113 wns::simulator::Time lastFTDuration; 00114 wns::service::dll::UnicastAddress txopReceiver; 00115 00116 wns::logger::Logger logger; 00117 00118 std::vector<wimemac::lowerMAC::ITXOPObserver *> observers; 00119 wimemac::management::ProtocolCalculator* protocolCalculator; 00120 struct Friends 00121 { 00122 wimemac::lowerMAC::IManagerServices* manager; 00123 wimemac::lowerMAC::ITXOPWindow* txopWindow; 00124 //wimemac::lowerMAC::RateAdaptation* ra; 00125 } friends; 00126 00127 wns::probe::bus::ContextCollectorPtr TXOPDurationProbe; 00128 }; 00129 00130 } // lowerMAC 00131 } // wimemac 00132 00133 #endif // WIMEMAC_LOWERMAC_TXOP_HPP
1.5.5