|
nros C API
Lightweight ROS 2 client for embedded real-time systems
|
#include <nros_generated.h>

Data Fields | |
| void * | _executor |
| size_t | handle_id |
| struct rclc_node_ref_t | node |
| struct rclc_qos_t | qos |
| rclc_sched_context_id_t | sched_context_id |
| enum rclc_subscription_state_t | state |
| uint8_t | topic_name [256] |
| size_t | topic_name_len |
| uint8_t | type_hash [128] |
| size_t | type_hash_len |
| uint8_t | type_name [256] |
| size_t | type_name_len |
| const struct rclc_message_type_t * | type_support |
A subscription the executor dispatches (rclc's rcl_subscription_t).
phase-487 W1 (RFC-0096 D9, the C amendment): an entity the executor dispatches is owned by the executor. The subscriber, its receive buffer, the callback and its context all live in the executor arena's entry, and this struct holds the arena handle (handle_id, _executor) plus the DESCRIPTION the registration needs. The description has to be here because rclc's order is init first, rclc_executor_add_* second: at init there is no executor to hold it yet.
Before phase-487 this struct also carried the callback, the context and the polled form's subscriber storage (_opaque). On the dispatched road none of the three was read after registration, because the arena keeps its own copies. A subscription the caller drains itself is a [rclc_polling_subscription_t].
| void* rcl_subscription_t::_executor |
issue 1437 — the rclc_executor_t holding this subscription's arena entry, or NULL before registration. Set beside [handle_id](Self::handle_id) by nros_executor_add_subscription_*: the pair is the same (executor_ptr, arena_entry_index) that ServiceServerInternal and ServiceClientInternal carry.
Internal: treat as opaque.
| size_t rcl_subscription_t::handle_id |
Handle ID from executor registration (SIZE_MAX = not registered)
| struct rclc_node_ref_t rcl_subscription_t::node |
Pointer to parent node
| struct rclc_qos_t rcl_subscription_t::qos |
QoS settings (stored during init, used by executor registration)
| rclc_sched_context_id_t rcl_subscription_t::sched_context_id |
Phase 189.M3 — scheduling-context slot requested via [rclc_subscription_init_with_options]. 0 = inherit the executor / Node default (no explicit bind), matching the rcl_node_options_t::sched_context_id convention. When non-zero, nros_executor_add_subscription_* binds the freshly-created handle to this SC after registration.
| enum rclc_subscription_state_t rcl_subscription_t::state |
Current state
| uint8_t rcl_subscription_t::topic_name[256] |
Topic name storage
| size_t rcl_subscription_t::topic_name_len |
Topic name length
| uint8_t rcl_subscription_t::type_hash[128] |
Type hash storage
| size_t rcl_subscription_t::type_hash_len |
Type hash length
| uint8_t rcl_subscription_t::type_name[256] |
Type name storage
| size_t rcl_subscription_t::type_name_len |
Type name length
| const struct rclc_message_type_t* rcl_subscription_t::type_support |
phase-492 W8 — the descriptor this subscription was created with, kept so rclc_executor_add_subscription_with_context deserialises through its codec with rclc's arguments. Descriptors are generated static consts, so the pointer outlives the subscription.