pub unsafe extern "C" fn coap_block2_build_reply(
pkt: *mut coap_pkt_t,
code: c_uint,
rbuf: *mut u8,
rlen: c_uint,
payload_len: c_uint,
slicer: *mut coap_block_slicer_t,
) -> ssize_t
Expand description
@name Functions – Messaging
Functions to support sending and receiving messages. / /@{*/ / @brief Build reply to CoAP block2 request
This function can be used to create a reply to a CoAP block2 request packet. In addition to @ref coap_build_reply, this function checks the block2 option and returns an error message to the client if necessary.
@param[in] pkt packet to reply to @param[in] code reply code (e.g., COAP_CODE_204) @param[out] rbuf buffer to write reply to @param[in] rlen size of @p rbuf @param[in] payload_len length of payload @param[in] slicer slicer to use
@warning Use @ref coap_get_response_hdr_len to determine the size of the header this will write.
@returns size of reply packet on success @returns <0 on error