| 1 | /**************************************************************************** |
|---|
| 2 | |
|---|
| 3 | Copyright 2010 by your_name_or_organization, all rights reserved. |
|---|
| 4 | |
|---|
| 5 | ****************************************************************************/ |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | #ifndef FRAMESYNC64_IMPL_H |
|---|
| 9 | #define FRAMESYNC64_IMPL_H |
|---|
| 10 | |
|---|
| 11 | #include <stdlib.h> |
|---|
| 12 | #include <complex> |
|---|
| 13 | #include <liquid/liquid.h> |
|---|
| 14 | #include "ossie/cf.h" |
|---|
| 15 | #include "ossie/PortTypes.h" |
|---|
| 16 | #include "ossie/Resource_impl.h" |
|---|
| 17 | #include "ossie/debug.h" |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | #include "standardinterfaces/complexFloat.h" |
|---|
| 21 | #include "standardinterfaces/realChar.h" |
|---|
| 22 | #include "standardinterfaces/realChar_u.h" |
|---|
| 23 | #include "standardinterfaces/complexFloat_p.h" |
|---|
| 24 | |
|---|
| 25 | /** \brief |
|---|
| 26 | * |
|---|
| 27 | * |
|---|
| 28 | */ |
|---|
| 29 | class FrameSync64_i : public virtual Resource_impl |
|---|
| 30 | { |
|---|
| 31 | public: |
|---|
| 32 | /// Initializing constructor |
|---|
| 33 | FrameSync64_i(const char *uuid, omni_condition *sem); |
|---|
| 34 | |
|---|
| 35 | /// Destructor |
|---|
| 36 | ~FrameSync64_i(void); |
|---|
| 37 | |
|---|
| 38 | /// Static function for omni thread |
|---|
| 39 | static void Run( void * data ); |
|---|
| 40 | |
|---|
| 41 | /// |
|---|
| 42 | void start() throw (CF::Resource::StartError, CORBA::SystemException); |
|---|
| 43 | |
|---|
| 44 | /// |
|---|
| 45 | void stop() throw (CF::Resource::StopError, CORBA::SystemException); |
|---|
| 46 | |
|---|
| 47 | /// |
|---|
| 48 | CORBA::Object_ptr getPort( const char* portName ) |
|---|
| 49 | throw (CF::PortSupplier::UnknownPort, CORBA::SystemException); |
|---|
| 50 | |
|---|
| 51 | /// |
|---|
| 52 | void releaseObject() throw (CF::LifeCycle::ReleaseError, CORBA::SystemException); |
|---|
| 53 | |
|---|
| 54 | /// |
|---|
| 55 | void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); |
|---|
| 56 | |
|---|
| 57 | /// Query properties from .prf.xml |
|---|
| 58 | void query(CF::Properties&) |
|---|
| 59 | throw (CORBA::SystemException, |
|---|
| 60 | CF::UnknownProperties); |
|---|
| 61 | |
|---|
| 62 | /// Configures properties read from .prf.xml |
|---|
| 63 | void configure(const CF::Properties&) |
|---|
| 64 | throw (CORBA::SystemException, |
|---|
| 65 | CF::PropertySet::InvalidConfiguration, |
|---|
| 66 | CF::PropertySet::PartialConfiguration); |
|---|
| 67 | |
|---|
| 68 | bool verbose; |
|---|
| 69 | |
|---|
| 70 | private: |
|---|
| 71 | /// Disallow default constructor |
|---|
| 72 | FrameSync64_i(); |
|---|
| 73 | |
|---|
| 74 | /// Disallow copy constructor |
|---|
| 75 | FrameSync64_i(FrameSync64_i&); |
|---|
| 76 | |
|---|
| 77 | /// Main signal processing method |
|---|
| 78 | void ProcessData(); |
|---|
| 79 | bool continue_processing(); |
|---|
| 80 | volatile bool thread_started; |
|---|
| 81 | omni_mutex processing_mutex; |
|---|
| 82 | |
|---|
| 83 | omni_condition *component_running; ///< for component shutdown |
|---|
| 84 | omni_thread *processing_thread; ///< for component writer function |
|---|
| 85 | |
|---|
| 86 | // list components provides and uses ports |
|---|
| 87 | standardInterfaces_i::complexFloat_p *frameDataPortIn; |
|---|
| 88 | standardInterfaces_i::realChar_u *headerDataPortOut; |
|---|
| 89 | standardInterfaces_i::realChar_u *payloadDataPortOut; |
|---|
| 90 | |
|---|
| 91 | // liquid dsp objects |
|---|
| 92 | framesync64 fs; // frame synchronizer object |
|---|
| 93 | framesyncprops_s fsprops; // frame synchronizer properties |
|---|
| 94 | //unsigned char header[24]; // header data buffer |
|---|
| 95 | //unsigned char payload[64]; // payload data buffer |
|---|
| 96 | resamp2_crcf decim2; // half-band decimator |
|---|
| 97 | public: |
|---|
| 98 | void PushHeaderData(unsigned char * _header); |
|---|
| 99 | void PushPayloadData(unsigned char * _payload); |
|---|
| 100 | |
|---|
| 101 | }; |
|---|
| 102 | #endif |
|---|