Problem in assigning raw data to CORB... PreviousNext
Data Distribution Service (DDS) Forum > DDS Technical Forum >
Message/Author
Next message jeetendra kumar  posted on Monday, July 02, 2012 - 10:33 am
Hi,
I have an issue while assigning raw(void*) data to CORBA::Sequence<octet> data and vice versa.

#define SAMPLE_SIZE (3)
#define FRAMES_PER_BUFFER (1024)
#define NUM_CHANNELS (2)

I am getting raw data on:
unsigned char* sampleBlock=(char*) malloc(FRAMES_PER_BUFFER * NUM_CHANNELS * SAMPLE_SIZE);

My IDL file is as below:
module Messenger{
struct Message{
CORBA::Sequence<octet> userData
};
};

//Initialising the length of corba data:
Messenger::Message message;
message.userData.length(numBytes);

//Assigning sampleBlock data to CORBA::sequence<octet> data as below:

for(CORBA::ULong jj=0; jj<FRAMES_PER_BUFFER; ++jj)
{
message.userData[jj]=sampleBlock[jj];
}

But problem is that, I am not getting the same data on this CORBA data. Getting just empty data...

Btw, I used memcpy also to assign data as below:
memcpy(&message.userData, sampleBlock, FRAMES_PER_BUFFER);
but no luck... :-(

Is there any specific way to assign and retrive data from CORBA::sequence<octet> data.

Any help on this will be higly appreciated. Thanks In Advance...

Bye,
Jeet
Back to top
Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Post as "Anonymous"
Enable HTML code in message
Automatically activate URLs in message
Action: