riot_sys::bindgen

Function coap_subtree_handler

Source
pub unsafe extern "C" fn coap_subtree_handler(
    pkt: *mut coap_pkt_t,
    resp_buf: *mut u8,
    resp_buf_len: size_t,
    context: *mut coap_request_ctx_t,
) -> ssize_t
Expand description

@brief Generic coap subtree handler

This function can be used as a generic handler for resources with the @ref COAP_MATCH_SUBTREE where a new @ref coap_resource_t is to be parsed.

@note The @p context must be of type @ref coap_resource_subtree_t.

@param[in] pkt pointer to (parsed) CoAP packet @param[out] resp_buf buffer for response @param[in] resp_buf_len size of response buffer @param[in] context pointer to request context, must contain context to @ref coap_resource_subtree_t instance

@returns size of the reply packet on success @returns <0 on error