From bd10d2e44d7cadadcb4553c7ac7c2a5c2a2c955a Mon Sep 17 00:00:00 2001 From: Antonio Cuadros Date: Wed, 3 Nov 2021 14:59:44 +0100 Subject: [PATCH 1/2] Add selection of domain_id --- rmw_microxrcedds_c/src/rmw_node.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rmw_microxrcedds_c/src/rmw_node.c b/rmw_microxrcedds_c/src/rmw_node.c index 5affe2c2..97458ee4 100644 --- a/rmw_microxrcedds_c/src/rmw_node.c +++ b/rmw_microxrcedds_c/src/rmw_node.c @@ -134,7 +134,6 @@ 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) { @@ -142,6 +141,9 @@ rmw_create_node( } 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; From 3d6b1ba99c6f0ae8475e0ba98223311db4a81334 Mon Sep 17 00:00:00 2001 From: Antonio Cuadros Date: Wed, 3 Nov 2021 17:14:20 +0100 Subject: [PATCH 2/2] Get domain id from init options --- rmw_microxrcedds_c/src/rmw_init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rmw_microxrcedds_c/src/rmw_init.c b/rmw_microxrcedds_c/src/rmw_init.c index 4b78dc68..773cb882 100644 --- a/rmw_microxrcedds_c/src/rmw_init.c +++ b/rmw_microxrcedds_c/src/rmw_init.c @@ -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(