| 1 | /**************************************************************************** |
|---|
| 2 | |
|---|
| 3 | Copyright 2007 Virginia Polytechnic Institute and State University |
|---|
| 4 | |
|---|
| 5 | This file is part of the OSSIE TxDemo. |
|---|
| 6 | |
|---|
| 7 | OSSIE TxDemo is free software; you can redistribute it and/or modify |
|---|
| 8 | it under the terms of the GNU General Public License as published by |
|---|
| 9 | the Free Software Foundation; either version 2 of the License, or |
|---|
| 10 | (at your option) any later version. |
|---|
| 11 | |
|---|
| 12 | OSSIE TxDemo is distributed in the hope that it will be useful, |
|---|
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 15 | GNU General Public License for more details. |
|---|
| 16 | |
|---|
| 17 | You should have received a copy of the GNU General Public License |
|---|
| 18 | along with OSSIE TxDemo; if not, write to the Free Software |
|---|
| 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 20 | |
|---|
| 21 | ****************************************************************************/ |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | #ifndef TXDEMO_IMPL_H |
|---|
| 25 | #define TXDEMO_IMPL_H |
|---|
| 26 | |
|---|
| 27 | #include <stdlib.h> |
|---|
| 28 | #include "ossie/cf.h" |
|---|
| 29 | #include "ossie/PortTypes.h" |
|---|
| 30 | #include "ossie/Resource_impl.h" |
|---|
| 31 | #include "ossie/debug.h" |
|---|
| 32 | |
|---|
| 33 | #include "standardinterfaces/complexShort.h" |
|---|
| 34 | #include "standardinterfaces/complexShort_u.h" |
|---|
| 35 | |
|---|
| 36 | extern unsigned char data_i[512]; |
|---|
| 37 | extern unsigned char data_q[512]; |
|---|
| 38 | |
|---|
| 39 | /** \brief |
|---|
| 40 | * |
|---|
| 41 | * |
|---|
| 42 | */ |
|---|
| 43 | class TxDemo_i : public virtual Resource_impl |
|---|
| 44 | { |
|---|
| 45 | public: |
|---|
| 46 | /// Initializing constructor |
|---|
| 47 | TxDemo_i(const char *uuid, omni_condition *sem); |
|---|
| 48 | |
|---|
| 49 | /// Destructor |
|---|
| 50 | ~TxDemo_i(void); |
|---|
| 51 | |
|---|
| 52 | /// Static function for omni thread |
|---|
| 53 | static void Run( void * data ); |
|---|
| 54 | |
|---|
| 55 | /// |
|---|
| 56 | void start() throw (CF::Resource::StartError, CORBA::SystemException); |
|---|
| 57 | |
|---|
| 58 | /// |
|---|
| 59 | void stop() throw (CF::Resource::StopError, CORBA::SystemException); |
|---|
| 60 | |
|---|
| 61 | /// |
|---|
| 62 | CORBA::Object_ptr getPort( const char* portName ) |
|---|
| 63 | throw (CF::PortSupplier::UnknownPort, CORBA::SystemException); |
|---|
| 64 | |
|---|
| 65 | /// |
|---|
| 66 | void releaseObject() throw (CF::LifeCycle::ReleaseError, CORBA::SystemException); |
|---|
| 67 | |
|---|
| 68 | /// |
|---|
| 69 | void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); |
|---|
| 70 | |
|---|
| 71 | /// Configures properties read from .prf.xml |
|---|
| 72 | void configure(const CF::Properties&) |
|---|
| 73 | throw (CORBA::SystemException, |
|---|
| 74 | CF::PropertySet::InvalidConfiguration, |
|---|
| 75 | CF::PropertySet::PartialConfiguration); |
|---|
| 76 | |
|---|
| 77 | |
|---|
| 78 | private: |
|---|
| 79 | /// Disallow default constructor |
|---|
| 80 | TxDemo_i(); |
|---|
| 81 | |
|---|
| 82 | /// Disallow copy constructor |
|---|
| 83 | TxDemo_i(TxDemo_i&); |
|---|
| 84 | |
|---|
| 85 | /// Main signal processing method |
|---|
| 86 | void ProcessData(); |
|---|
| 87 | bool thread_started; |
|---|
| 88 | |
|---|
| 89 | omni_condition *component_running; ///< for component shutdown |
|---|
| 90 | omni_thread *processing_thread; ///< for component writer function |
|---|
| 91 | CORBA::Short simple_0_value; |
|---|
| 92 | |
|---|
| 93 | // Output data port, "symbols_out" |
|---|
| 94 | standardInterfaces_i::complexShort_u *dataOutPort; |
|---|
| 95 | |
|---|
| 96 | // Properties |
|---|
| 97 | short packet_delay; ///< packet delay (ms) |
|---|
| 98 | |
|---|
| 99 | }; |
|---|
| 100 | #endif |
|---|