XTypes compliance mismatch

By default, Connext data serialization is not fully compliant with Extended CDR encoding. While this doesn't affect correctness it may prevent interoperability with other vendors.

To make Connext compatible with the OMG 'Extensible and Dynamic Topic Types for DDS' specification, version 1.3, you should use the Extensible Types compliance mask. This mask allows you to set and unset serialization features either to be compatible with the specification or to allow backward compatibility with previous Connext releases (and not be compatible with the specification).

Most of these issues do not require changes in code generation. Usually, you only need to set the Extensible Types Compliance Mask in the Core Libraries, as described in the Core Libraries Extensible Types Guide, to modify a given behavior. Some bits in the mask, however — such as the bit rti::config::compliance::initialize_discriminator_to_default()— also require changes to the generated code. In these cases, you must pass the same mask to Code Generator using the -xTypesComplianceMask command-line option. You will know which bits these are because their descriptions in the documentation mention their integration with the -xTypesComplianceMask option.

If there is a mismatch in the relevant bits of the mask used by the Core Libraries and the ones provided to Code Generator, the following error will occur.

ERROR [0x0101E2B2,0x6FC1384A,0xF28F78DD:0x000001C1{Domain=0}|REGISTER TYPE MyType] RTIXCdrXTypesComplianceMask_verifyGeneratedXTypesMask:bad param: Inconsistent XTypes Compliance options for this type. (See https://community.rti.com/kb/xtypes-compliance-mismatch)

To fix this, pass the same mask used by the Core Libraries to Code Generator via the -xTypesComplianceMask command-line option.

For example, if you generate code with -xTypesComplianceMask 0x0000018C (which includes the rti::config::compliance::initialize_discriminator_to_default() bit: 0x00000100), but later set the compliance mask without that bit enabled—as shown in the following examples for Modern C++ and Python—you will encounter the error described above.

rti::config::compliance::XTypesMask mask(0x0000008C);
rti::config::compliance::set_xtypes_mask(mask); 
import rti.connextdds as dds
mask = dds.compliance.XTypesMask(0x0000008C)
dds.compliance.set_xtypes_mask(mask)