![]() |
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_CONVERGENCE_PHYUSER_HPP 00030 #define WIMEMAC_CONVERGENCE_PHYUSER_HPP 00031 00032 #include <WIMEMAC/lowerMAC/Manager.hpp> 00033 #include <WIMEMAC/convergence/PhyUserCommand.hpp> 00034 #include <WIMEMAC/convergence/PhyModeProvider.hpp> 00035 #include <WIMEMAC/convergence/TxDurationSetter.hpp> 00036 #include <WIMEMAC/convergence/ITxStartEnd.hpp> 00037 00038 #include <WIMEMAC/convergence/IPhyServices.hpp> 00039 00040 #include <WNS/service/dll/Address.hpp> 00041 00042 #include <WNS/pyconfig/View.hpp> 00043 #include <WNS/logger/Logger.hpp> 00044 #include <WNS/events/CanTimeout.hpp> 00045 00046 #include <WNS/ldk/fu/Plain.hpp> 00047 #include <WNS/probe/bus/ContextCollector.hpp> 00048 00049 namespace wimemac { namespace lowerMAC { 00050 class Manager; 00051 }} 00052 00053 namespace wimemac { namespace convergence { 00054 00065 class PhyUser: 00066 public wns::ldk::fu::Plain<PhyUser, PhyUserCommand>, 00067 public wns::service::phy::ofdma::Handler, 00068 public wns::events::CanTimeout, 00069 public TxStartEndNotification, 00070 public wimemac::convergence::IPhyServices 00071 { 00072 00073 public: 00074 PhyUser(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config); 00075 virtual ~PhyUser(); 00076 00078 void onData(wns::osi::PDUPtr, wns::service::phy::power::PowerMeasurementPtr); 00079 00081 void setNotificationService(wns::service::Service* phy); 00082 wns::service::phy::ofdma::Notification* getNotificationService() const; 00083 void setDataTransmissionService(wns::service::Service* phy); 00084 wns::service::phy::ofdma::DataTransmission* getDataTransmissionService() const; 00085 00087 PhyModeProvider* getPhyModeProvider(); 00088 00090 void setFrequency(double frequency); 00091 00093 wns::Power 00094 getRxPower(const wns::ldk::CommandPool* commandPool); 00095 00096 wns::Power 00097 getInterference(const wns::ldk::CommandPool* commandPool); 00098 00099 private: 00100 00101 // CompoundHandlerInterface 00102 virtual void doSendData(const wns::ldk::CompoundPtr& sdu); 00103 virtual void doOnData(const wns::ldk::CompoundPtr& compound); 00104 virtual void onFUNCreated(); 00105 virtual bool doIsAccepting(const wns::ldk::CompoundPtr& compound) const; 00106 virtual void doWakeup(); 00107 00108 // onTimeout realisation 00109 virtual void onTimeout(); 00110 00111 wns::pyconfig::View config; 00112 wns::logger::Logger logger; 00113 00114 wns::service::phy::ofdma::Tune tune; 00115 wns::service::phy::ofdma::DataTransmission* dataTransmission; 00116 wns::service::phy::ofdma::Notification* notificationService; 00117 PhyModeProvider phyModes; 00118 00119 const std::string managerName; 00120 00122 wns::probe::bus::ContextCollectorPtr rxProbe_; 00123 wns::probe::bus::ContextCollectorPtr interferenceProbe_; 00124 wns::probe::bus::ContextCollectorPtr SINRProbe_; 00125 wns::probe::bus::ContextCollectorPtr SINRweightedProbe_; 00126 00127 const std::string txDurationCommandName; 00128 const wns::simulator::Time txrxTurnaroundDelay; 00129 00130 struct Friends 00131 { 00132 wimemac::lowerMAC::Manager* manager; 00133 } friends; 00134 00135 enum PhyUserStatus 00136 { 00137 transmitting, 00138 receiving, 00139 txrxTurnaround 00140 } phyUserStatus; 00141 00142 wns::ldk::CompoundPtr currentTxCompound; 00143 }; 00144 00145 } // namespace convergence 00146 } // namespace wimemac 00147 00148 #endif // NOT defined WIMEMAC_CONVERGENCE_PHYUSER_HPP 00149 00150
1.5.5