From 89e00224cc4961513005c3b54828546960cd8678 Mon Sep 17 00:00:00 2001 From: EduPonz Date: Fri, 16 Jul 2021 12:39:51 +0200 Subject: [PATCH] Refs 12139: Check if the writer is a statistics one Signed-off-by: EduPonz --- .../builtin/discovery/database/DiscoveryDataBase.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.cpp b/src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.cpp index 22581dcfe91..e9f40f3b8de 100644 --- a/src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.cpp +++ b/src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -1528,13 +1529,15 @@ bool DiscoveryDataBase::is_writer( const eprosima::fastrtps::rtps::GUID_t& guid) { // RTPS Specification v2.3 - // For writers: NO_KEY = 0x03, WITH_KEY = 0x02 - // For built-in writers: NO_KEY = 0xc3, WITH_KEY = 0xc2 + // - For writers: NO_KEY = 0x03, WITH_KEY = 0x02 + // - For built-in writers: NO_KEY = 0xc3, WITH_KEY = 0xc2 + // Furthermore, the Fast DDS Statistics Module defines an Entity ID for Statistics DataWriters const eprosima::fastrtps::rtps::octet identifier = guid.entityId.value[3]; return ((identifier == 0x02) || (identifier == 0xc2) || (identifier == 0x03) || - (identifier == 0xc3)); + (identifier == 0xc3) || + eprosima::fastdds::statistics::is_statistics_builtin(guid.entityId)); } bool DiscoveryDataBase::is_reader(