Skip to main content

nros_rmw_cffi_set_custom_transport

Function nros_rmw_cffi_set_custom_transport 

Source
pub unsafe extern "C" fn nros_rmw_cffi_set_custom_transport(
    ops: *const nros_transport_ops_t,
) -> rmw_ret_t
Expand description

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 <nros/transport.hpp> (from nros-cpp) which calls this function under the hood.

@retval NROS_RMW_RET_OK on success (transport installed or cleared). @retval 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.