Skip to main content

rmw_qos_profile_check_compatible

Function rmw_qos_profile_check_compatible 

Source
pub unsafe extern "C" fn rmw_qos_profile_check_compatible(
    publisher_profile: rmw_qos_profile_t,
    subscription_profile: rmw_qos_profile_t,
    compatibility: *mut Type,
    reason: *mut c_char,
    reason_size: usize,
) -> rmw_ret_t
Expand description

Upstream rmw_qos_profile_check_compatible. Exact parity.

reason may be NULL with reason_size 0 — the create-time path, which wants the verdict and nothing else.

The reason is SELECTED, never FORMATTED: each clash bit maps to one static const char[] and they are appended by a bounded copy. Upstream’s implementations use snprintf, which would drag the printf engine into images that deliberately excluded it.

Truncation is NOT failure: the buffer is always NUL-terminated and the verdict is still written. Returning BUFFER_TOO_SMALL would make a small-buffer caller lose the load-bearing half of the answer.