Skip to content

Commit

Permalink
Add message lost subscription event
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
  • Loading branch information
ivanpauno committed May 28, 2020
1 parent 7978132 commit 84e5b29
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rmw/include/rmw/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ 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
Expand All @@ -41,6 +41,7 @@ typedef enum rmw_event_type_t
RMW_EVENT_LIVELINESS_LOST,
RMW_EVENT_OFFERED_DEADLINE_MISSED,
RMW_EVENT_OFFERED_QOS_INCOMPATIBLE,
RMW_EVENT_MESSAGE_LOST,

// sentinel value
RMW_EVENT_INVALID
Expand Down
1 change: 1 addition & 0 deletions rmw/include/rmw/events_statuses/events_statuses.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
39 changes: 39 additions & 0 deletions rmw/include/rmw/events_statuses/message_lost.h
Original file line number Diff line number Diff line change
@@ -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 <stddef.h>

#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_

0 comments on commit 84e5b29

Please sign in to comment.