كواب
تتضمن هذه الوحدة وظائف تتحكم في اتصالات CoAP.
ملخّص
تتوفّر الدوال في هذه الوحدة عند تفعيل ميزة CoAP API (OPENTHREAD_CONFIG_COAP_API_ENABLE
).
أنواع المحددات |
|
---|---|
otCoapBlockSzx
|
typedefenum otCoapBlockSzx
أُسّ حجم كتلة CoAP |
otCoapBlockwiseReceiveHook)(void *aContext, const uint8_t *aBlock, uint32_t aPosition, uint16_t aBlockLength, bool aMore, uint32_t aTotalLength)
|
typedefotError(*
يتم طلب المؤشر عند استلام رسالة CoAP تتضمّن خيار نقل على مستوى الحظر. |
otCoapBlockwiseResource
|
typedefstruct otCoapBlockwiseResource
يمثّل مورد CoAP باستخدام عملية نقل الحظر. |
otCoapBlockwiseTransmitHook)(void *aContext, uint8_t *aBlock, uint32_t aPosition, uint16_t *aBlockLength, bool *aMore)
|
typedefotError(*
يتم استدعاء المؤشر قبل إرسال المجموعة التالية في عملية نقل مجمَّعة. |
otCoapCode
|
typedefenum otCoapCode
قيم رمز CoAP. |
otCoapOption
|
typedefstruct otCoapOption
يمثل خيار CoAP. |
otCoapOptionContentFormat
|
typedef رموز تنسيق محتوى CoAP |
otCoapOptionIterator
|
typedefstruct otCoapOptionIterator
يعمل كمكرر لخيارات CoAP. |
otCoapOptionType
|
typedefenum otCoapOptionType
أرقام خيارات CoAP |
otCoapRequestHandler)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
|
typedefvoid(*
يتم طلب المؤشر عند تلقّي طلب CoAP باستخدام مسار Uri-Path محدد. |
otCoapResource
|
typedefstruct otCoapResource
يمثّل مورد CoAP. |
otCoapResponseHandler)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, otError aResult)
|
typedefvoid(*
يتم استدعاء المؤشر عند تلقّي استجابة CoAP أو عند انتهاء مهلة الطلب. |
otCoapTxParameters
|
typedefstruct otCoapTxParameters
يمثل معلمات نقل CoAP. |
otCoapType
|
typedefenum otCoapType
قيم نوع CoAP (عدد صحيح بت غير موقّع) |
الدوال |
|
---|---|
otCoapAddBlockWiseResource(otInstance *aInstance, otCoapBlockwiseResource *aResource)
|
void
لإضافة مورد خاضع للحظر إلى خادم CoAP.
|
otCoapAddResource(otInstance *aInstance, otCoapResource *aResource)
|
void
لإضافة مورد إلى خادم CoAP.
|
otCoapBlockSizeFromExponent(otCoapBlockSzx aSize)
|
uint16_t
تحوِّل حقل SZX في خيار الحظر الكوري إلى حجم الوحدة الفعلي.
|
otCoapMessageAppendBlock1Option(otMessage *aMessage, uint32_t aNum, bool aMore, otCoapBlockSzx aSize)
|
تُرفِق خيار الحظر 1.
|
otCoapMessageAppendBlock2Option(otMessage *aMessage, uint32_t aNum, bool aMore, otCoapBlockSzx aSize)
|
تُرفِق خيار الحظر 2.
|
otCoapMessageAppendContentFormatOption(otMessage *aMessage, otCoapOptionContentFormat aContentFormat)
|
يُرفِق خيار CoAP بتنسيق المحتوى كما هو مُوضَّح في https://tools.ietf.org/html/rfc7252#page-92.
|
otCoapMessageAppendMaxAgeOption(otMessage *aMessage, uint32_t aMaxAge)
|
تُرفِق خيار الحد الأقصى للعمر.
|
otCoapMessageAppendObserveOption(otMessage *aMessage, uint32_t aObserve)
|
تُرفِق خيار "الملاحظة".
|
otCoapMessageAppendOption(otMessage *aMessage, uint16_t aNumber, uint16_t aLength, const void *aValue)
|
لإلحاق خيار CoAP في العنوان.
|
otCoapMessageAppendProxyUriOption(otMessage *aMessage, const char *aUriPath)
|
إلحاق خيار Proxy-Uri.
|
otCoapMessageAppendUintOption(otMessage *aMessage, uint16_t aNumber, uint32_t aValue)
|
تُرفِق خيار CoAP صحيح غير موقَّع على النحو المحدّد في https://tools.ietf.org/html/rfc7252#section-3.2.
|
otCoapMessageAppendUriPathOptions(otMessage *aMessage, const char *aUriPath)
|
لإلحاق خيار Uri-Path.
|
otCoapMessageAppendUriQueryOption(otMessage *aMessage, const char *aUriQuery)
|
لإلحاق خيار Uri-Query واحد.
|
otCoapMessageCodeToString(const otMessage *aMessage)
|
const char *
يتم عرض رمز CoAP كسلسلة يمكن للمستخدمين قراءتها.
|
otCoapMessageGenerateToken(otMessage *aMessage, uint8_t aTokenLength)
|
void
لضبط طول الرمز المميّز وتوزيع قيمته عشوائيًا.
|
otCoapMessageGetCode(const otMessage *aMessage)
|
تعرض قيمة الرمز.
|
otCoapMessageGetMessageId(const otMessage *aMessage)
|
uint16_t
عرض قيمة معرّف الرسالة.
|
otCoapMessageGetToken(const otMessage *aMessage)
|
const uint8_t *
عرض مؤشر إلى قيمة الرمز المميّز
|
otCoapMessageGetTokenLength(const otMessage *aMessage)
|
uint8_t
يعرض طول الرمز المميّز.
|
otCoapMessageGetType(const otMessage *aMessage)
|
تعرض قيمة Type.
|
otCoapMessageInit(otMessage *aMessage, otCoapType aType, otCoapCode aCode)
|
void
لإعداد عنوان CoAP.
|
otCoapMessageInitResponse(otMessage *aResponse, const otMessage *aRequest, otCoapType aType, otCoapCode aCode)
|
لإعداد رسالة رد.
|
otCoapMessageSetCode(otMessage *aMessage, otCoapCode aCode)
|
void
لضبط قيمة الرمز
|
otCoapMessageSetPayloadMarker(otMessage *aMessage)
|
يشير هذا الإعداد إلى "علامة الحمولة" التي تشير إلى بداية الحمولة إلى عنوان CoAP.
|
otCoapMessageSetToken(otMessage *aMessage, const uint8_t *aToken, uint8_t aTokenLength)
|
لضبط قيمة الرمز المميز وطوله في الرأس.
|
otCoapNewMessage(otInstance *aInstance, const otMessageSettings *aSettings)
|
إنشاء رسالة CoAP جديدة.
|
otCoapOptionIteratorGetFirstOption(otCoapOptionIterator *aIterator)
|
const otCoapOption *
عرض مؤشر للخيار الأول.
|
otCoapOptionIteratorGetFirstOptionMatching(otCoapOptionIterator *aIterator, uint16_t aOption)
|
const otCoapOption *
عرض مؤشر للخيار الأول الذي يطابق رقم الخيار المحدد.
|
otCoapOptionIteratorGetNextOption(otCoapOptionIterator *aIterator)
|
const otCoapOption *
عرض مؤشر للخيار التالي.
|
otCoapOptionIteratorGetNextOptionMatching(otCoapOptionIterator *aIterator, uint16_t aOption)
|
const otCoapOption *
عرض مؤشر للخيار التالي الذي يطابق رقم الخيار المحدد.
|
otCoapOptionIteratorGetOptionUintValue(otCoapOptionIterator *aIterator, uint64_t *aValue)
|
تملأ قيمة الخيار الحالية في
aValue مع افتراض أن القيمة الحالية هي عدد صحيح غير موقّع وفقًا لـ https://tools.ietf.org/html/rfc7252#section-3.2. |
otCoapOptionIteratorGetOptionValue(otCoapOptionIterator *aIterator, void *aValue)
|
تملأ قيمة الخيار الحالية في
aValue . |
otCoapOptionIteratorInit(otCoapOptionIterator *aIterator, const otMessage *aMessage)
|
يؤدي هذا الإجراء إلى إعداد مكرّر للخيارات في الرسالة المحدّدة.
|
otCoapRemoveBlockWiseResource(otInstance *aInstance, otCoapBlockwiseResource *aResource)
|
void
يؤدي هذا الخيار إلى إزالة مورِد حكم حظر من خادم CoAP.
|
otCoapRemoveResource(otInstance *aInstance, otCoapResource *aResource)
|
void
يؤدي هذا الإجراء إلى إزالة مورد من خادم CoAP.
|
otCoapSendRequest(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext)
|
يتم إرسال طلب CoAP.
|
otCoapSendRequestBlockWise(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook, otCoapBlockwiseReceiveHook aReceiveHook)
|
تُرسِل هذه السياسة طلبًا تحظر إمكانية الوصول إلى التطبيق.
|
otCoapSendRequestBlockWiseWithParameters(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext, const otCoapTxParameters *aTxParameters, otCoapBlockwiseTransmitHook aTransmitHook, otCoapBlockwiseReceiveHook aReceiveHook)
|
تُرسِل طلب CoAP بالاستناد إلى معايير النقل المخصَّصة.
|
otCoapSendRequestWithParameters(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext, const otCoapTxParameters *aTxParameters)
|
يتم إرسال طلب CoAP باستخدام معلمات نقل مخصّصة.
|
otCoapSendResponse(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo)
|
يتم إرسال استجابة CoAP من الخادم.
|
otCoapSendResponseBlockWise(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook)
|
تُرسِل استجابة CoAP محظورة من الخادم.
|
otCoapSendResponseBlockWiseWithParameters(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otCoapTxParameters *aTxParameters, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook)
|
يُرسِل استجابة CoAP من الخادم إلى الخادم من خلال معلَمات نقل مخصّصة.
|
otCoapSendResponseWithParameters(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otCoapTxParameters *aTxParameters)
|
يتم إرسال استجابة CoAP من الخادم باستخدام معلمات نقل مخصّصة.
|
otCoapSetDefaultHandler(otInstance *aInstance, otCoapRequestHandler aHandler, void *aContext)
|
void
لضبط المعالج التلقائي لطلبات CoAP التي لم تتم معالجتها
|
otCoapStart(otInstance *aInstance, uint16_t aPort)
|
يؤدي هذا الإجراء إلى بدء تشغيل خادم CoAP.
|
otCoapStop(otInstance *aInstance)
|
تعمل هذه السياسة على إيقاف خادم CoAP.
|
هياكل |
|
---|---|
otCoapBlockwiseResource |
يمثّل مورد CoAP باستخدام عملية نقل الحظر. |
otCoapOption |
يمثل خيار CoAP. |
otCoapOptionIterator |
يعمل كمكرر لخيارات CoAP. |
otCoapResource |
يمثّل مورد CoAP. |
otCoapTxParameters |
يمثل معلمات نقل CoAP. |
التعدادات
otCoapBlockSzx
otCoapBlockSzx
أُسّ حجم كتلة CoAP
otCoapCode
otCoapCode
قيم رمز CoAP.
otCoapOptionContentFormat
otCoapOptionContentFormat
رموز تنسيق محتوى CoAP
تم توثيق القائمة الكاملة على https://www.iana.org/assignments/core-PARAMs/core- parameterss.xhtml#content-formats
otCoapOptionType
otCoapOptionType
أرقام خيارات CoAP
أماكن إقامة | |
---|---|
OT_COAP_OPTION_ACCEPT
|
وعليك قبولها. |
OT_COAP_OPTION_BLOCK1
|
حظر 1 (RFC7959) |
OT_COAP_OPTION_BLOCK2
|
الكتلة 2 (RFC7959) |
OT_COAP_OPTION_CONTENT_FORMAT
|
تنسيق المحتوى |
OT_COAP_OPTION_E_TAG
|
علامة ETag |
OT_COAP_OPTION_IF_MATCH
|
إذا كانت النتيجة مطابقة. |
OT_COAP_OPTION_IF_NONE_MATCH
|
إذا لم يكن هناك أي مطابقة. |
OT_COAP_OPTION_LOCATION_PATH
|
مسار الموقع الجغرافي. |
OT_COAP_OPTION_LOCATION_QUERY
|
طلب البحث عن الموقع الجغرافي. |
OT_COAP_OPTION_MAX_AGE
|
الحد الأقصى للعمر |
OT_COAP_OPTION_OBSERVE
|
اطّلِع على [RFC7641]. |
OT_COAP_OPTION_PROXY_SCHEME
|
مخطط الخادم الوكيل. |
OT_COAP_OPTION_PROXY_URI
|
معرّف الموارد المنتظم (URI) للخادم الوكيل |
OT_COAP_OPTION_SIZE1
|
الحجم 1. |
OT_COAP_OPTION_SIZE2
|
الحجم 2 (RFC7959) |
OT_COAP_OPTION_URI_HOST
|
معرف الموارد المنتظم (URI) |
OT_COAP_OPTION_URI_PATH
|
Uri-Path. |
OT_COAP_OPTION_URI_PORT
|
Uri-Port. |
OT_COAP_OPTION_URI_QUERY
|
Uri-Query |
نوع otCoapType
otCoapType
قيم نوع CoAP (عدد صحيح بت غير موقّع)
أماكن إقامة | |
---|---|
OT_COAP_TYPE_ACKNOWLEDGMENT
|
إقرار |
OT_COAP_TYPE_CONFIRMABLE
|
يمكن تأكيده. |
OT_COAP_TYPE_NON_CONFIRMABLE
|
غير قابل للتأكيد |
OT_COAP_TYPE_RESET
|
إعادة الضبط. |
أنواع المحددات
otCoapBlockwisewiseHook
otError(* otCoapBlockwiseReceiveHook)(void *aContext, const uint8_t *aBlock, uint32_t aPosition, uint16_t aBlockLength, bool aMore, uint32_t aTotalLength)
يتم طلب المؤشر عند استلام رسالة CoAP تتضمّن خيار نقل على مستوى الحظر.
متاح عند تفعيل الإعداد OPENThread_CONFIG_COAP_BLOCKWISE_Transfer_ENABLE.
التفاصيل | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||||||||
قيم الإرجاع |
|
otCoapBlockwiseResource
struct otCoapBlockwiseResource otCoapBlockwiseResource
يمثّل مورد CoAP باستخدام عملية نقل الحظر.
otCoapBlockwiseTransmitHook
otError(* otCoapBlockwiseTransmitHook)(void *aContext, uint8_t *aBlock, uint32_t aPosition, uint16_t *aBlockLength, bool *aMore)
يتم استدعاء المؤشر قبل إرسال المجموعة التالية في عملية نقل مجمَّعة.
متاح عند تفعيل الإعداد OPENThread_CONFIG_COAP_BLOCKWISE_Transfer_ENABLE.
عند تغيير قيمة aBlockLength، تتم إعادة التفاوض على حجم الحظر الشامل. ننصحك بتنفيذ ذلك بعد تلقّي الحظر الأول، لأنّ التغييرات اللاحقة قد تتسبّب في حدوث مشاكل في عمليات تنفيذ بروتوكول CoAP الأخرى.
التفاصيل | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||||||
قيم الإرجاع |
|
otCoapOptionContentFormat
enum otCoapOptionContentFormat otCoapOptionContentFormat
رموز تنسيق محتوى CoAP
تم توثيق القائمة الكاملة على https://www.iana.org/assignments/core-PARAMs/core- parameterss.xhtml#content-formats
برنامج otCoapOptionIterator
struct otCoapOptionIterator otCoapOptionIterator
يعمل كمكرر لخيارات CoAP.
otCoapRequestHandler
void(* otCoapRequestHandler)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
يتم طلب المؤشر عند تلقّي طلب CoAP باستخدام مسار Uri-Path محدد.
التفاصيل | |||||||
---|---|---|---|---|---|---|---|
المَعلمات |
|
otCoapResponseHandler
void(* otCoapResponseHandler)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, otError aResult)
يتم استدعاء المؤشر عند تلقّي استجابة CoAP أو عند انتهاء مهلة الطلب.
التفاصيل | |||||||||
---|---|---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||||
قيم الإرجاع |
|
الدوال
otCoapAddBlockWiseResource
void otCoapAddBlockWiseResource( otInstance *aInstance, otCoapBlockwiseResource *aResource )
لإضافة مورد خاضع للحظر إلى خادم CoAP.
التفاصيل | |||||
---|---|---|---|---|---|
المَعلمات |
|
otCoapAddResource
void otCoapAddResource( otInstance *aInstance, otCoapResource *aResource )
لإضافة مورد إلى خادم CoAP.
التفاصيل | |||||
---|---|---|---|---|---|
المَعلمات |
|
otCoapBlockSizeFromExponent
uint16_t otCoapBlockSizeFromExponent( otCoapBlockSzx aSize )
تحوِّل حقل SZX في خيار الحظر الكوري إلى حجم الوحدة الفعلي.
التفاصيل | |||
---|---|---|---|
المَعلمات |
|
||
المرتجعات |
القيمة الأسية للحجم الفعلي.
|
otCoapMessageإضافةBlock1خيار
otError otCoapMessageAppendBlock1Option( otMessage *aMessage, uint32_t aNum, bool aMore, otCoapBlockSzx aSize )
تُرفِق خيار الحظر 1.
التفاصيل | |||||||||
---|---|---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||||
قيم الإرجاع |
|
otCoapMessageMessageBlock2خيار
otError otCoapMessageAppendBlock2Option( otMessage *aMessage, uint32_t aNum, bool aMore, otCoapBlockSzx aSize )
تُرفِق خيار الحظر 2.
التفاصيل | |||||||||
---|---|---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||||
قيم الإرجاع |
|
otCoapMessageإضافةContentFormatOption
otError otCoapMessageAppendContentFormatOption( otMessage *aMessage, otCoapOptionContentFormat aContentFormat )
يُرفِق خيار CoAP بتنسيق المحتوى كما هو مُوضَّح في https://tools.ietf.org/html/rfc7252#page-92.
يجب استدعاء هذه السياسة قبل ضبط otCoapMessageSetPayloadMarker إذا كان يجب تضمين الحمولة في الرسالة.
هذه الدالة هي برنامج تضمين صغير حول otCoapMessage ستظهرUintOption، وإذا لم يكن رمز نوع التنسيق المطلوب مُدرجًا في otCoapOptionContentFormat، يجب استخدام هذه الدالة الأساسية بدلاً من ذلك.
التفاصيل | |||||||
---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||
قيم الإرجاع |
|
otCoapMessageMessageMaxAgeOption
otError otCoapMessageAppendMaxAgeOption( otMessage *aMessage, uint32_t aMaxAge )
تُرفِق خيار الحد الأقصى للعمر.
التفاصيل | |||||||
---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||
قيم الإرجاع |
|
otCoapMessageAttachObserveOption
otError otCoapMessageAppendObserveOption( otMessage *aMessage, uint32_t aObserve )
تُرفِق خيار "الملاحظة".
التفاصيل | |||||||
---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||
قيم الإرجاع |
|
otCoapMessageMessageOption
otError otCoapMessageAppendOption( otMessage *aMessage, uint16_t aNumber, uint16_t aLength, const void *aValue )
لإلحاق خيار CoAP في العنوان.
التفاصيل | |||||||||
---|---|---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||||
قيم الإرجاع |
|
otCoapMessageإضافةProxyUriOption
otError otCoapMessageAppendProxyUriOption( otMessage *aMessage, const char *aUriPath )
إلحاق خيار Proxy-Uri.
التفاصيل | |||||||
---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||
قيم الإرجاع |
|
otCoapMessageMessageUintOption
otError otCoapMessageAppendUintOption( otMessage *aMessage, uint16_t aNumber, uint32_t aValue )
تُرفِق خيار CoAP صحيح غير موقَّع على النحو المحدّد في https://tools.ietf.org/html/rfc7252#section-3.2.
التفاصيل | |||||||
---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||
قيم الإرجاع |
|
otCoapMessageGetOptionUintValue
otCoapMessageMessageUriPathOptions
otError otCoapMessageAppendUriPathOptions( otMessage *aMessage, const char *aUriPath )
لإلحاق خيار Uri-Path.
التفاصيل | |||||||
---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||
قيم الإرجاع |
|
otCoapMessageMessageUriQueryOption
otError otCoapMessageAppendUriQueryOption( otMessage *aMessage, const char *aUriQuery )
لإلحاق خيار Uri-Query واحد.
التفاصيل | |||||||
---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||
قيم الإرجاع |
|
otCoapMessageCodeToString
const char * otCoapMessageCodeToString( const otMessage *aMessage )
يتم عرض رمز CoAP كسلسلة يمكن للمستخدمين قراءتها.
تعرض @ رمز CoAP كسلسلة.
التفاصيل | |||
---|---|---|---|
المَعلمات |
|
otCoapMessagegenerateToken
void otCoapMessageGenerateToken( otMessage *aMessage, uint8_t aTokenLength )
لضبط طول الرمز المميّز وتوزيع قيمته عشوائيًا.
التفاصيل | |||||
---|---|---|---|---|---|
المَعلمات |
|
otCoapMessageGetCode
otCoapCode otCoapMessageGetCode( const otMessage *aMessage )
تعرض قيمة الرمز.
التفاصيل | |||
---|---|---|---|
المَعلمات |
|
||
المرتجعات |
قيمة الرمز.
|
otCoapMessageGetMessageId
uint16_t otCoapMessageGetMessageId( const otMessage *aMessage )
عرض قيمة معرّف الرسالة.
التفاصيل | |||
---|---|---|---|
المَعلمات |
|
||
المرتجعات |
قيمة معرّف الرسالة.
|
otCoapMessageGetToken
const uint8_t * otCoapMessageGetToken( const otMessage *aMessage )
عرض مؤشر إلى قيمة الرمز المميّز
التفاصيل | |||
---|---|---|---|
المَعلمات |
|
||
المرتجعات |
مؤشر إلى قيمة الرمز المميّز.
|
otCoapMessageGetTokenLength
uint8_t otCoapMessageGetTokenLength( const otMessage *aMessage )
يعرض طول الرمز المميّز.
التفاصيل | |||
---|---|---|---|
المَعلمات |
|
||
المرتجعات |
طول الرمز المميز.
|
otCoapMessageGetType
otCoapType otCoapMessageGetType( const otMessage *aMessage )
تعرض قيمة Type.
التفاصيل | |||
---|---|---|---|
المَعلمات |
|
||
المرتجعات |
قيمة النوع.
|
otCoapMessageInit
void otCoapMessageInit( otMessage *aMessage, otCoapType aType, otCoapCode aCode )
لإعداد عنوان CoAP.
التفاصيل | |||||||
---|---|---|---|---|---|---|---|
المَعلمات |
|
otCoapMessageInitResponse
otError otCoapMessageInitResponse( otMessage *aResponse, const otMessage *aRequest, otCoapType aType, otCoapCode aCode )
لإعداد رسالة رد.
التفاصيل | |||||||||
---|---|---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||||
قيم الإرجاع |
|
otCoapMessageSetCode
void otCoapMessageSetCode( otMessage *aMessage, otCoapCode aCode )
لضبط قيمة الرمز
التفاصيل | |||||
---|---|---|---|---|---|
المَعلمات |
|
otCoapMessageSetLoadloadMarker
otError otCoapMessageSetPayloadMarker( otMessage *aMessage )
يشير هذا الإعداد إلى "علامة الحمولة" التي تشير إلى بداية الحمولة إلى عنوان CoAP.
التفاصيل | |||||
---|---|---|---|---|---|
المَعلمات |
|
||||
قيم الإرجاع |
|
otCoapMessageSetToken
otError otCoapMessageSetToken( otMessage *aMessage, const uint8_t *aToken, uint8_t aTokenLength )
لضبط قيمة الرمز المميز وطوله في الرأس.
التفاصيل | |||||||
---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||
قيم الإرجاع |
|
otCoapNewMessage
otMessage * otCoapNewMessage( otInstance *aInstance, const otMessageSettings *aSettings )
إنشاء رسالة CoAP جديدة.
التفاصيل | |||||
---|---|---|---|---|---|
المَعلمات |
|
||||
المرتجعات |
إشارة إلى المخزن المؤقت للرسائل أو إلى NULL إذا لم تتوفر أي مخازن رسائل مؤقتة أو كانت المعلمات غير صالحة.
|
otCoapOptionIteratorGetFirstOption
const otCoapOption * otCoapOptionIteratorGetFirstOption( otCoapOptionIterator *aIterator )
عرض مؤشر للخيار الأول.
التفاصيل | |||
---|---|---|---|
المَعلمات |
|
||
المرتجعات |
يشير إلى الخيار الأول. وإذا لم يكن هناك أي خيار، سيتم عرض مؤشر NULL.
|
otCoapOptionIteratorGetFirstOption Match
const otCoapOption * otCoapOptionIteratorGetFirstOptionMatching( otCoapOptionIterator *aIterator, uint16_t aOption )
عرض مؤشر للخيار الأول الذي يطابق رقم الخيار المحدد.
التفاصيل | |||||
---|---|---|---|---|---|
المَعلمات |
|
||||
المرتجعات |
يشير إلى أول خيار مطابقة. في حال عدم توفّر خيار مطابقة، سيتم عرض مؤشر NULL.
|
otCoapOptionIteratorGetNextOption
const otCoapOption * otCoapOptionIteratorGetNextOption( otCoapOptionIterator *aIterator )
عرض مؤشر للخيار التالي.
التفاصيل | |||
---|---|---|---|
المَعلمات |
|
||
المرتجعات |
مؤشر للخيار التالي. وإذا لم تكن هناك خيارات أخرى، سيتم عرض مؤشر NULL.
|
otCoapOptionIteratorGetNextOptionالمطابقة
const otCoapOption * otCoapOptionIteratorGetNextOptionMatching( otCoapOptionIterator *aIterator, uint16_t aOption )
عرض مؤشر للخيار التالي الذي يطابق رقم الخيار المحدد.
التفاصيل | |||||
---|---|---|---|---|---|
المَعلمات |
|
||||
المرتجعات |
مؤشر إلى خيار المطابقة التالي. وإذا لم يكن هناك أي خيار مطابق آخر، سيتم عرض المؤشر NULL.
|
otCoapOptionIteratorGetOptionUintValue
otError otCoapOptionIteratorGetOptionUintValue( otCoapOptionIterator *aIterator, uint64_t *aValue )
تملأ قيمة الخيار الحالية في aValue
مع افتراض أن القيمة الحالية هي عدد صحيح غير موقّع وفقًا لـ https://tools.ietf.org/html/rfc7252#section-3.2.
التفاصيل | |||||||
---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||
قيم الإرجاع |
|
otCoapMessageAttachUintOption
otCoapOptionIteratorGetOptionValue
otError otCoapOptionIteratorGetOptionValue( otCoapOptionIterator *aIterator, void *aValue )
تملأ قيمة الخيار الحالية في aValue
.
التفاصيل | |||||
---|---|---|---|---|---|
المَعلمات |
|
||||
قيم الإرجاع |
|
otCoapOptionIteratorInit
otError otCoapOptionIteratorInit( otCoapOptionIterator *aIterator, const otMessage *aMessage )
يؤدي هذا الإجراء إلى إعداد مكرّر للخيارات في الرسالة المحدّدة.
التفاصيل | |||||
---|---|---|---|---|---|
المَعلمات |
|
||||
قيم الإرجاع |
|
otCoapRemoveBlockWiseResource
void otCoapRemoveBlockWiseResource( otInstance *aInstance, otCoapBlockwiseResource *aResource )
يؤدي هذا الخيار إلى إزالة مورِد حكم حظر من خادم CoAP.
التفاصيل | |||||
---|---|---|---|---|---|
المَعلمات |
|
otCoapRemoveResource
void otCoapRemoveResource( otInstance *aInstance, otCoapResource *aResource )
يؤدي هذا الإجراء إلى إزالة مورد من خادم CoAP.
التفاصيل | |||||
---|---|---|---|---|---|
المَعلمات |
|
otCoapSendRequest
otError otCoapSendRequest( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext )
يتم إرسال طلب CoAP.
إذا كان من المتوقّع تلقّي ردّ على طلب، يجب تقديم معلومات حول الدالة والسياق. إذا لم يكن من المتوقع الحصول على رد، يجب أن تكون هذه الوسيطات عبارة عن مؤشرات NULL.
التفاصيل | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||||||
قيم الإرجاع |
|
otCoapSendRequestBlockWise
otError otCoapSendRequestBlockWise( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook, otCoapBlockwiseReceiveHook aReceiveHook )
تُرسِل هذه السياسة طلبًا تحظر إمكانية الوصول إلى التطبيق.
متاح عند تفعيل الإعداد OPENThread_CONFIG_COAP_BLOCKWISE_Transfer_ENABLE.
إذا كان من المتوقّع تلقّي ردّ على طلب، يجب تقديم معلومات حول الدالة والسياق. وإذا كان من المتوقّع أن تكون الاستجابة عبارة عن حظر، يجب توفير وظيفة ربط. إذا لم يكن من المتوقع الحصول على رد، يجب أن تكون هذه الوسيطات عبارة عن مؤشرات NULL.
التفاصيل | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||||||||||
قيم الإرجاع |
|
otCoapSendRequestBlockWiseWithParameters
otError otCoapSendRequestBlockWiseWithParameters( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext, const otCoapTxParameters *aTxParameters, otCoapBlockwiseTransmitHook aTransmitHook, otCoapBlockwiseReceiveHook aReceiveHook )
تُرسِل طلب CoAP بالاستناد إلى معايير النقل المخصَّصة.
متاح عند تفعيل الإعداد OPENThread_CONFIG_COAP_BLOCKWISE_Transfer_ENABLE.
إذا كان من المتوقّع تلقّي ردّ على طلب، يجب تقديم معلومات حول الدالة والسياق. وإذا كان من المتوقّع أن تكون الاستجابة عبارة عن حظر، يجب توفير وظيفة ربط. إذا لم يكن من المتوقع الحصول على رد، يجب أن تكون هذه الوسيطات عبارة عن مؤشرات NULL.
التفاصيل | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||||||||||||
قيم الإرجاع |
|
otCoapSendRequestWithParameters
otError otCoapSendRequestWithParameters( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext, const otCoapTxParameters *aTxParameters )
يتم إرسال طلب CoAP باستخدام معلمات نقل مخصّصة.
إذا كان من المتوقّع تلقّي ردّ على طلب، يجب تقديم معلومات حول الدالة والسياق. إذا لم يكن من المتوقع الحصول على رد، يجب أن تكون هذه الوسيطات عبارة عن مؤشرات NULL.
التفاصيل | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||||||||
قيم الإرجاع |
|
otCoapSendResponse
otError otCoapSendResponse( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo )
يتم إرسال استجابة CoAP من الخادم.
التفاصيل | |||||||
---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||
قيم الإرجاع |
|
otCoapSendResponseBlockWise
otError otCoapSendResponseBlockWise( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook )
تُرسِل استجابة CoAP محظورة من الخادم.
متاح عند تفعيل الإعداد OPENThread_CONFIG_COAP_BLOCKWISE_Transfer_ENABLE.
التفاصيل | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||||||
قيم الإرجاع |
|
otCoapSendResponseBlockWiseWithParameters
otError otCoapSendResponseBlockWiseWithParameters( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otCoapTxParameters *aTxParameters, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook )
يُرسِل استجابة CoAP من الخادم إلى الخادم من خلال معلَمات نقل مخصّصة.
متاح عند تفعيل الإعداد OPENThread_CONFIG_COAP_BLOCKWISE_Transfer_ENABLE.
التفاصيل | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||||||||
قيم الإرجاع |
|
otCoapSendResponseWithParameters
otError otCoapSendResponseWithParameters( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otCoapTxParameters *aTxParameters )
يتم إرسال استجابة CoAP من الخادم باستخدام معلمات نقل مخصّصة.
التفاصيل | |||||||||
---|---|---|---|---|---|---|---|---|---|
المَعلمات |
|
||||||||
قيم الإرجاع |
|
otCoapSetDefaultHandler
void otCoapSetDefaultHandler( otInstance *aInstance, otCoapRequestHandler aHandler, void *aContext )
لضبط المعالج التلقائي لطلبات CoAP التي لم تتم معالجتها
التفاصيل | |||||||
---|---|---|---|---|---|---|---|
المَعلمات |
|
برنامج CoCoapStart
otError otCoapStart( otInstance *aInstance, uint16_t aPort )
يؤدي هذا الإجراء إلى بدء تشغيل خادم CoAP.
التفاصيل | |||||
---|---|---|---|---|---|
المَعلمات |
|
||||
قيم الإرجاع |
|
برنامج otCoapStop
otError otCoapStop( otInstance *aInstance )
تعمل هذه السياسة على إيقاف خادم CoAP.
التفاصيل | |||
---|---|---|---|
المَعلمات |
|
||
قيم الإرجاع |
|
وحدات ماكرو
OT_COAP_CODE
OT_COAP_CODE ((((c)&0x7) << 5) | ((d)&0x1f))
وحدة ماكرو مساعدة لتحديد قيم رمز CoAP
OT_COAP_DEFAULT_TOKEN_LENGTH
OT_COAP_DEFAULT_TOKEN_LENGTH 2
طول الرمز المميز التلقائي.
الوقت الإضافي: CO_COAP_MAX_RETRANSMIT
OT_COAP_MAX_RETRANSMIT 20
الحد الأقصى لإعادة الإرسال المتوافق مع OpenThread.
الوقت الإضافي CO_COAP_MAX_TOKEN_LENGTH
OT_COAP_MAX_TOKEN_LENGTH 8
الحد الأقصى لطول الرمز المميّز كما هو محدّد (RFC 7252).
الوقت الإضافي CO_COAP_MIN_ACK_ {8/}
OT_COAP_MIN_ACK_TIMEOUT 1000
الحد الأدنى لمهلة ACK بالملي ثانية التي يدعمها OpenThread.
OT_DEFAULT_COAP_PORT
OT_DEFAULT_COAP_PORT 5683
منفذ CoAP التلقائي، على النحو المحدَّد في RFC 7252.
الموارد
تبدأ مواضيع مراجع واجهة برمجة تطبيقات OpenThread من رمز المصدر، وهو متاح على GitHub. للحصول على مزيد من المعلومات أو للمساهمة في المستندات، يمكنك الاطّلاع على المراجع.