when I use FooDataReader_read() to read data,but I didn't read anything.

2 posts / 0 new
Last post
Offline
Last seen: 2 years 1 month ago
Joined: 08/16/2017
Posts: 2
when I use FooDataReader_read() to read data,but I didn't read anything.

 

code 

unsigned int length;
DDS_DynamicData *instance = NULL;

status = DDS_DynamicDataReader_read((DDS_DynamicDataReader *)portDataReader, &portSequence, &portInfoSeq,
DDS_LENGTH_UNLIMITED, DDS_ANY_SAMPLE_STATE, DDS_ANY_VIEW_STATE, DDS_ANY_INSTANCE_STATE);/*DDS_NOT_ALIVE_INSTANCE_STATE*/
if (status != DDS_RETCODE_OK)
{

return STAT_ERROR;
}

the return value is  DDS_RETCODE_NO_DATA,I did't set the listener and waitset.

this is my code,who can help me?

rip
rip's picture
Offline
Last seen: 1 day 2 hours ago
Joined: 04/06/2012
Posts: 316

A sample may be a data sample, or it may be a state notification (ie, "DDS_NOT_ALIVE_INSTANCE_STATE" or similar).

You got one of the latter ones.