ros2_control - galactic
Loading...
Searching...
No Matches
ZenbeddedClientBase Class Reference
Inheritance diagram for ZenbeddedClientBase:

Public Member Functions

void destroy ()
 Deinitialize the client and underlying transport.
int zenoh_publish_state ()
 Publish current state buffer over Zenoh transport.
int start_thread (uint32_t control_freq)
 Start the control publish thread.
void stop_thread ()
 Stop the control publish thread.
bool is_initialized () const
 Check if client is initialized.
bool is_control_thread_running ()
 Check if publish thread is running.
uint32_t accepted_command_count () const
 Monotonic count of command payloads accepted from the transport.

Protected Member Functions

int init_base (uint32_t control_freq, size_t state_payload_size, size_t cmd_payload_size, const char *locator=ZENBEDDED_DEFAULT_LOCATOR)
 Initializes base buffers, transport layer, and background thread.
uint8_t * get_state_buffer_slot (size_t slot_idx)
 Direct slot access for state codec template initialization.
uint8_t * prepare_state_write_slot (int &out_write_idx)
 Acquire inactive state buffer index for thread-safe writing.
void commit_state_write_slot (int write_idx)
 Commit atomic state buffer write and flip active index.
bool read_latest_command_raw (uint8_t *data, size_t size)
 Read raw latest command bytes from double buffer.
void reset_buffers ()
 Reset atomic buffer states and versions.

Protected Attributes

bool initialized_ = false
size_t state_payload_size_ = 0
size_t cmd_payload_size_ = 0

Member Function Documentation

◆ accepted_command_count()

uint32_t ZenbeddedClientBase::accepted_command_count ( ) const
nodiscard

Monotonic count of command payloads accepted from the transport.

read_command() cannot report whether a command is new: it blocks until the double buffer is consistent and the codecs only reject undersized payloads. Callers that must react to a stalled peer compare this counter across control cycles instead.


The documentation for this class was generated from the following files: