riot_sys

Function nanocoap_server_prepare_separate

Source
pub unsafe extern "C" fn nanocoap_server_prepare_separate(
    ctx: *mut nanocoap_server_response_ctx_t,
    pkt: *mut coap_pkt_t,
    req: *const coap_request_ctx_t,
) -> c_int
Expand description

@brief Prepare the context for a separate response

This function serializes the CoAP request information so that a separate response can be generated outside the CoAP handler.

The CoAP handler should then respond with an empty ACK by calling @ref coap_build_empty_ack

@warning This function is only available when using the module nanocoap_server_separate

@param[out] ctx Context information for separate response @param[in] pkt CoAP packet to which the response will be generated @param[in] req Context of the CoAP request

@retval 0 Success @retval -EOVERFLOW Storing context would have overflown buffers in @p ctx (e.g. RFC 8974 (module nanocoap_token_ext) is in use and token too long) @retval <0 Other error