Skip to content

Commit

Permalink
Handle RMW_DEFAULT_DOMAIN_ID. (#394)
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
  • Loading branch information
hidmic authored Jun 22, 2020
1 parent d7a9559 commit d855c90
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rmw_fastrtps_shared_cpp/src/participant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,13 @@ rmw_fastrtps_shared_cpp::create_participant(
participantAttrs.rtps.builtin.initialPeersList.push_back(local_network_interface_locator);
}

// No custom handling of RMW_DEFAULT_DOMAIN_ID. Simply use a reasonable domain id.
#if FASTRTPS_VERSION_MAJOR < 2
participantAttrs.rtps.builtin.domainId = static_cast<uint32_t>(domain_id);
participantAttrs.rtps.builtin.domainId =
static_cast<uint32_t>(domain_id != RMW_DEFAULT_DOMAIN_ID ? domain_id : 0u);
#else
participantAttrs.domainId = static_cast<uint32_t>(domain_id);
participantAttrs.domainId =
static_cast<uint32_t>(domain_id != RMW_DEFAULT_DOMAIN_ID ? domain_id : 0u);
#endif

size_t length = snprintf(nullptr, 0, "enclave=%s;", enclave) + 1;
Expand Down

0 comments on commit d855c90

Please sign in to comment.