From bb33b86dd5e72e9757bdbe29897db54ee60f90a9 Mon Sep 17 00:00:00 2001 From: Eduardo Ponz Segrelles Date: Mon, 19 Jul 2021 07:32:34 +0200 Subject: [PATCH] Accept Statistics DataWriters in Discovery Server (#2075) 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(