This module includes functions that control UDP communication. More...
Data Structures | |
struct | otUdpSocket |
Typedefs | |
typedef void(* | otUdpReceive )(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo) |
typedef struct otUdpSocket | otUdpSocket |
Functions | |
otMessage * | otUdpNewMessage (otInstance *aInstance, bool aLinkSecurityEnabled) |
otError | otUdpOpen (otInstance *aInstance, otUdpSocket *aSocket, otUdpReceive aCallback, void *aContext) |
otError | otUdpClose (otUdpSocket *aSocket) |
otError | otUdpBind (otUdpSocket *aSocket, otSockAddr *aSockName) |
otError | otUdpConnect (otUdpSocket *aSocket, otSockAddr *aSockName) |
otError | otUdpSend (otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo *aMessageInfo) |
This module includes functions that control UDP communication.
typedef void(* otUdpReceive)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo) |
This callback allows OpenThread to inform the application of a received UDP message.
typedef struct otUdpSocket otUdpSocket |
This structure represents a UDP socket.
otError otUdpBind | ( | otUdpSocket * | aSocket, |
otSockAddr * | aSockName | ||
) |
Bind a UDP/IPv6 socket.
[in] | aSocket | A pointer to a UDP socket structure. |
[in] | aSockName | A pointer to an IPv6 socket address structure. |
OT_ERROR_NONE | Bind operation was successful. |
otError otUdpClose | ( | otUdpSocket * | aSocket | ) |
Close a UDP/IPv6 socket.
[in] | aSocket | A pointer to a UDP socket structure. |
OT_ERROR_NONE | Successfully closed the socket. |
otError otUdpConnect | ( | otUdpSocket * | aSocket, |
otSockAddr * | aSockName | ||
) |
Connect a UDP/IPv6 socket.
[in] | aSocket | A pointer to a UDP socket structure. |
[in] | aSockName | A pointer to an IPv6 socket address structure. |
OT_ERROR_NONE | Connect operation was successful. |
otMessage* otUdpNewMessage | ( | otInstance * | aInstance, |
bool | aLinkSecurityEnabled | ||
) |
Allocate a new message buffer for sending a UDP message.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aLinkSecurityEnabled | TRUE if the message should be secured at Layer 2. |
otError otUdpOpen | ( | otInstance * | aInstance, |
otUdpSocket * | aSocket, | ||
otUdpReceive | aCallback, | ||
void * | aContext | ||
) |
Open a UDP/IPv6 socket.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aSocket | A pointer to a UDP socket structure. |
[in] | aCallback | A pointer to the application callback function. |
[in] | aContext | A pointer to application-specific context. |
OT_ERROR_NONE | Successfully opened the socket. |
OT_ERROR_INVALID_ARGS | Given socket structure was already opened. |
otError otUdpSend | ( | otUdpSocket * | aSocket, |
otMessage * | aMessage, | ||
const otMessageInfo * | aMessageInfo | ||
) |
Send a UDP/IPv6 message.
[in] | aSocket | A pointer to a UDP socket structure. |
[in] | aMessage | A pointer to a message buffer. |
[in] | aMessageInfo | A pointer to a message info structure. |