This module includes functions that control UDP communication. More...
Data Structures | |
struct | otSockAddr |
struct | otUdpSocket |
Typedefs | |
typedef struct otSockAddr | otSockAddr |
typedef void(* | otUdpReceive )(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo) |
typedef struct otUdpSocket | otUdpSocket |
Functions | |
otMessage * | otUdpNewMessage (otInstance *aInstance, bool aLinkSecurityEnabled) |
ThreadError | otUdpOpen (otInstance *aInstance, otUdpSocket *aSocket, otUdpReceive aCallback, void *aContext) |
ThreadError | otUdpClose (otUdpSocket *aSocket) |
ThreadError | otUdpBind (otUdpSocket *aSocket, otSockAddr *aSockName) |
ThreadError | otUdpConnect (otUdpSocket *aSocket, otSockAddr *aSockName) |
ThreadError | otUdpSend (otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo *aMessageInfo) |
This module includes functions that control UDP communication.
typedef struct otSockAddr otSockAddr |
This structure represents an IPv6 socket address.
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.
ThreadError 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. |
kThreadErrorNone | Bind operation was successful. |
ThreadError otUdpClose | ( | otUdpSocket * | aSocket | ) |
Close a UDP/IPv6 socket.
[in] | aSocket | A pointer to a UDP socket structure. |
kThreadErrorNone | Successfully closed the socket. |
ThreadError 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. |
kThreadErrorNone | 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. |
ThreadError 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. |
kThreadErrorNone | Successfully opened the socket. |
kThreadErrorInvalidArgs | Given socket structure was already opened. |
ThreadError 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. |