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

#include <nros_generated.h>

Collaboration diagram for rcl_subscription_t:
Collaboration graph
[legend]

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
 

Detailed Description

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].

Field Documentation

◆ _executor

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.

◆ handle_id

size_t rcl_subscription_t::handle_id

Handle ID from executor registration (SIZE_MAX = not registered)

◆ node

struct rclc_node_ref_t rcl_subscription_t::node

Pointer to parent node

◆ qos

struct rclc_qos_t rcl_subscription_t::qos

QoS settings (stored during init, used by executor registration)

◆ sched_context_id

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.

◆ state

enum rclc_subscription_state_t rcl_subscription_t::state

Current state

◆ topic_name

uint8_t rcl_subscription_t::topic_name[256]

Topic name storage

◆ topic_name_len

size_t rcl_subscription_t::topic_name_len

Topic name length

◆ type_hash

uint8_t rcl_subscription_t::type_hash[128]

Type hash storage

◆ type_hash_len

size_t rcl_subscription_t::type_hash_len

Type hash length

◆ type_name

uint8_t rcl_subscription_t::type_name[256]

Type name storage

◆ type_name_len

size_t rcl_subscription_t::type_name_len

Type name length

◆ type_support

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.


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