obtain enum info using DynamicData API

2 posts / 0 new
Last post
Offline
Last seen: 1 year 2 months ago
Joined: 10/23/2013
Posts: 43
obtain enum info using DynamicData API

Hello,

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:

typePtr->_data._name

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

typePtr->_data->_typeCode.name

 

What is the proper way to obtain enum type info?

Thanks.

Mark.

Organization:
sara's picture
Offline
Last seen: 1 year 4 months ago
Joined: 01/16/2013
Posts: 128

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?

Thanks,

Sara