Function rcl_timer_exchange_callback_data

Function Documentation

uintptr_t rcl_timer_exchange_callback_data(rcl_timer_t *timer, uintptr_t data)

Set the type erased data that the timer callback will be called with.

This function can fail, and therefore return NULL, if:

  • timer is NULL

  • timer has not been initialized (the implementation is invalid)

This function can set callback to NULL, in which case the callback is ignored when rcl_timer_call is called.

Attribute

Adherence

Allocates Memory

No

Thread-Safe

Yes

Uses Atomics

Yes

Lock-Free

Yes

Parameters:
  • timer[inout] handle to the timer from the callback should be exchanged

  • data[in] pointer to user data to be passed into the callback

Returns:

RCL_RET_OK if the data was set successfully, or

Returns:

RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCL_RET_TIMER_INVALID if the timer is invalid.