riot_sys

Function coap_opt_add_uint

Source
pub unsafe extern "C" fn coap_opt_add_uint(
    pkt: *mut coap_pkt_t,
    optnum: u16,
    value: u32,
) -> ssize_t
Expand description

@brief Encode the given uint option into pkt

@post pkt.payload advanced to first byte after option @post pkt.payload_len reduced by option length

@param[in,out] pkt pkt referencing target buffer @param[in] optnum option number to use @param[in] value uint to encode

@return number of bytes written to buffer @return <0 on error @return -ENOSPC if no available options or insufficient buffer space