Changeset 4704
- Timestamp:
- 08/14/07 14:37:26 (6 years ago)
- Location:
- experimental/components/PacketizerSimpleBPSK/branches/PacketizerSimpleBPSK-metadata
- Files:
-
- 3 modified
-
src/PacketizerSimpleBPSK.cpp (modified) (7 diffs)
-
src/PacketizerSimpleBPSK.h (modified) (1 diff)
-
xml/PacketizerSimpleBPSK.scd.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
experimental/components/PacketizerSimpleBPSK/branches/PacketizerSimpleBPSK-metadata/src/PacketizerSimpleBPSK.cpp
r4113 r4704 28 28 PacketizerSimpleBPSK_i::PacketizerSimpleBPSK_i(const char *uuid, omni_condition *condition) : Resource_impl(uuid), component_running(condition) 29 29 { 30 dataIn_0 = new standardInterfaces_i::realChar_p("bitsIn"); 31 dataIn_1 = new standardInterfaces_i::realChar_p("controlIn"); 32 dataOut_0 = new standardInterfaces_i::realChar_u("bitsOut"); 30 dataIn = new standardInterfaces_i::realChar_p("bitsIn"); 31 dataOut = new standardInterfaces_i::realChar_u("bitsOut"); 33 32 34 33 //Create the thread for the writer's processing function … … 43 42 PacketizerSimpleBPSK_i::~PacketizerSimpleBPSK_i(void) 44 43 { 45 delete dataIn_0; 46 delete dataIn_1; 47 delete dataOut_0; 44 delete dataIn; 45 delete dataOut; 48 46 } 49 47 … … 59 57 CORBA::Object_var p; 60 58 61 p = dataIn _0->getPort(portName);59 p = dataIn->getPort(portName); 62 60 63 61 if (!CORBA::is_nil(p)) 64 62 return p._retn(); 65 63 66 p = data In_1->getPort(portName);64 p = dataOut->getPort(portName); 67 65 68 66 if (!CORBA::is_nil(p)) … … 70 68 return p._retn(); 71 69 } 72 73 p = dataOut_0->getPort(portName);74 75 if (!CORBA::is_nil(p))76 return p._retn();77 70 78 71 // Port not found; throw exception … … 133 126 bits_out[i] = pnSyncCode[i]; 134 127 135 unsigned int N , M;128 unsigned int N; 136 129 unsigned int i_data = PN_SYNC_CODE_LENGTH + (PN_CONTROL_CODE_LENGTH*NUM_CONTROL_CODES); 137 130 138 131 PortTypes::CharSequence * data_bits_in(NULL); 139 PortTypes::CharSequence * control_bits_in(NULL);140 132 while( true ) 141 133 { 142 dataIn _0->getData(data_bits_in);134 dataIn->getData(data_bits_in, metadata); 143 135 N = data_bits_in->length(); 144 136 DEBUG(5, PacketizerSimpleBPSK, "got " << N << " data samples") … … 147 139 ///\todo: do not assume input data block size is always 400 148 140 149 dataIn_1->getData(control_bits_in);150 M = control_bits_in->length();151 DEBUG(5, PacketizerSimpleBPSK, "got " << M << " control samples")152 if ( M != 1 )153 std::cout << "WARNING: PacketizerSimpleBPSK did not get exactly 1 control sample" << std::endl;154 ///\todo: do not assume input control block size is always 1155 156 141 DEBUG(7, PacketizerSimpleBPSK, "copying control data") 157 ConfigureControl( (*control_bits_in)[0]);142 ConfigureControl( metadata->packet_id ); 158 143 WriteControlBlock( bits_out ); 159 144 … … 163 148 164 149 DEBUG(5, PacketizerSimpleBPSK, "pushing data " << N << " samples...") 165 dataOut _0->pushPacket( bits_out);150 dataOut->pushPacket( bits_out, *metadata ); 166 151 167 dataIn_0->bufferEmptied(); 168 dataIn_1->bufferEmptied(); 152 dataIn->bufferEmptied(); 169 153 170 154 } -
experimental/components/PacketizerSimpleBPSK/branches/PacketizerSimpleBPSK-metadata/src/PacketizerSimpleBPSK.h
r4106 r4704 88 88 89 89 //list components provides and uses ports 90 standardInterfaces_i::realChar_p *dataIn _0; // data block91 standardInterfaces_i::realChar_ p *dataIn_1; // control block92 standardInterfaces _i::realChar_u *dataOut_0; // output packet90 standardInterfaces_i::realChar_p *dataIn; // data block 91 standardInterfaces_i::realChar_u *dataOut; // output packet 92 standardInterfaces::MetaData *metadata; 93 93 94 94 /// Writes control block data to output sequence -
experimental/components/PacketizerSimpleBPSK/branches/PacketizerSimpleBPSK-metadata/xml/PacketizerSimpleBPSK.scd.xml
r4100 r4704 15 15 <ports> 16 16 <provides providesname="bitsIn" repid="IDL:standardInterfaces/realChar:1.0"> 17 <porttype type="data"/>18 </provides>19 <provides providesname="controlIn" repid="IDL:standardInterfaces/realChar:1.0">20 17 <porttype type="data"/> 21 18 </provides>