riot_sys

Function coap_opt_add_uri_query2

Source
pub unsafe extern "C" fn coap_opt_add_uri_query2(
    pkt: *mut coap_pkt_t,
    key: *const c_char,
    key_len: size_t,
    val: *const c_char,
    val_len: size_t,
) -> ssize_t
Expand description

@brief Adds a single Uri-Query option in the form ‘key=value’ into pkt

@param[in,out] pkt Packet being built @param[in] key Key to add to the query string @param[in] key_len Length of @p key @param[in] val Value to assign to @p key (may be NULL) @param[in] val_len Length of @p val. 0 if @p val is NULL

@pre ((pkt != NULL) && (key != NULL) && (key_len > 0) && ((val_len == 0) || ((val != NULL) && (val_len > 0))))

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