Using DynamicData API with TopicType definition utilizing typedef IDL

2 posts / 0 new
Last post
Last seen: 3 months 3 weeks ago
Joined: 10/23/2013
Posts: 42
Using DynamicData API with TopicType definition utilizing typedef IDL

I make extensive use of the DynamicData API for registering, reading and writing TopicData.  I have relied on examples provided in this Forum and the Knowledge Base to handle sequences, nested structs, enums, etc.  However, I have recently run into a problem with a topic whose definition includes typedefs.  My code fails when encountering a member in DDS_DynamicData that was defined in the IDL file with a typedef.  It appears that the _type._data fields are not valid for a typedef, but rather the information in _type._data._typeCode should be used.   Attached is a simple IDL file.  Can you please provide example C code that used tye DynamicData APIs to work with the topic type:  SNAExample::DDSBasicData_msg ?

- register the topic type:

- reads a sample for the topic



Fernando Garcia's picture
Last seen: 4 months 2 weeks ago
Joined: 05/18/2011
Posts: 198

Hi Mark,

I have improved the example that I shared with you in the other thread to include also instructions to read the SNAExample::DDSBasicData_msg type. Here is the link to pastebin, you will find the code also attached to this post.

Note that the topic in my case is called "Example SNAExamples_DDSBasicData_msg", but you can easily change the value of the typeName variable. I have tested that it reads/writes communicating with IDL-based publisher and subscriber applications.

Please take a look at the example and let me know if it interoperates with your application.


File Attachments: