Skip to content

Commit

Permalink
Add in inconsistent_topic implementation. (ros2#1024)
Browse files Browse the repository at this point in the history
* Add in incompatible type implementation.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
  • Loading branch information
clalancette authored and danthony06 committed Jun 14, 2023
1 parent d5442bc commit a04f6d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rcl/include/rcl/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ typedef enum rcl_publisher_event_type_e
RCL_PUBLISHER_OFFERED_DEADLINE_MISSED,
RCL_PUBLISHER_LIVELINESS_LOST,
RCL_PUBLISHER_OFFERED_INCOMPATIBLE_QOS,
RCL_PUBLISHER_INCOMPATIBLE_TYPE,
} rcl_publisher_event_type_t;

/// Enumeration of all of the subscription events that may fire.
Expand All @@ -47,6 +48,7 @@ typedef enum rcl_subscription_event_type_e
RCL_SUBSCRIPTION_LIVELINESS_CHANGED,
RCL_SUBSCRIPTION_REQUESTED_INCOMPATIBLE_QOS,
RCL_SUBSCRIPTION_MESSAGE_LOST,
RCL_SUBSCRIPTION_INCOMPATIBLE_TYPE,
} rcl_subscription_event_type_t;

/// Internal rcl implementation struct.
Expand Down
6 changes: 6 additions & 0 deletions rcl/src/rcl/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ rcl_publisher_event_init(
case RCL_PUBLISHER_OFFERED_INCOMPATIBLE_QOS:
rmw_event_type = RMW_EVENT_OFFERED_QOS_INCOMPATIBLE;
break;
case RCL_PUBLISHER_INCOMPATIBLE_TYPE:
rmw_event_type = RMW_EVENT_PUBLISHER_INCOMPATIBLE_TYPE;
break;
default:
RCL_SET_ERROR_MSG("Event type for publisher not supported");
return RCL_RET_INVALID_ARGUMENT;
Expand Down Expand Up @@ -118,6 +121,9 @@ rcl_subscription_event_init(
case RCL_SUBSCRIPTION_MESSAGE_LOST:
rmw_event_type = RMW_EVENT_MESSAGE_LOST;
break;
case RCL_SUBSCRIPTION_INCOMPATIBLE_TYPE:
rmw_event_type = RMW_EVENT_SUBSCRIPTION_INCOMPATIBLE_TYPE;
break;
default:
RCL_SET_ERROR_MSG("Event type for subscription not supported");
return RCL_RET_INVALID_ARGUMENT;
Expand Down

0 comments on commit a04f6d9

Please sign in to comment.