diff --git a/ddspipe_participants/include/ddspipe_participants/configuration/ParticipantConfiguration.hpp b/ddspipe_participants/include/ddspipe_participants/configuration/ParticipantConfiguration.hpp index bcc671d6..7e498578 100644 --- a/ddspipe_participants/include/ddspipe_participants/configuration/ParticipantConfiguration.hpp +++ b/ddspipe_participants/include/ddspipe_participants/configuration/ParticipantConfiguration.hpp @@ -46,6 +46,10 @@ struct ParticipantConfiguration : public core::IConfiguration //! Participant Id associated with this configuration. core::types::ParticipantId id {}; + //! Participant app properties. + std::string app_id = "UNKNOWN_APP"; + std::string app_metadata = ""; + //! Whether this Participant should connect its readers with its writers. bool is_repeater {false}; diff --git a/ddspipe_participants/src/cpp/participant/dds/CommonParticipant.cpp b/ddspipe_participants/src/cpp/participant/dds/CommonParticipant.cpp index 3c67d0da..61603501 100644 --- a/ddspipe_participants/src/cpp/participant/dds/CommonParticipant.cpp +++ b/ddspipe_participants/src/cpp/participant/dds/CommonParticipant.cpp @@ -292,6 +292,16 @@ fastdds::dds::DomainParticipantQos CommonParticipant::reckon_participant_qos_() "fastdds.ignore_local_endpoints", "true"); + // Set app properties + qos.properties().properties().emplace_back( + "fastdds.application.id", + configuration_->app_id, + "true"); + qos.properties().properties().emplace_back( + "fastdds.application.metadata", + configuration_->app_metadata, + "true"); + return qos; } diff --git a/ddspipe_participants/src/cpp/participant/dynamic_types/DynTypesParticipant.cpp b/ddspipe_participants/src/cpp/participant/dynamic_types/DynTypesParticipant.cpp index 20e493a3..b17484c7 100644 --- a/ddspipe_participants/src/cpp/participant/dynamic_types/DynTypesParticipant.cpp +++ b/ddspipe_participants/src/cpp/participant/dynamic_types/DynTypesParticipant.cpp @@ -188,6 +188,16 @@ void DynTypesParticipant::initialize_internal_dds_participant_() eprosima::fastdds::dds::DomainParticipantQos pqos; pqos.name(this->id()); + // Set app properties + pqos.properties().properties().emplace_back( + "fastdds.application.id", + configuration->app_id, + "true"); + pqos.properties().properties().emplace_back( + "fastdds.application.metadata", + configuration->app_metadata, + "true"); + // Set Type LookUp to ON pqos.wire_protocol().builtin.typelookup_config.use_server = false; pqos.wire_protocol().builtin.typelookup_config.use_client = true; diff --git a/ddspipe_participants/src/cpp/participant/rtps/CommonParticipant.cpp b/ddspipe_participants/src/cpp/participant/rtps/CommonParticipant.cpp index 4e28fbb0..15defc74 100644 --- a/ddspipe_participants/src/cpp/participant/rtps/CommonParticipant.cpp +++ b/ddspipe_participants/src/cpp/participant/rtps/CommonParticipant.cpp @@ -489,6 +489,16 @@ CommonParticipant::reckon_participant_attributes_( "fastdds.ignore_local_endpoints", "true"); + // Set app properties + params.properties.properties().emplace_back( + "fastdds.application.id", + participant_configuration->app_id, + "true"); + params.properties.properties().emplace_back( + "fastdds.application.metadata", + participant_configuration->app_metadata, + "true"); + return params; } diff --git a/ddspipe_participants/test/blackbox/participants_creation/CMakeLists.txt b/ddspipe_participants/test/blackbox/participants_creation/CMakeLists.txt index 834d2ed9..0be40f15 100644 --- a/ddspipe_participants/test/blackbox/participants_creation/CMakeLists.txt +++ b/ddspipe_participants/test/blackbox/participants_creation/CMakeLists.txt @@ -19,6 +19,7 @@ set(TEST_SOURCES ) set(TEST_LIST + default_configuration creation_trivial ddspipe_all_creation_builtin_topic ) diff --git a/ddspipe_participants/test/blackbox/participants_creation/ParticipantsCreationgTest.cpp b/ddspipe_participants/test/blackbox/participants_creation/ParticipantsCreationgTest.cpp index a49c3b17..6cbe0818 100644 --- a/ddspipe_participants/test/blackbox/participants_creation/ParticipantsCreationgTest.cpp +++ b/ddspipe_participants/test/blackbox/participants_creation/ParticipantsCreationgTest.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -39,6 +40,21 @@ constexpr const unsigned int N_THREADS = 2; } // test +/** + * Test to check default participant configuration values. + */ +TEST(ParticipantsCreationgTest, default_configuration) +{ + // Common configuration + { + participants::ParticipantConfiguration conf; + EXPECT_EQ(conf.app_id, "UNKNOWN_APP"); + EXPECT_EQ(conf.app_metadata, ""); + EXPECT_TRUE(conf.id.empty()); + EXPECT_FALSE(conf.is_repeater); + } +} + /** * Test to create a participant of each kind and check it does not fail. *