Skip to content

Commit

Permalink
Update rcl_wait_set_add_* calls (#248)
Browse files Browse the repository at this point in the history
Now the functions take an optional output index argument.
  • Loading branch information
jacobperron authored Nov 20, 2018
1 parent 0a47327 commit 325e202
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rclpy/src/rclpy/_rclpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2251,23 +2251,23 @@ rclpy_wait_set_add_entity(PyObject * Py_UNUSED(self), PyObject * args)
if (0 == strcmp(entity_type, "subscription")) {
rcl_subscription_t * subscription =
(rcl_subscription_t *)PyCapsule_GetPointer(pyentity, "rcl_subscription_t");
ret = rcl_wait_set_add_subscription(wait_set, subscription);
ret = rcl_wait_set_add_subscription(wait_set, subscription, NULL);
} else if (0 == strcmp(entity_type, "client")) {
rcl_client_t * client =
(rcl_client_t *)PyCapsule_GetPointer(pyentity, "rcl_client_t");
ret = rcl_wait_set_add_client(wait_set, client);
ret = rcl_wait_set_add_client(wait_set, client, NULL);
} else if (0 == strcmp(entity_type, "service")) {
rcl_service_t * service =
(rcl_service_t *)PyCapsule_GetPointer(pyentity, "rcl_service_t");
ret = rcl_wait_set_add_service(wait_set, service);
ret = rcl_wait_set_add_service(wait_set, service, NULL);
} else if (0 == strcmp(entity_type, "timer")) {
rcl_timer_t * timer =
(rcl_timer_t *)PyCapsule_GetPointer(pyentity, "rcl_timer_t");
ret = rcl_wait_set_add_timer(wait_set, timer);
ret = rcl_wait_set_add_timer(wait_set, timer, NULL);
} else if (0 == strcmp(entity_type, "guard_condition")) {
rcl_guard_condition_t * guard_condition =
(rcl_guard_condition_t *)PyCapsule_GetPointer(pyentity, "rcl_guard_condition_t");
ret = rcl_wait_set_add_guard_condition(wait_set, guard_condition);
ret = rcl_wait_set_add_guard_condition(wait_set, guard_condition, NULL);
} else {
ret = RCL_RET_ERROR; // to avoid a linter warning
PyErr_Format(PyExc_RuntimeError,
Expand Down

0 comments on commit 325e202

Please sign in to comment.