riot_sys

Function gcoap_get_resource_list

Source
pub unsafe extern "C" fn gcoap_get_resource_list(
    buf: *mut c_void,
    maxlen: size_t,
    cf: u8,
    tl_type: gcoap_socket_type_t,
) -> c_int
Expand description

@brief Get the resource list, currently only CoRE Link Format (COAP_FORMAT_LINK) supported

If @p buf := NULL, nothing will be written but the size of the resulting resource list is computed and returned.

@param[out] buf output buffer to write resource list into, my be NULL @param[in] maxlen length of @p buf, ignored if @p buf is NULL @param[in] cf content format to use for the resource list, currently only COAP_FORMAT_LINK supported @param[in] tl_type Transport type to get the list for. @ref GCOAP_SOCKET_TYPE_UNDEF for all transport types. If non of the transports beyond UDP are compiled in (i.e. usage of modules no gcoap_dtls, …) this will be ignored and @ref GCOAP_SOCKET_TYPE_UDP assumed.

@todo add support for CoRAL once it is done

@return the number of bytes written to @p buf @return -1 on error