Multiple Datatypes on one Topic

2 posts / 0 new
Last post
Offline
Last seen: 7 years 4 months ago
Joined: 08/12/2015
Posts: 1
Multiple Datatypes on one Topic

Hello,

maybe i just did not look carefully enaugh into the manual, but i got one question resolved unanswered.
Im trying to implement a communication between two participants, where one participant sends a variety of datatypes onto the same topic. So now my question is, how RTI connext handles this. My understanding right now is, that i have to generate for each datatype the listener functions (right now im using the example publisher and listener files generated by the rtiddsgen tool) and merge them to one programm. When there is data avaible, can Connext call the right on_data_listen function for the recieved datatype?
And do I have to start a new listening thread for each datatype?
On the publisher site everything seems clear to me, im just using the generated datawriter, fitting to the datatype i want to send.


Greetings from Germany and thank you,

Daniel

Offline
Last seen: 6 months 3 weeks ago
Joined: 05/23/2013
Posts: 64

Hi Daniel,

DDS allows a topic to be associated with a single data type, but a data type contains other data types. 
The on_data_available callback function is invoked when a DataReader receives a new data sample and a DataReader is associated with a single topic. 

It is not clear to me how you created a topic associated with multiple data types.
If you create a data type containing multiple data types with a single topic, you can have one on_data_availalble function for the topic and need to demultiplex data for different types in the callback function (if you can differentiate data by types). Otherwise, you need to create a different topic for each data type. 

Thanks,
Kyoungho