riot_sys

Function gcoap_req_send

Source
pub unsafe extern "C" fn gcoap_req_send(
    buf: *const u8,
    len: size_t,
    remote: *const sock_udp_ep_t,
    local: *const sock_udp_ep_t,
    resp_handler: gcoap_resp_handler_t,
    context: *mut c_void,
    tl_type: gcoap_socket_type_t,
) -> ssize_t
Expand description

@brief Sends a buffer containing a CoAP request to the provided endpoint

@param[in] buf Buffer containing the PDU @param[in] len Length of the buffer @param[in] remote Destination for the packet @param[in] local Local endpoint to send from, may be NULL @param[in] resp_handler Callback when response received, may be NULL @param[in] context User defined context passed to the response handler @param[in] tl_type The transport type to use for send. When @ref GCOAP_SOCKET_TYPE_UNDEF is selected, the highest available (by value) will be selected. Only single types are allowed, not a combination of them.

@note The highest supported (by value) gcoap_socket_type_t will be selected as transport type.

@return length of the packet @return -ENOTCONN, if DTLS was used and session establishment failed @return -EINVAL, if @p tl_type is is not supported @return 0 if cannot send