Skip to content

Commit

Permalink
Enable Domain Override on Reference and XML Participant (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogs9 authored Oct 30, 2023
1 parent a40c1b9 commit c25243c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/cpp/middleware/fastdds/FastDDSMiddleware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ bool FastDDSMiddleware::create_participant_by_ref(
int16_t domain_id,
const std::string& ref)
{
if(domain_id == UXR_CLIENT_DOMAIN_ID_TO_OVERRIDE_WITH_ENV){
domain_id = agent_domain_id_;
UXR_AGENT_LOG_WARN(
UXR_DECORATE_YELLOW("Overriding Micro XRCE-DDS Client DOMAIN_ID"),
"domain_id: {}", domain_id
);
}

bool rv = false;
fastrtps::ParticipantAttributes attrs;
auto participant_domain_id = domain_id;
Expand Down Expand Up @@ -97,6 +105,14 @@ bool FastDDSMiddleware::create_participant_by_xml(
int16_t domain_id,
const std::string& xml)
{
if(domain_id == UXR_CLIENT_DOMAIN_ID_TO_OVERRIDE_WITH_ENV){
domain_id = agent_domain_id_;
UXR_AGENT_LOG_WARN(
UXR_DECORATE_YELLOW("Overriding Micro XRCE-DDS Client DOMAIN_ID"),
"domain_id: {}", domain_id
);
}

bool rv = false;
std::shared_ptr<FastDDSParticipant> participant(new FastDDSParticipant(domain_id));
if (participant->create_by_xml(xml))
Expand Down

0 comments on commit c25243c

Please sign in to comment.