UDP
このモジュールには、UDP 通信を制御する関数が含まれています。
概要
列挙型 |
|
---|---|
otNetifIdentifier{
|
列挙型 この列挙型は、OpenThread ネットワーク インターフェース識別子を定義します。 |
Typedef |
|
---|---|
otNetifIdentifier
|
typedefenum otNetifIdentifier
この列挙型は、OpenThread ネットワーク インターフェース識別子を定義します。 |
otUdpHandler)(void *aContext, const otMessage *aMessage, const otMessageInfo *aMessageInfo)
|
typedefbool(*
このコールバックにより、OpenThread は特定の UDP メッセージに特定のハンドラを提供できます。 |
otUdpReceive)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
|
typedefvoid(*
このコールバックにより、OpenThread は受信した UDP メッセージをアプリに知らせることができます。 |
otUdpReceiver
|
typedefstruct otUdpReceiver
この構造は、UDP レシーバーを表します。 |
otUdpSocket
|
typedefstruct otUdpSocket
この構造は、UDP ソケットを表します。 |
関数 |
|
---|---|
otUdpAddReceiver(otInstance *aInstance, otUdpReceiver *aUdpReceiver)
|
この関数は、UDP レシーバーを追加します。
|
otUdpBind(otInstance *aInstance, otUdpSocket *aSocket, const otSockAddr *aSockName, otNetifIdentifier aNetif)
|
UDP/IPv6 ソケットをバインドします。
|
otUdpClose(otInstance *aInstance, otUdpSocket *aSocket)
|
UDP/IPv6 ソケットを閉じます。
|
otUdpConnect(otInstance *aInstance, otUdpSocket *aSocket, const otSockAddr *aSockName)
|
UDP/IPv6 ソケットを接続します。
|
otUdpGetSockets(otInstance *aInstance)
|
この関数は、UDP ソケットのリンクリストの先頭を取得します。
|
otUdpIsOpen(otInstance *aInstance, const otUdpSocket *aSocket)
|
bool
UDP ソケットが開いているかどうかを確認します。
|
otUdpNewMessage(otInstance *aInstance, const otMessageSettings *aSettings)
|
UDP メッセージを送信するための新しいメッセージ バッファを割り当てます。
|
otUdpOpen(otInstance *aInstance, otUdpSocket *aSocket, otUdpReceive aCallback, void *aContext)
|
UDP/IPv6 ソケットを開きます。
|
otUdpRemoveReceiver(otInstance *aInstance, otUdpReceiver *aUdpReceiver)
|
この関数は、UDP レシーバーを削除します。
|
otUdpSend(otInstance *aInstance, otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo *aMessageInfo)
|
UDP/IPv6 メッセージを送信します。
|
otUdpSendDatagram(otInstance *aInstance, otMessage *aMessage, otMessageInfo *aMessageInfo)
|
この関数は、ソケットを使用せずに UDP メッセージを送信します。
|
構造体 |
|
---|---|
otUdpReceiver |
この構造は、UDP レシーバーを表します。 |
otUdpSocket |
この構造は、UDP ソケットを表します。 |
列挙型
otNetifIdentifier
otNetifIdentifier
この列挙型は、OpenThread ネットワーク インターフェース識別子を定義します。
プロパティ | |
---|---|
OT_NETIF_BACKBONE
|
Backbone インターフェース。 |
OT_NETIF_THREAD
|
スレッド インターフェース。 |
OT_NETIF_UNSPECIFIED
|
不明なネットワーク インターフェースです。 |
Typedef
otNetifIdentifier
enum otNetifIdentifier otNetifIdentifier
この列挙型は、OpenThread ネットワーク インターフェース識別子を定義します。
otUdpHandler
bool(* otUdpHandler)(void *aContext, const otMessage *aMessage, const otMessageInfo *aMessageInfo)
このコールバックにより、OpenThread は特定の UDP メッセージに特定のハンドラを提供できます。
詳細 | |||||
---|---|---|---|---|---|
戻り値 |
|
otUdpReceive
void(* otUdpReceive)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
このコールバックにより、OpenThread は受信した UDP メッセージをアプリに知らせることができます。
関数
otUdpAddReceiver
otError otUdpAddReceiver( otInstance *aInstance, otUdpReceiver *aUdpReceiver )
この関数は、UDP レシーバーを追加します。
詳細 | |||||
---|---|---|---|---|---|
パラメータ |
|
||||
戻り値 |
|
otUdpBind
otError otUdpBind( otInstance *aInstance, otUdpSocket *aSocket, const otSockAddr *aSockName, otNetifIdentifier aNetif )
UDP/IPv6 ソケットをバインドします。
詳細 | |||||||||
---|---|---|---|---|---|---|---|---|---|
パラメータ |
|
||||||||
戻り値 |
|
otUdpClose
otError otUdpClose( otInstance *aInstance, otUdpSocket *aSocket )
UDP/IPv6 ソケットを閉じます。
詳細 | |||||
---|---|---|---|---|---|
パラメータ |
|
||||
戻り値 |
|
otUdpConnect
otError otUdpConnect( otInstance *aInstance, otUdpSocket *aSocket, const otSockAddr *aSockName )
UDP/IPv6 ソケットを接続します。
詳細 | |||||||
---|---|---|---|---|---|---|---|
パラメータ |
|
||||||
戻り値 |
|
otUdpGetSockets(OTUdpGetSockets)
otUdpSocket * otUdpGetSockets( otInstance *aInstance )
この関数は、UDP ソケットのリンクリストの先頭を取得します。
詳細 | |||
---|---|---|---|
パラメータ |
|
||
戻り値 |
UDP ソケット リンクリストの先頭へのポインタ。
|
otUdpIsOpen
bool otUdpIsOpen( otInstance *aInstance, const otUdpSocket *aSocket )
UDP ソケットが開いているかどうかを確認します。
詳細 | |||||
---|---|---|---|---|---|
パラメータ |
|
||||
戻り値 |
UDP ソケットが開いているかどうか。
|
otUdpNewMessage
otMessage * otUdpNewMessage( otInstance *aInstance, const otMessageSettings *aSettings )
UDP メッセージを送信するための新しいメッセージ バッファを割り当てます。
詳細 | |||||
---|---|---|---|---|---|
パラメータ |
|
||||
戻り値 |
メッセージ バッファへのポインタ。使用可能なメッセージ バッファがない場合やパラメータが無効な場合は NULL。
|
otMessageFree
otUdpOpen
otError otUdpOpen( otInstance *aInstance, otUdpSocket *aSocket, otUdpReceive aCallback, void *aContext )
UDP/IPv6 ソケットを開きます。
詳細 | |||||||||
---|---|---|---|---|---|---|---|---|---|
パラメータ |
|
||||||||
戻り値 |
|
otUdpRemoveReceiver(OTUdpRemoveReceiver)
otError otUdpRemoveReceiver( otInstance *aInstance, otUdpReceiver *aUdpReceiver )
この関数は、UDP レシーバーを削除します。
詳細 | |||||
---|---|---|---|---|---|
パラメータ |
|
||||
戻り値 |
|
otUdpSend
otError otUdpSend( otInstance *aInstance, otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo *aMessageInfo )
UDP/IPv6 メッセージを送信します。
戻り値が OT_ERROR_NONE の場合、OpenThread は aMessage
の所有権を取得し、呼び出し元は aMessage
を参照できなくなります。戻り値が OT_ERROR_NONE でない場合、呼び出し元は aMessage
の所有権を保持します。メッセージ バッファが不要になったら、aMessage
を解放できます。
詳細 | |||||||||
---|---|---|---|---|---|---|---|---|---|
パラメータ |
|
詳細 | |||||||
---|---|---|---|---|---|---|---|
戻り値 |
|
otUdpSendDatagram
otError otUdpSendDatagram( otInstance *aInstance, otMessage *aMessage, otMessageInfo *aMessageInfo )
この関数は、ソケットを使用せずに UDP メッセージを送信します。
詳細 | |||||||
---|---|---|---|---|---|---|---|
パラメータ |
|
||||||
戻り値 |
|
リソース
OpenThread API リファレンスのトピックは、GitHub で入手可能なソースコードに基づいています。 詳細またはドキュメントへの投稿については、リソースをご覧ください。