![]() |
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_DRAFTN_PREAMBLEGENERATOR_HPP 00030 #define WIFIMAC_DRAFTN_PREAMBLEGENERATOR_HPP 00031 00032 #include <WIFIMAC/lowerMAC/Manager.hpp> 00033 #include <WIFIMAC/convergence/PhyUser.hpp> 00034 #include <WIFIMAC/management/ProtocolCalculator.hpp> 00035 #include <WIFIMAC/draftn/DeAggregation.hpp> 00036 #include <WIFIMAC/draftn/SINRwithMIMOInformationBase.hpp> 00037 00038 #include <WNS/ldk/fu/Plain.hpp> 00039 #include <WNS/ldk/Delayed.hpp> 00040 00041 namespace wifimac { namespace draftn { 00042 00043 class LongTrainingFieldGeneratorCommand: 00044 public wns::ldk::Command 00045 { 00046 public: 00047 struct {} local; 00048 struct { 00049 // id of the upcoming frame to which the ht-ltf belongs to 00050 wns::Birthmark frameId; 00051 } peer; 00052 struct {} magic; 00053 00054 wns::Birthmark getFrameId() const 00055 { 00056 return(this->peer.frameId); 00057 } 00058 }; 00059 00063 class LongTrainingFieldGenerator: 00064 public wns::ldk::fu::Plain<LongTrainingFieldGenerator, LongTrainingFieldGeneratorCommand>, 00065 public wns::ldk::Delayed<LongTrainingFieldGenerator> 00066 { 00067 public: 00068 LongTrainingFieldGenerator(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config); 00069 00070 virtual 00071 ~LongTrainingFieldGenerator(); 00072 00073 private: 00075 void processIncoming(const wns::ldk::CompoundPtr& compound); 00076 void processOutgoing(const wns::ldk::CompoundPtr& compound); 00077 bool hasCapacity() const; 00078 const wns::ldk::CompoundPtr hasSomethingToSend() const; 00079 wns::ldk::CompoundPtr getSomethingToSend(); 00080 00081 void onFUNCreated(); 00082 00086 void calculateSizes(const wns::ldk::CommandPool* commandPool, Bit& commandPoolSize, Bit& dataSize) const; 00087 00088 const std::string phyUserName; 00089 const std::string protocolCalculatorName; 00090 const std::string managerName; 00091 const std::string txDurationSetterName; 00092 const std::string sinrMIBServiceName; 00093 00094 const wns::simulator::Time ltfDuration; 00095 const bool reducePreambleByDuration; 00096 00097 int numLTFsToSend; 00098 00099 wns::logger::Logger logger; 00100 00101 wns::ldk::CompoundPtr pendingCompound; 00102 wifimac::management::ProtocolCalculator* protocolCalculator; 00103 00104 struct Friends 00105 { 00106 wifimac::convergence::PhyUser* phyUser; 00107 wifimac::lowerMAC::Manager* manager; 00108 wifimac::draftn::DeAggregation* txDuration; 00109 } friends; 00110 00111 wifimac::draftn::SINRwithMIMOInformationBase* sinrMIB; 00112 }; 00113 } // mac 00114 } // wifimac 00115 00116 #endif // WIFIMAC_DRAFTN_PREAMBLEGENERATOR_HPP
1.5.5