From 392f64bece64208974ed676bb31967cd622358b4 Mon Sep 17 00:00:00 2001 From: zhanjianbo Date: Mon, 27 Oct 2025 01:42:22 +0000 Subject: [PATCH 1/2] feat: Mod according to https://github.com/ros2/rmw_iceoryx/issues/113 --- rmw_iceoryx_cpp/src/rmw_count.cpp | 42 +++++++++++++++++++++++++++++++ rmw_iceoryx_cpp/src/rmw_event.cpp | 7 ++++++ 2 files changed, 49 insertions(+) diff --git a/rmw_iceoryx_cpp/src/rmw_count.cpp b/rmw_iceoryx_cpp/src/rmw_count.cpp index 9c87cd2..3b6ba54 100644 --- a/rmw_iceoryx_cpp/src/rmw_count.cpp +++ b/rmw_iceoryx_cpp/src/rmw_count.cpp @@ -142,4 +142,46 @@ rmw_publisher_count_matched_subscriptions( *subscription_count = counter; return RMW_RET_OK; } + +rmw_ret_t +rmw_count_clients( + const rmw_node_t * node, + const char * service_name, + size_t * count) +{ + RCUTILS_CHECK_ARGUMENT_FOR_NULL(node, RMW_RET_ERROR); + RCUTILS_CHECK_ARGUMENT_FOR_NULL(service_name, RMW_RET_ERROR); + RCUTILS_CHECK_ARGUMENT_FOR_NULL(count, RMW_RET_ERROR); + + RMW_CHECK_TYPE_IDENTIFIERS_MATCH( + rmw_count_clients + : node, node->implementation_identifier, + rmw_get_implementation_identifier(), return RMW_RET_ERROR); + + // Iceoryx introspection does not support client/server counting + // See: https://github.com/eclipse-iceoryx/iceoryx/issues/1128 + *count = 0; + return RMW_RET_UNSUPPORTED; +} + +rmw_ret_t +rmw_count_services( + const rmw_node_t * node, + const char * service_name, + size_t * count) +{ + RCUTILS_CHECK_ARGUMENT_FOR_NULL(node, RMW_RET_ERROR); + RCUTILS_CHECK_ARGUMENT_FOR_NULL(service_name, RMW_RET_ERROR); + RCUTILS_CHECK_ARGUMENT_FOR_NULL(count, RMW_RET_ERROR); + + RMW_CHECK_TYPE_IDENTIFIERS_MATCH( + rmw_count_services + : node, node->implementation_identifier, + rmw_get_implementation_identifier(), return RMW_RET_ERROR); + + // Iceoryx introspection does not support client/server counting + // See: https://github.com/eclipse-iceoryx/iceoryx/issues/1128 + *count = 0; + return RMW_RET_UNSUPPORTED; +} } // extern "C" diff --git a/rmw_iceoryx_cpp/src/rmw_event.cpp b/rmw_iceoryx_cpp/src/rmw_event.cpp index d16c565..983a60b 100644 --- a/rmw_iceoryx_cpp/src/rmw_event.cpp +++ b/rmw_iceoryx_cpp/src/rmw_event.cpp @@ -59,4 +59,11 @@ rmw_ret_t rmw_event_set_callback( return RMW_RET_UNSUPPORTED; } + +rmw_ret_t +rmw_event_type_is_supported(rmw_event_type_t event_type) +{ + (void) event_type; + return RMW_RET_UNSUPPORTED; +} } // extern "C" From 955ff52e94ce0a46aeb6901cf70dafc7667a7783 Mon Sep 17 00:00:00 2001 From: zhanjianbo Date: Mon, 27 Oct 2025 01:48:28 +0000 Subject: [PATCH 2/2] fix: rmw_event_type_is_supported --- rmw_iceoryx_cpp/src/rmw_event.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rmw_iceoryx_cpp/src/rmw_event.cpp b/rmw_iceoryx_cpp/src/rmw_event.cpp index 983a60b..4e94a44 100644 --- a/rmw_iceoryx_cpp/src/rmw_event.cpp +++ b/rmw_iceoryx_cpp/src/rmw_event.cpp @@ -60,10 +60,10 @@ rmw_ret_t rmw_event_set_callback( return RMW_RET_UNSUPPORTED; } -rmw_ret_t +bool rmw_event_type_is_supported(rmw_event_type_t event_type) { (void) event_type; - return RMW_RET_UNSUPPORTED; + return false; } } // extern "C"