Hi,
I'm using RTI version 5.2.0 (Modern C++ API) and I sometimes get the following error in my output terminal. What is this error and what should I do? For your information, my program is a small version of recording service and I do serialization and deserialization of dynamic data and synamic type in my program. I have also brought my codes for serialization and deserialization of dynamic type below. For dynamic data serialization and deserialization, I use "to_cdr_buffer" and "from_cdr_buffer" functions respectively.
DDS_DynamicDataTypePlugin_process_primitive_cdr_value:invalid enumerator value DDS_DynamicDataTypePlugin_parametrized_cdr_to_cdr:error copying CDR value DDS_DynamicDataTypePlugin_parametrized_cdr_to_cdr:error converting from extended CDR to CDR DDS_DynamicDataTypePlugin_deserialize:error converting from extended CDR to CDR PRESCstReaderCollator_storeSampleData:!deserialize
DDS_TypeCode *ReplayManager::deserializedTypeCode(std::vector<char>& serializedTypeCode, int serializedTypeCodeLen) { buffer.resize(serializedTypeCodeLen); if (!RTICdrTypeCode_initialize_stream((struct RTICdrTypeCode *)&buffer[0], serializedTypeCodeLen) ) { printf("TypeCodeSerialization::deserialize_TypeCode: type code buffer size " " is not large enough\n"); return NULL; } RTICdrTypeCode_copy_stream( (struct RTICdrTypeCode *)&buffer[0], (struct RTICdrTypeCode *)serializedTypeCode.data()); RTICdrTypeCode *cdrTypeCode = (struct RTICdrTypeCode *)&buffer[0]; DDS_TypeCode *typeCode = (DDS_TypeCode *)cdrTypeCode; return typeCode; }
bool DDSManager::serializeTypeCode(char *buffer, unsigned int bufferLen, const DDS_TypeCode *typeCode) { RTICdrStream stream; RTICdrStream_init(&stream); RTICdrStream_set(&stream, buffer, bufferLen); // We do not want any limits. Assigning (-1) to an unsigned int // results in the maximum unsigned int unsigned int serializedTypecodeMaxSize = -1; return RTICdrTypeCode_serialize( NULL, &typeCode->_data, &stream, RTI_TRUE, RTI_CDR_ENCAPSULATION_ID_CDR_NATIVE, RTI_TRUE, /* Serialize the data on the 2nd parameter (typeCode) */ &serializedTypecodeMaxSize /* Must be a pointer to the length of the stream */); }
Bonjefir
Hi Bonjefir,
This error happens when the DataReader is not able to deserialize a received sample. This happens when any of the following conditions is true:
https://community.rti.com/kb/what-causes-prespsreaderqueuestorequeueentrydeserialize-messages
From the first line of the whole warning message, “[…]:invalid enumerator value ”, I think that on your case the source of the issue could be related to setting an invalid literal to an enum field. Please, check this on your side and let me know how it goes.
Hi Bonjefir,
A second possible source of your issue comes from an internal bug. When you run on a little endian machine, the value of
RTI_CDR_ENCAPSULATION_ID_CDR_NATIVE
is not correctly defined. If that is the case, you have three options:RTI_ENDIAN_LITTLE
in your code-DRTI_LITTLE_ENDIAN
RTI_CDR_ENCAPSULATION_ID_CDR_NATIVE
forRTI_CDR_ENCAPSULATION_ID_CDR_LE