DeciderUWBIREDSync.h

00001 /*
00002  * DeciderUWBIREDSync.h
00003  * Author: Jerome Rousselot <jerome.rousselot@csem.ch>
00004  * Copyright: (C) 2008-2010 Centre Suisse d'Electronique et Microtechnique (CSEM) SA
00005  *              Wireless Embedded Systems
00006  *              Jaquet-Droz 1, CH-2002 Neuchatel, Switzerland.
00007  */
00008 
00009 #ifndef UWBIREDSYNC_H_
00010 #define UWBIREDSYNC_H_
00011 
00012 #include <vector>
00013 #include <map>
00014 #include <math.h>
00015 
00016 #include "Mapping.h"
00017 #include "AirFrame_m.h"
00018 #include "MacPkt_m.h"
00019 #include "Decider.h"
00020 #include "DeciderUWBIRED.h"
00021 
00022 using namespace std;
00023 
00024 class PhyLayerUWBIR;
00025 
00053 class DeciderUWBIREDSync: public DeciderUWBIRED {
00054 public:
00055   DeciderUWBIREDSync(DeciderToPhyInterface* iface,
00056         PhyLayerUWBIR* _uwbiface,
00057         double _syncThreshold, bool _syncAlwaysSucceeds, bool _stats,
00058         bool _trace, double _tmin, bool alwaysFailOnDataInterference);
00059   ~DeciderUWBIREDSync();
00060 
00061 protected:
00062   virtual bool attemptSync(Signal* signal);
00063   bool evaluateEnergy(Signal* s);
00064 
00065 private:
00066   simtime_t tmin;
00067   AirFrameVector syncVector;
00068   Argument argSync;
00069 };
00070 
00071 #endif /* UWBIREDSYNC_H_ */