diff --git a/rmw_cyclonedds_cpp/src/rmw_node.cpp b/rmw_cyclonedds_cpp/src/rmw_node.cpp index fe64263be..10da48ead 100644 --- a/rmw_cyclonedds_cpp/src/rmw_node.cpp +++ b/rmw_cyclonedds_cpp/src/rmw_node.cpp @@ -2458,6 +2458,7 @@ static const std::unordered_map mask_map{ {RMW_EVENT_OFFERED_DEADLINE_MISSED, DDS_OFFERED_DEADLINE_MISSED_STATUS}, {RMW_EVENT_REQUESTED_QOS_INCOMPATIBLE, DDS_REQUESTED_INCOMPATIBLE_QOS_STATUS}, {RMW_EVENT_OFFERED_QOS_INCOMPATIBLE, DDS_OFFERED_INCOMPATIBLE_QOS_STATUS}, + {RMW_EVENT_MESSAGE_LOST, DDS_SAMPLE_LOST_STATUS}, }; static bool is_event_supported(const rmw_event_type_t event_t) @@ -2566,6 +2567,20 @@ extern "C" rmw_ret_t rmw_take_event( } } + case RMW_EVENT_MESSAGE_LOST: { + auto ei = static_cast(event_info); + auto sub = static_cast(event_handle->data); + dds_sample_lost_status_t st; + if (dds_get_sample_lost_status(sub->enth, &st) < 0) { + *taken = false; + return RMW_RET_ERROR; + } + ei->total_count = static_cast(st.total_count); + ei->total_count_change = static_cast(st.total_count_change); + *taken = true; + return RMW_RET_OK; + } + case RMW_EVENT_LIVELINESS_LOST: { auto ei = static_cast(event_info); auto pub = static_cast(event_handle->data);