nros C API
Lightweight ROS 2 client for embedded real-time systems
Loading...
Searching...
No Matches
Data Fields
rcl_timer_t Struct Reference

#include <nros_generated.h>

Collaboration diagram for rcl_timer_t:
Collaboration graph
[legend]

Data Fields

void * _executor
 
rclc_timer_callback_with_context_t callback
 
const struct rcl_clock_t * clock
 
void * context
 
size_t handle_id
 
uint64_t period_ns
 
enum rclc_timer_state_t state
 

Detailed Description

Timer structure.

Already an arena handle before phase-487: rclc_executor_add_timer creates the timer inside the executor arena and records (handle_id, _executor) here, and every live accessor forwards there. The period, callback, context and clock are the REGISTRATION INPUTS: rclc's rclc_timer_init_default(timer, support, period, callback) takes them at init, before any executor exists, and a removed timer can be added again, so they stay. phase-487 W3 removed the one field that was a copy, last_call_time_ns: written by init and reset, read by nothing, and stale for any timer the executor ran (issue 1049).

Field Documentation

◆ _executor

void* rcl_timer_t::_executor

Opaque pointer to internal executor (set by rclc_executor_add_timer)

◆ callback

rclc_timer_callback_with_context_t rcl_timer_t::callback

User callback function

◆ clock

const struct rcl_clock_t* rcl_timer_t::clock

The clock this timer is scheduled against, or NULL for the WALL timer rclc_timer_init_with_context creates (phase-430 W1).

rcl's rcl_timer_init takes a rcl_clock_t * here and rcl's timer keeps it; ours does the same, in the same position, so a reader of one recognises the other. The clock must outlive the timer — the executor reads its type at rclc_executor_add_timer time, not at init.

◆ context

void* rcl_timer_t::context

User context pointer

◆ handle_id

size_t rcl_timer_t::handle_id

Handle ID from executor registration (SIZE_MAX = not registered)

◆ period_ns

uint64_t rcl_timer_t::period_ns

Period in nanoseconds

◆ state

enum rclc_timer_state_t rcl_timer_t::state

Current state


The documentation for this struct was generated from the following file: