obtain enum info using DynamicData API

2 posts / 0 new
Last post
Last seen: 4 months 3 weeks ago
Joined: 10/23/2013
Posts: 42
obtain enum info using DynamicData API


I am using tje Dynamic Data API to register, read and write topic data.  Given a pointer to DDS_DynamicData.  I am using the function DDS_DynamicData_get_member_type() to get data type information for each item in the Topic.  However, when the element is of the type DDS_TK_ENUM, I am not sure how to obtain the enumeration data type.  It seems that the information is in at least one of two places, and isn't consistent.

DDS_DynamicData* dynamicData;

struct DDS_DynamicDataMemberInfo info;

DDS_DynamicData_get_member_info_by_index(dynamicData, &info, j)

struct DDS_TypeCode*  typePtr = NULL;

DDS_DynamicData_get_member_type(dynamicData, &typePtr, info.member_name, DDS_DYNAMIC_DATA_MEMBER_ID_UNSPECIFIED

enumeration data type is sometimes located here:


But sometimes the above element is null and the enumeration name is here:



What is the proper way to obtain enum type info?



sara's picture
Last seen: 6 hours 37 min ago
Joined: 01/16/2013
Posts: 127

Hi Mark,

Just a quick question so I can help you. What do you mean by data type? Do you need the enumeration type kind or the name of each of the elements?