![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /******************************************************************************* 00002 * This file is part of openWNS (open Wireless Network Simulator) 00003 * _____________________________________________________________________________ 00004 * 00005 * Copyright (C) 2004-2007 00006 * Chair of Communication Networks (ComNets) 00007 * Kopernikusstr. 5, D-52074 Aachen, Germany 00008 * phone: ++49-241-80-27910, 00009 * fax: ++49-241-80-22242 00010 * email: info@openwns.org 00011 * www: http://www.openwns.org 00012 * _____________________________________________________________________________ 00013 * 00014 * openWNS is free software; you can redistribute it and/or modify it under the 00015 * terms of the GNU Lesser General Public License version 2 as published by the 00016 * Free Software Foundation; 00017 * 00018 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY 00019 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00020 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00021 * details. 00022 * 00023 * You should have received a copy of the GNU Lesser General Public License 00024 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00025 * 00026 ******************************************************************************/ 00027 00028 #ifndef LTE_LTEBCHUNIT_HPP 00029 #define LTE_LTEBCHUNIT_HPP 00030 00031 #include <LTE/controlplane/bch/BCHUnitInterface.hpp> 00032 #include <LTE/controlplane/bch/BCHService.hpp> 00033 #include <LTE/helper/HasModeName.hpp> 00034 #include <LTE/macr/PhyCommand.hpp> 00035 #include <LTE/macg/MACg.hpp> 00036 00037 #include <WNS/ldk/CommandTypeSpecifier.hpp> 00038 #include <WNS/ldk/HasReceptor.hpp> 00039 #include <WNS/ldk/HasConnector.hpp> 00040 #include <WNS/ldk/HasDeliverer.hpp> 00041 #include <WNS/ldk/Compound.hpp> 00042 #include <WNS/ldk/Command.hpp> 00043 #include <WNS/ldk/multiplexer/OpcodeProvider.hpp> 00044 00045 #include <WNS/events/PeriodicTimeout.hpp> 00046 #include <WNS/pyconfig/View.hpp> 00047 00048 #include <DLL/Layer2.hpp> 00049 #include <WNS/ldk/ControlServiceInterface.hpp> 00050 #include <WNS/probe/bus/ContextCollector.hpp> 00051 #include <WNS/service/phy/phymode/PhyModeInterface.hpp> 00052 00053 #include <list> 00054 00055 namespace dll { namespace services {namespace control { 00056 class Association; 00057 00058 }}} 00059 00060 00061 namespace lte { 00062 namespace timing { 00063 class ResourceScheduler; 00064 } 00065 namespace controlplane { 00066 namespace associationHandler { 00067 class AssociationHandlerUT; 00068 } 00069 00070 namespace bch { 00071 00073 class LTEBCHCommand 00074 : public wns::ldk::Command 00075 { 00076 public: 00077 LTEBCHCommand() 00078 { 00079 peer.acknowledgement = false; 00080 magic.source = wns::service::dll::UnicastAddress(); 00081 }; 00082 00083 struct { 00084 } local; 00085 struct { 00086 bool acknowledgement; 00087 std::list<wns::ldk::CompoundPtr> ackedUTs; 00088 } peer; 00089 struct { 00090 wns::service::dll::UnicastAddress source; 00091 } magic; 00092 }; 00093 00104 class LTEBCHUnit : 00105 public virtual wns::ldk::FunctionalUnit, 00106 public wns::ldk::CommandTypeSpecifier<LTEBCHCommand>, 00107 public wns::ldk::HasReceptor<>, 00108 public wns::ldk::HasConnector<>, 00109 public wns::ldk::HasDeliverer<>, 00110 public lte::helper::HasModeName 00111 { 00112 public: 00113 LTEBCHUnit(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config); 00114 virtual 00115 ~LTEBCHUnit(); 00116 00117 virtual void 00118 onFUNCreated(); 00119 00120 // 00121 // PDU size information 00122 // 00123 virtual void 00124 calculateSizes(const wns::ldk::CommandPool* commandPool, Bit& _pciSize, Bit& _pduSize) const; 00125 00126 protected: 00127 wns::logger::Logger logger; 00128 dll::ILayer2* layer2; 00129 struct { 00130 lte::timing::ResourceScheduler* scheduler; 00131 lte::macg::MACg* macg; 00132 } friends; 00133 00134 wns::ldk::CommandReaderInterface* rlcReader; 00135 00136 private: 00137 int commandSize; 00138 }; 00139 00140 class LTEBCHUnitRAP : 00141 public LTEBCHUnit, 00142 public wns::Cloneable<LTEBCHUnitRAP>, 00143 public IBCHTimingTx 00144 { 00145 public: 00146 LTEBCHUnitRAP(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config); 00147 00148 virtual 00149 ~LTEBCHUnitRAP(); 00150 00151 virtual void 00152 onFUNCreated(); 00153 00154 // 00155 // compound handler interface 00156 // 00157 virtual void 00158 doSendData(const wns::ldk::CompoundPtr& /* compound */); 00159 00160 virtual void 00161 doOnData(const wns::ldk::CompoundPtr& /* compound */); 00162 00163 // 00164 // For external Triggering 00165 // 00167 void sendBCH(simTimeType duration); 00168 00169 private: 00170 virtual bool 00171 doIsAccepting(const wns::ldk::CompoundPtr& /* compound */) const; 00172 00173 virtual void 00174 doWakeup(); 00175 00177 wns::Power txPower; 00178 00179 bool accepting; 00180 wns::ldk::CompoundPtr compound; 00181 std::string rlcName; 00182 std::string macgName; 00183 std::string flowManagerName; 00184 }; 00185 00186 class LTEBCHUnitUT : 00187 public LTEBCHUnit, 00188 public wns::Cloneable<LTEBCHUnitUT> 00189 { 00190 public: 00191 LTEBCHUnitUT(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config); 00192 00193 virtual 00194 ~LTEBCHUnitUT(); 00195 00196 // 00197 // compound handler interface 00198 // 00199 virtual void 00200 doSendData(const wns::ldk::CompoundPtr& /* compound */); 00201 00202 virtual void 00203 doOnData(const wns::ldk::CompoundPtr& /* compound */); 00204 00205 virtual void onFUNCreated(); 00206 00207 private: 00208 virtual bool 00209 doIsAccepting(const wns::ldk::CompoundPtr& /* compound */) const; 00210 00211 virtual void 00212 doWakeup(); 00213 00214 lte::controlplane::bch::BCHService* bchService; 00215 dll::services::control::Association* associationService; 00216 00217 const wns::pyconfig::View config; 00218 00219 wns::probe::bus::ContextCollector* sinrProbe; 00220 wns::probe::bus::ContextCollector* rxpProbe; 00221 wns::probe::bus::ContextCollector* interfProbe; 00222 std::string schedulerName; 00223 }; 00224 00225 class NoBCH : 00226 virtual public wns::ldk::FunctionalUnit, 00227 public wns::ldk::CommandTypeSpecifier<>, 00228 public wns::ldk::HasReceptor<>, 00229 public wns::ldk::HasConnector<>, 00230 public wns::ldk::HasDeliverer<>, 00231 public wns::ldk::Forwarding<NoBCH>, 00232 public wns::Cloneable<NoBCH> 00233 { 00234 public: 00235 NoBCH(wns::ldk::fun::FUN* fun, const wns::pyconfig::View&) : 00236 wns::ldk::CommandTypeSpecifier<>(fun), 00237 wns::ldk::HasReceptor<>(), 00238 wns::ldk::HasConnector<>(), 00239 wns::ldk::HasDeliverer<>(), 00240 wns::ldk::Forwarding<NoBCH>(), 00241 wns::Cloneable<NoBCH>() 00242 {}; 00243 }; 00244 00245 00246 }}} 00247 00248 #endif // NOT defined LTE_LTEBCHUNIT_HPP
1.5.5