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(*
تسمح معاودة الاتصال هذه لـ 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
|
واجهة "العمود الرئيسي". |
OT_NETIF_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 من رمز المصدر المتاح على GitHub. للحصول على مزيد من المعلومات أو للمساهمة في مستنداتنا، يمكنك الاطّلاع على المراجع.