Skip to content

Commit

Permalink
Add app_id and app_metadata to discovery properties
Browse files Browse the repository at this point in the history
Signed-off-by: Jesus Perez <[email protected]>
  • Loading branch information
jepemi committed Nov 3, 2023
1 parent 19d4dc1 commit bb5fbc6
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ struct ParticipantConfiguration : public core::IConfiguration
//! Participant Id associated with this configuration
core::types::ParticipantId id {};

//! Participant app properties.
std::string app_id;
std::string app_metadata;

//! Whether this Participant should connect its readers with its writers.
bool is_repeater {false};
};
Expand Down
11 changes: 11 additions & 0 deletions ddspipe_participants/src/cpp/participant/dds/CommonParticipant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,17 @@ fastdds::dds::DomainParticipantQos CommonParticipant::reckon_participant_qos_()
qos.properties().properties().emplace_back(
"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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,16 @@ CommonParticipant::reckon_participant_attributes_(
// Add Participant name
params.setName(participant_configuration->id.c_str());

// 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;
}

Expand Down

0 comments on commit bb5fbc6

Please sign in to comment.