UDP
تتضمن هذه الوحدة وظائف تتحكم في اتصال UDP.
ملخّص
التعدادات |
|
---|---|
otNetifIdentifier{
|
تعداد تحدّد معرّفات واجهة شبكة 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(*
تسمح معاودة الاتصال هذه لسلسلة المحادثات بإبلاغ تطبيق رسالة 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 بدون مقبس.
|
هياكل |
|
---|---|
otUdpReceivedr |
يمثل جهاز استقبال UDP. |
otUdpSocket |
يمثل مقبس UDP. |
التعدادات
otNetifidentifier
otNetifIdentifier
تحدّد معرّفات واجهة شبكة OpenThread.
أماكن إقامة | |
---|---|
OT_NETIF_BACKBONE
|
واجهة الخلفية |
OT_NETIF_THREAD
|
واجهة Thread. |
OT_NETIF_UNSPECIFIED
|
واجهة شبكة غير محدّدة |
أنواع المحددات
OtddHandler
bool(* otUdpHandler)(void *aContext, const otMessage *aMessage, const otMessageInfo *aMessageInfo)
تسمح معاودة الاتصال هذه لـ OpenThread بتقديم معالجات معينة لرسائل UDP معيَّنة.
التفاصيل | |||||
---|---|---|---|---|---|
قيم الإرجاع |
|
OtudPاستلام
void(* otUdpReceive)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
تسمح معاودة الاتصال هذه لسلسلة المحادثات بإبلاغ تطبيق رسالة UDP مستلَمة.
الدوال
otUdpAdd الاستلام
otError otUdpAddReceiver( otInstance *aInstance, otUdpReceiver *aUdpReceiver )
لإضافة جهاز استقبال UDP.
التفاصيل | |||||
---|---|---|---|---|---|
المَعلمات |
|
||||
قيم الإرجاع |
|
OtudpBind
otError otUdpBind( otInstance *aInstance, otUdpSocket *aSocket, const otSockAddr *aSockName, otNetifIdentifier aNetif )
اربط مقبس UDP/IPv6.
التفاصيل | |||||||||
---|---|---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||||
قيم الإرجاع |
|
otUdpإغلاق
otError otUdpClose( otInstance *aInstance, otUdpSocket *aSocket )
إغلاق مقبس UDP/IPv6
التفاصيل | |||||
---|---|---|---|---|---|
المَعلمات |
|
||||
قيم الإرجاع |
|
OtudpConnect
otError otUdpConnect( otInstance *aInstance, otUdpSocket *aSocket, const otSockAddr *aSockName )
وصِّل مقبس UDP/IPv6.
التفاصيل | |||||||
---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||
قيم الإرجاع |
|
UtpGetSockets
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
Otdd Open
otError otUdpOpen( otInstance *aInstance, otUdpSocket *aSocket, otUdpReceive aCallback, void *aContext )
افتح مقبس UDP/IPv6.
التفاصيل | |||||||||
---|---|---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||||
قيم الإرجاع |
|
otUdpإزالة وحدة الاستقبال
otError otUdpRemoveReceiver( otInstance *aInstance, otUdpReceiver *aUdpReceiver )
إزالة جهاز استقبال UDP
التفاصيل | |||||
---|---|---|---|---|---|
المَعلمات |
|
||||
قيم الإرجاع |
|
UtpSend
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 من رمز المصدر، وهو متاح على GitHub. للحصول على مزيد من المعلومات أو للمساهمة في المستندات، يمكنك الاطّلاع على المراجع.