|
nros rmw-cffi
C vtable for plugging a third-party RMW backend into nros
|
Runtime-pluggable custom transport vtable (Phase 115.A). More...

Go to the source code of this file.
Data Structures | |
| struct | nros_transport_ops_t |
Macros | |
| #define | NROS_TRANSPORT_OPS_ABI_VERSION_V1 ((uint32_t)1) |
Functions | |
| rmw_ret_t | nros_rmw_cffi_set_custom_transport (const nros_transport_ops_t *ops) |
Runtime-pluggable custom transport vtable (Phase 115.A).
Lets a consumer plug a custom byte-pipe (USB-CDC, BLE, RS-485, semihosting bridge, ring-buffer loopback, etc.) at runtime — no board-crate, Cargo-feature, or rebuild required. The active RMW backend (zenoh-pico, XRCE, dust-DDS, …) consumes this vtable as the read/write surface for every wire frame.
Mirrors micro-ROS's rmw_uros_set_custom_transport(framing, params, open, close, write, read) and is the C-side view of the Rust-side nros_rmw::NrosTransportOps (single #[repr(C)] layout; no parallel definitions to drift).
| #define NROS_TRANSPORT_OPS_ABI_VERSION_V1 ((uint32_t)1) |
Current ABI version of nros_transport_ops_t. Consumers MUST fill this in before passing the struct to rclc_set_custom_transport.
| rmw_ret_t nros_rmw_cffi_set_custom_transport | ( | const nros_transport_ops_t * | ops | ) |
Install a custom transport for subsequent session opens.
The struct's contents are copied internally; the caller may stack-allocate. To clear the slot, pass NULL.
The fn pointer is exported from the nano-ros C staticlib (packages/api/nros-c/), where it forwards to the nros-rmw-cffi registry. C++ consumers should include <rclcpp/transport.hpp> (from nros-cpp) which calls this function under the hood.
| NROS_RMW_RET_OK | on success (transport installed or cleared). |
| NROS_RMW_RET_INCOMPATIBLE_ABI | when ops is non-NULL but ops->abi_version does not match NROS_TRANSPORT_OPS_ABI_VERSION_V1. The previously installed transport (if any) is left untouched. |