diff --git a/src/main/java/com/eprosima/fastdds/idl/templates/DDSPubSubTypeSource.stg b/src/main/java/com/eprosima/fastdds/idl/templates/DDSPubSubTypeSource.stg index 21d39d0a..d177e728 100644 --- a/src/main/java/com/eprosima/fastdds/idl/templates/DDSPubSubTypeSource.stg +++ b/src/main/java/com/eprosima/fastdds/idl/templates/DDSPubSubTypeSource.stg @@ -142,6 +142,11 @@ bool $struct.name$PubSubType::serialize( ser.serialize_encapsulation(); // Serialize the object. ser << *p_type; +#if FASTCDR_VERSION_MAJOR > 1 + ser.set_dds_cdr_options({0,0}); +#else + ser.setDDSCdrOptions(0); +#endif // FASTCDR_VERSION_MAJOR > 1 } catch (eprosima::fastcdr::exception::Exception& /*exception*/) {