From 0bf74816f245fda62e3c9862511cf2125a6338f2 Mon Sep 17 00:00:00 2001 From: juanlofer-eprosima <88179026+juanlofer-eprosima@users.noreply.github.com> Date: Tue, 24 Sep 2024 10:58:14 +0200 Subject: [PATCH] Register and propagate MonitorService status type object (#5253) Signed-off-by: Juan Lopez Fernandez --- .../rtps/monitor-service/MonitorService.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/cpp/statistics/rtps/monitor-service/MonitorService.cpp b/src/cpp/statistics/rtps/monitor-service/MonitorService.cpp index 96fa9d0ba9a..bc2813eb034 100644 --- a/src/cpp/statistics/rtps/monitor-service/MonitorService.cpp +++ b/src/cpp/statistics/rtps/monitor-service/MonitorService.cpp @@ -20,12 +20,14 @@ #include +#include #include #include #include #include #include +#include #include #include @@ -494,6 +496,20 @@ bool MonitorService::create_endpoint() topic_desc.topic_name = MONITOR_SERVICE_TOPIC; topic_desc.type_name = type_.get_name(); + //! Register and propagate type object representation + type_.register_type_object_representation(); + fastdds::dds::xtypes::TypeInformation type_info; + if (fastdds::dds::RETCODE_OK == + RTPSDomainImpl::get_instance()->type_object_registry_observer().get_type_information( + type_.type_identifiers(), type_info)) + { + topic_desc.type_information = type_info; + } + else + { + EPROSIMA_LOG_WARNING(MONITOR_SERVICE, "Failed to retrieve type information for " << MONITOR_SERVICE_TOPIC); + } + endpoint_registrator_(status_writer_, topic_desc, wqos); } else