Skip to content

Commit

Permalink
Add alternative domain API configuration (#186)
Browse files Browse the repository at this point in the history
* Add selection of domain_id

* Get domain id from init options
  • Loading branch information
Acuadros95 authored Nov 4, 2021
1 parent bfb641c commit 0aa2e12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions rmw_microxrcedds_c/src/rmw_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ rmw_init(
return RMW_RET_INCORRECT_RMW_IMPLEMENTATION);
context->instance_id = options->instance_id;
context->implementation_identifier = eprosima_microxrcedds_identifier;
context->options.domain_id = options->domain_id;

rmw_uxrce_init_session_memory(&session_memory, custom_sessions, RMW_UXRCE_MAX_SESSIONS);
rmw_uxrce_init_static_input_buffer_memory(
Expand Down
4 changes: 3 additions & 1 deletion rmw_microxrcedds_c/src/rmw_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,16 @@ rmw_create_node(
size_t domain_id,
bool localhost_only)
{
(void)context;
(void)localhost_only;
rmw_node_t * rmw_node = NULL;
if (!name || strlen(name) == 0) {
RMW_SET_ERROR_MSG("name is null");
} else if (!namespace_ || strlen(namespace_) == 0) {
RMW_SET_ERROR_MSG("namespace is null");
} else {
if (domain_id == 0 && context->options.domain_id != 0) {
domain_id = context->options.domain_id;
}
rmw_node = create_node(name, namespace_, domain_id, context);
}
return rmw_node;
Expand Down

0 comments on commit 0aa2e12

Please sign in to comment.