User Manual, Developers Guide and API Documentation

FrameSynchronization.hpp

Go to the documentation of this file.
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_CONVERGENCE_FRAMESYNCHRONIZATION_HPP
00030 #define WIFIMAC_CONVERGENCE_FRAMESYNCHRONIZATION_HPP
00031 
00032 #include <WIFIMAC/lowerMAC/Manager.hpp>
00033 #include <WIFIMAC/convergence/IRxStartEnd.hpp>
00034 #include <WIFIMAC/management/SINRInformationBase.hpp>
00035 
00036 #include <WNS/ldk/fu/Plain.hpp>
00037 #include <WNS/ldk/Dropper.hpp>
00038 #include <WNS/Birthmark.hpp>
00039 #include <WNS/events/CanTimeout.hpp>
00040 #include <WNS/PowerRatio.hpp>
00041 
00042 #include <WNS/ldk/probe/Probe.hpp>
00043 #include <WNS/probe/bus/ContextCollector.hpp>
00044 
00045 namespace wifimac { namespace convergence {
00046 
00047     class FrameSynchronizationCommand:
00048         public wns::ldk::EmptyCommand
00049     {
00050     };
00051 
00052     enum SyncStateType {
00053         Idle,
00054         Synchronized,
00055         Garbled,
00056         waitForFinalDelivery
00057     };
00058 
00087     class FrameSynchronization:
00088         public wns::ldk::fu::Plain<FrameSynchronization, FrameSynchronizationCommand>,
00089         public wns::events::CanTimeout,
00090         public RxStartEndNotification,
00091         public wns::ldk::probe::Probe
00092     {
00093     public:
00094         FrameSynchronization(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config);
00095         virtual ~FrameSynchronization();
00096     private:
00097         // CompoundHandlerInterface
00098         void doSendData(const wns::ldk::CompoundPtr& compound);
00099         void doOnData(const wns::ldk::CompoundPtr& compound);
00100         void onFUNCreated();
00101         bool doIsAccepting(const wns::ldk::CompoundPtr& compound) const;
00102         void doWakeup();
00103 
00104         // CanTimeout Interface
00105         void onTimeout();
00106 
00107         void processPreamble(const wns::ldk::CompoundPtr& compound);
00108         void processPSDU(const wns::ldk::CompoundPtr& compound);
00109         void failedSyncToNewPreamble(wns::simulator::Time fExDur);
00110         void syncToNewPreamble(const wns::simulator::Time fExDur, const wns::service::dll::UnicastAddress transmitter);
00111 
00112         void traceIncoming(wns::ldk::CompoundPtr compound);
00113 
00114         wns::logger::Logger logger;
00115         SyncStateType curState;
00116         wns::service::dll::UnicastAddress synchronizedToAddress;
00117         const wns::Ratio slcCapture;
00118         const wns::Ratio slgCapture;
00119         const wns::Ratio idleCapture;
00120         const wns::Ratio detectionThreshold;
00121         const bool signalRxErrorAlthoughNotSynchronized;
00122         wns::simulator::Time lastFrameEnd;
00123 
00124         const std::string managerName;
00125         const std::string crcCommandName;
00126         const std::string phyUserCommandName;
00127         const std::string errorModellingCommandName;
00128         const std::string txDurationProviderCommandName;
00129         const std::string sinrMIBServiceName;
00130 
00131         int numSpatialStreamsLastPreambleFragment;
00132 
00136         wns::probe::bus::ContextCollectorPtr successRateProbe;
00138         wns::probe::bus::ContextCollectorPtr sinrProbe;
00139 
00141         wns::probe::bus::ContextCollectorPtr perProbe;
00142 
00144         wns::probe::bus::ContextCollectorPtr jsonTracing;
00145 
00146         wifimac::management::SINRInformationBase* sinrMIB;
00147 
00148         struct Friends
00149         {
00150             wifimac::lowerMAC::Manager* manager;
00151         } friends;
00152     };
00153 } // end namespace convergence
00154 } // end namespace wifimac
00155 
00156 #endif // ifndef WIFIMAC_CONVERGENCE_FRAMESYNCHRONIZATION_HPP

Generated on Sun May 27 03:32:06 2012 for openWNS by  doxygen 1.5.5