UDP
מודול זה כולל פונקציות ששולטות בתקשורת UDP.
סיכום
הדמיות |
|
---|---|
otNetifIdentifier{
|
טיפוסים בני מנייה (enum) ספירה זו מגדירה את מזהי הממשק של הרשת של OpenThread. |
סוג מגן |
|
---|---|
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
|
הממשק של Thread. |
OT_NETIF_UNSPECIFIED
|
ממשק הרשת לא צוין. |
סוג מגן
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
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
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. למידע נוסף או כדי לתרום לתיעוד שלנו, יש לעיין בקטע משאבים.