diff --git a/rmw/include/rmw/event.h b/rmw/include/rmw/event.h index 678084de..75db9352 100644 --- a/rmw/include/rmw/event.h +++ b/rmw/include/rmw/event.h @@ -29,13 +29,14 @@ extern "C" #include "rmw/ret_types.h" #include "rmw/visibility_control.h" -/// Define QoS policy events +/// Define publisher/subscription events typedef enum rmw_event_type_t { // subscription events RMW_EVENT_LIVELINESS_CHANGED, RMW_EVENT_REQUESTED_DEADLINE_MISSED, RMW_EVENT_REQUESTED_QOS_INCOMPATIBLE, + RMW_EVENT_MESSAGE_LOST, // publisher events RMW_EVENT_LIVELINESS_LOST, diff --git a/rmw/include/rmw/events_statuses/events_statuses.h b/rmw/include/rmw/events_statuses/events_statuses.h index 7507db3b..99bf9af2 100644 --- a/rmw/include/rmw/events_statuses/events_statuses.h +++ b/rmw/include/rmw/events_statuses/events_statuses.h @@ -18,6 +18,7 @@ #include "rmw/events_statuses/incompatible_qos.h" #include "rmw/events_statuses/liveliness_changed.h" #include "rmw/events_statuses/liveliness_lost.h" +#include "rmw/events_statuses/message_lost.h" #include "rmw/events_statuses/offered_deadline_missed.h" #include "rmw/events_statuses/requested_deadline_missed.h" diff --git a/rmw/include/rmw/events_statuses/message_lost.h b/rmw/include/rmw/events_statuses/message_lost.h new file mode 100644 index 00000000..b402bb6a --- /dev/null +++ b/rmw/include/rmw/events_statuses/message_lost.h @@ -0,0 +1,39 @@ +// Copyright 2020 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef RMW__EVENTS_STATUSES__MESSAGE_LOST_H_ +#define RMW__EVENTS_STATUSES__MESSAGE_LOST_H_ + +#include + +#include "rmw/visibility_control.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef struct RMW_PUBLIC_TYPE rmw_message_lost_status_t +{ + /// Total number of messages lost. + size_t total_count; + /// Number of messages lost since last callback. + size_t total_count_change; +} rmw_message_lost_status_t; + +#ifdef __cplusplus +} +#endif + +#endif // RMW__EVENTS_STATUSES__MESSAGE_LOST_H_