Skip to main content

nros_rmw_cffi_set_custom_transport

Function nros_rmw_cffi_set_custom_transport 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn nros_rmw_cffi_set_custom_transport( ops: *const NrosTransportOps, ) -> NrosRmwRet
Expand description

Phase 115.A.2 — C entry point for installing a custom transport.

Mirrors the Rust-side nros_rmw::set_custom_transport(Some(...)) (or None when ops == NULL) but returns the canonical nros_rmw_ret_t codes so non-Rust consumers don’t have to reach into nros-c’s higher-level error enum.

The struct’s contents are copied internally; the caller may stack-allocate. Pass NULL to clear the slot.

§Safety

ops must either be NULL or point at a valid nros_transport_ops_t whose four fn pointers stay live for the lifetime of the registration (i.e. until a subsequent nros_rmw_cffi_set_custom_transport(NULL) or a replacement install).