riot_sys

Function coap_put_option

Source
pub unsafe extern "C" fn coap_put_option(
    buf: *mut u8,
    lastonum: u16,
    onum: u16,
    odata: *const c_void,
    olen: size_t,
) -> size_t
Expand description

@brief Insert a CoAP option into buffer

This function writes a CoAP option with nr. @p onum to @p buf. It handles calculating the option delta (from @p lastonum), encoding the length from @p olen and copying the option data from @p odata.

@param[out] buf buffer to write to @param[in] lastonum number of previous option (for delta calculation), or 0 for first option @param[in] onum number of option @param[in] odata ptr to raw option data (or NULL) @param[in] olen length of @p odata (if any)

@returns amount of bytes written to @p buf