Skip to main content

otCoapMessageInitResponse

Function otCoapMessageInitResponse 

Source
pub unsafe extern "C" fn otCoapMessageInitResponse(
    aResponse: *mut otMessage,
    aRequest: *const otMessage,
    aType: otCoapType,
    aCode: otCoapCode,
) -> otError
Expand description

Initializes a CoAP message as a response to a request.

This function initializes the CoAP header, erasing any previously written content in the message. The Message ID and Token are copied from the request message.

@param[in,out] aResponse A pointer to the CoAP response message to initialize. @param[in] aRequest A pointer to the CoAP request message. @param[in] aType The CoAP Type for the response. @param[in] aCode The CoAP Code for the response.

@retval OT_ERROR_NONE Successfully initialized the response message. @retval OT_ERROR_NO_BUFS Insufficient message buffers available to write the CoAP header.