Skip to content

Commit f085598

Browse files
authored
Added rmw_event_type_is_supported (#250)
* Added rmw_event_check_compatible Signed-off-by: Alejandro Hernandez Cordero <[email protected]> * fix return typoe Signed-off-by: Alejandro Hernandez Cordero <[email protected]> * updated name and use in wait_set test Signed-off-by: Alejandro Hernandez Cordero <[email protected]> --------- Signed-off-by: Alejandro Hernandez Cordero <[email protected]> Signed-off-by: Alejandro Hernández Cordero <[email protected]>
1 parent 6c81f54 commit f085598

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

rmw_implementation/src/functions.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,12 @@ RMW_INTERFACE_FN(
757757
1, ARG_TYPES(
758758
rmw_feature_t))
759759

760+
RMW_INTERFACE_FN(
761+
rmw_event_type_is_supported,
762+
bool, RMW_EVENT_INVALID,
763+
1, ARG_TYPES(
764+
rmw_event_type_t))
765+
760766
RMW_INTERFACE_FN(
761767
rmw_take_dynamic_message,
762768
rmw_ret_t, RMW_RET_ERROR,
@@ -841,6 +847,7 @@ void prefetch_symbols(void)
841847
GET_SYMBOL(rmw_take_request)
842848
GET_SYMBOL(rmw_send_response)
843849
GET_SYMBOL(rmw_take_event)
850+
GET_SYMBOL(rmw_event_type_is_supported)
844851
GET_SYMBOL(rmw_create_guard_condition)
845852
GET_SYMBOL(rmw_destroy_guard_condition)
846853
GET_SYMBOL(rmw_trigger_guard_condition)
@@ -999,6 +1006,7 @@ unload_library()
9991006
symbol_rmw_client_set_on_new_response_callback = nullptr;
10001007
symbol_rmw_event_set_callback = nullptr;
10011008
symbol_rmw_feature_supported = nullptr;
1009+
symbol_rmw_event_type_is_supported = nullptr;
10021010
symbol_rmw_take_dynamic_message = nullptr;
10031011
symbol_rmw_take_dynamic_message_with_info = nullptr;
10041012
symbol_rmw_serialization_support_init = nullptr;

test_rmw_implementation/test/test_wait_set.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,7 @@ class TestWaitSetUse : public TestWaitSet
120120
client = rmw_create_client(node, service_ts, service_name, &rmw_qos_profile_default);
121121
ASSERT_NE(nullptr, client) << rmw_get_error_string().str;
122122
rmw_ret_t ret = RMW_RET_OK;
123-
// rmw_zenoh does not support RMW_EVENT_LIVELINESS_CHANGED.
124-
// TODO(Yadunund): Rely on API suggested in https://github.com/ros2/rmw/issues/394 instead.
125-
if (std::string(rmw_get_implementation_identifier()).find("rmw_zenoh_cpp") == 0) {
123+
if (!rmw_event_type_is_supported(RMW_EVENT_LIVELINESS_CHANGED)) {
126124
ret = rmw_subscription_event_init(&event, sub, RMW_EVENT_PUBLICATION_MATCHED);
127125
} else {
128126
ret = rmw_subscription_event_init(&event, sub, RMW_EVENT_LIVELINESS_CHANGED);

0 commit comments

Comments
 (0)