openthread_sys

Function otUdpSend

Source
pub unsafe extern "C" fn otUdpSend(
    aInstance: *mut otInstance,
    aSocket: *mut otUdpSocket,
    aMessage: *mut otMessage,
    aMessageInfo: *const otMessageInfo,
) -> otError
Expand description

Send a UDP/IPv6 message.

@param[in] aInstance A pointer to an OpenThread instance. @param[in] aSocket A pointer to a UDP socket structure. @param[in] aMessage A pointer to a message buffer. @param[in] aMessageInfo A pointer to a message info structure.

If the return value is OT_ERROR_NONE, OpenThread takes ownership of @p aMessage, and the caller should no longer reference @p aMessage. If the return value is not OT_ERROR_NONE, the caller retains ownership of @p aMessage, including freeing @p aMessage if the message buffer is no longer needed.

@retval OT_ERROR_NONE The message is successfully scheduled for sending. @retval OT_ERROR_INVALID_ARGS Invalid arguments are given. @retval OT_ERROR_NO_BUFS Insufficient available buffer to add the UDP and IPv6 headers.