UDP
This module includes functions that control UDP communication.
Summary
Typedefs |
|
---|---|
otUdpHandler)(void *aContext, const otMessage *aMessage, const otMessageInfo *aMessageInfo)
|
typedefbool(*
This callback allows OpenThread to provide specific handlers for certain UDP messages. |
otUdpReceive)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
|
typedefvoid(*
This callback allows OpenThread to inform the application of a received UDP message. |
otUdpReceiver
|
typedefstruct otUdpReceiver
This structure represents a UDP receiver. |
otUdpSocket
|
typedefstruct otUdpSocket
This structure represents a UDP socket. |
Functions |
|
---|---|
otUdpAddReceiver(otInstance *aInstance, otUdpReceiver *aUdpReceiver)
|
This function adds a UDP receiver.
|
otUdpBind(otUdpSocket *aSocket, otSockAddr *aSockName)
|
Bind a UDP/IPv6 socket.
|
otUdpClose(otUdpSocket *aSocket)
|
Close a UDP/IPv6 socket.
|
otUdpConnect(otUdpSocket *aSocket, otSockAddr *aSockName)
|
Connect a UDP/IPv6 socket.
|
otUdpNewMessage(otInstance *aInstance, const otMessageSettings *aSettings)
|
Allocate a new message buffer for sending a UDP message.
|
otUdpOpen(otInstance *aInstance, otUdpSocket *aSocket, otUdpReceive aCallback, void *aContext)
|
Open a UDP/IPv6 socket.
|
otUdpRemoveReceiver(otInstance *aInstance, otUdpReceiver *aUdpReceiver)
|
This function removes a UDP receiver.
|
otUdpSend(otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo *aMessageInfo)
|
Send a UDP/IPv6 message.
|
otUdpSendDatagram(otInstance *aInstance, otMessage *aMessage, otMessageInfo *aMessageInfo)
|
This function sends a UDP message without socket.
|
Structs |
|
---|---|
otUdpReceiver |
This structure represents a UDP receiver. |
otUdpSocket |
This structure represents a UDP socket. |
Typedefs
otUdpHandler
bool(* otUdpHandler)(void *aContext, const otMessage *aMessage, const otMessageInfo *aMessageInfo)
This callback allows OpenThread to provide specific handlers for certain UDP messages.
Details | |||||
---|---|---|---|---|---|
Return Values |
|
otUdpReceive
void(* otUdpReceive)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
This callback allows OpenThread to inform the application of a received UDP message.
Functions
otUdpAddReceiver
otError otUdpAddReceiver( otInstance *aInstance, otUdpReceiver *aUdpReceiver )
This function adds a UDP receiver.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otUdpBind
otError otUdpBind( otUdpSocket *aSocket, otSockAddr *aSockName )
Bind a UDP/IPv6 socket.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otUdpNewMessage
otUdpOpen
otUdpConnect
otUdpClose
otUdpSend
otUdpClose
otError otUdpClose( otUdpSocket *aSocket )
Close a UDP/IPv6 socket.
Details | |||
---|---|---|---|
Parameters |
|
||
Return Values |
|
otUdpNewMessage
otUdpOpen
otUdpBind
otUdpConnect
otUdpSend
otUdpConnect
otError otUdpConnect( otUdpSocket *aSocket, otSockAddr *aSockName )
Connect a UDP/IPv6 socket.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otUdpNewMessage
otUdpOpen
otUdpBind
otUdpClose
otUdpSend
otUdpNewMessage
otMessage * otUdpNewMessage( otInstance *aInstance, const otMessageSettings *aSettings )
Allocate a new message buffer for sending a UDP message.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
A pointer to the message buffer or NULL if no message buffers are available or parameters are invalid.
|
otMessageFree
otUdpOpen
otError otUdpOpen( otInstance *aInstance, otUdpSocket *aSocket, otUdpReceive aCallback, void *aContext )
Open a UDP/IPv6 socket.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
otUdpNewMessage
otUdpClose
otUdpBind
otUdpConnect
otUdpSend
otUdpRemoveReceiver
otError otUdpRemoveReceiver( otInstance *aInstance, otUdpReceiver *aUdpReceiver )
This function removes a UDP receiver.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otUdpSend
otError otUdpSend( otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo *aMessageInfo )
Send a UDP/IPv6 message.
If the return value is OT_ERROR_NONE, OpenThread takes ownership of aMessage
, and the caller should no longer reference aMessage
. If the return value is not OT_ERROR_NONE, the caller retains ownership of aMessage
, including freeing aMessage
if the message buffer is no longer needed.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
Details | |||||
---|---|---|---|---|---|
Return Values |
|
otUdpNewMessage
otUdpOpen
otUdpClose
otUdpBind
otUdpConnect
otUdpSend
otUdpSendDatagram
otError otUdpSendDatagram( otInstance *aInstance, otMessage *aMessage, otMessageInfo *aMessageInfo )
This function sends a UDP message without socket.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|