Function riot_sys::bindgen::coap_get_block

source ·
pub unsafe extern "C" fn coap_get_block(
    pkt: *mut coap_pkt_t,
    block: *mut coap_block1_t,
    option: u16,
) -> c_int
Expand description

@brief Block option getter

This function gets a CoAP packet’s block option and parses it into a helper structure.

If no block option is present in @p pkt, the values in @p block will be initialized with zero. That implies both block->offset and block->more are also valid in that case, as packet with offset==0 and more==0 means it contains all the payload for the corresponding request.

@param[in] pkt pkt to work on @param[out] block ptr to preallocated coap_block1_t structure @param[in] option block1 or block2

@returns 0 if block option not present @returns 1 if structure has been filled