riot_sys::bindgen

Function nanocoap_get_blockwise_to_buf

Source
pub unsafe extern "C" fn nanocoap_get_blockwise_to_buf(
    sock: *mut nanocoap_sock_t,
    path: *const c_char,
    blksize: coap_blksize_t,
    buf: *mut c_void,
    len: size_t,
) -> ssize_t
Expand description

@brief Performs a blockwise CoAP GET request, store the response in a buffer.

This function will fetch the content of the specified resource path via block-wise-transfer. The blocks will be re-assembled into @p buf

@param[in] sock socket to use for the request @param[in] path pointer to source path @param[in] blksize sender suggested SZX for the COAP block request @param[in] buf Target buffer @param[in] len Target buffer length

@returns <0 on error @returns -EINVAL if an invalid url is provided @returns -ENOBUFS if the provided buffer was too small @returns size of the response payload on success