From a035d293b42c169a3c0914ed9abbd21834427379 Mon Sep 17 00:00:00 2001 From: Miaofei Date: Fri, 26 Apr 2019 01:24:26 -0700 Subject: [PATCH] address feedback in pull request Signed-off-by: Miaofei --- rmw_fastrtps_shared_cpp/src/rmw_node.cpp | 1 + rmw_fastrtps_shared_cpp/src/rmw_publisher.cpp | 1 + rmw_fastrtps_shared_cpp/src/rmw_wait.cpp | 27 ++++++++++++++----- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/rmw_fastrtps_shared_cpp/src/rmw_node.cpp b/rmw_fastrtps_shared_cpp/src/rmw_node.cpp index 89b6cc202..971426432 100644 --- a/rmw_fastrtps_shared_cpp/src/rmw_node.cpp +++ b/rmw_fastrtps_shared_cpp/src/rmw_node.cpp @@ -387,6 +387,7 @@ __rmw_node_assert_liveliness( } // node_info->participant->assert_liveliness(); + RMW_SET_ERROR_MSG("assert_liveliness() of node is currently not supported"); return RMW_RET_UNSUPPORTED; } diff --git a/rmw_fastrtps_shared_cpp/src/rmw_publisher.cpp b/rmw_fastrtps_shared_cpp/src/rmw_publisher.cpp index dedaa009b..f5c15def9 100644 --- a/rmw_fastrtps_shared_cpp/src/rmw_publisher.cpp +++ b/rmw_fastrtps_shared_cpp/src/rmw_publisher.cpp @@ -122,6 +122,7 @@ __rmw_publisher_assert_liveliness( } // info->publisher_->assert_liveliness(); + RMW_SET_ERROR_MSG("assert_liveliness() of publisher is currently not supported"); return RMW_RET_UNSUPPORTED; } diff --git a/rmw_fastrtps_shared_cpp/src/rmw_wait.cpp b/rmw_fastrtps_shared_cpp/src/rmw_wait.cpp index 87431bd3f..4d0f70f1b 100644 --- a/rmw_fastrtps_shared_cpp/src/rmw_wait.cpp +++ b/rmw_fastrtps_shared_cpp/src/rmw_wait.cpp @@ -83,7 +83,7 @@ __rmw_wait( rmw_guard_conditions_t * guard_conditions, rmw_services_t * services, rmw_clients_t * clients, - rmw_events_t * events, + rmw_events_t * /*events*/, rmw_wait_set_t * wait_set, const rmw_time_t * wait_timeout) { @@ -131,6 +131,15 @@ __rmw_wait( } } + // TODO(mm318): implement attachCondition for events when feature becomes available in fastrtps + // if (events) { + // for (size_t i = 0; i < events->event_count; ++i) { + // void * data = events->events[i]; + // auto custom_event_info = static_cast(data); + // custom_event_info->getListener()->attachCondition(conditionMutex, conditionVariable); + // } + // } + if (guard_conditions) { for (size_t i = 0; i < guard_conditions->guard_condition_count; ++i) { void * data = guard_conditions->guard_conditions[i]; @@ -204,11 +213,17 @@ __rmw_wait( } } - if (events) { - for (size_t i = 0; i < events->event_count; ++i) { - // no-op - } - } + // TODO(mm318): implement detachCondition for events when feature becomes available in fastrtps + // if (events) { + // for (size_t i = 0; i < events->event_count; ++i) { + // void * data = events->events[i]; + // auto custom_event_info = static_cast(data); + // custom_event_info->getListener()->detachCondition(); + // if (!custom_event_info->getListener()->hasEvent()) { + // services->services[i] = 0; + // } + // } + // } if (guard_conditions) { for (size_t i = 0; i < guard_conditions->guard_condition_count; ++i) {