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

3 posts / 0 new
Last post
Offline
Last seen: 7 years 4 months 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 week 6 days ago
Joined: 04/06/2012
Posts: 324

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.

Offline
Last seen: 5 years 2 months ago
Joined: 10/19/2019
Posts: 1

Its a state notification, thanks a lot.