Skip to content

Commit

Permalink
Accept Statistics DataWriters in Discovery Server (#2075)
Browse files Browse the repository at this point in the history
Signed-off-by: EduPonz <eduardoponz@eprosima.com>
  • Loading branch information
EduPonz authored Jul 19, 2021
1 parent 689071d commit bb33b86
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <fastdds/rtps/common/EntityId_t.hpp>
#include <fastdds/rtps/common/GuidPrefix_t.hpp>
#include <fastdds/rtps/common/RemoteLocators.hpp>
#include <statistics/rtps/GuidUtils.hpp>

#include <rtps/builtin/discovery/database/DiscoveryDataBase.hpp>

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit bb33b86

Please sign in to comment.