This module includes functions that control CoAP communication. More...
Data Structures | |
struct | otCoapOption |
struct | otCoapHeader |
struct | otCoapResource |
Macros | |
#define | OT_DEFAULT_COAP_PORT 5683 |
Default CoAP port, as specified in RFC 7252. | |
#define | OT_COAP_HEADER_MAX_LENGTH 128 |
Max CoAP header length (bytes) | |
Typedefs | |
typedef enum otCoapType | otCoapType |
typedef enum otCoapCode | otCoapCode |
typedef enum otCoapOptionType | otCoapOptionType |
typedef struct otCoapOption | otCoapOption |
typedef struct otCoapHeader | otCoapHeader |
typedef void(* | otCoapResponseHandler )(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError aResult) |
typedef void(* | otCoapRequestHandler )(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) |
typedef struct otCoapResource | otCoapResource |
Enumerations | |
enum | otCoapType { kCoapTypeConfirmable = 0x00, kCoapTypeNonConfirmable = 0x10, kCoapTypeAcknowledgment = 0x20, kCoapTypeReset = 0x30 } |
enum | otCoapCode { kCoapCodeEmpty = 0x00, kCoapRequestGet = 0x01, kCoapRequestPost = 0x02, kCoapRequestPut = 0x03, kCoapRequestDelete = 0x04, kCoapResponseCodeMin = 0x40, kCoapResponseCreated = 0x41, kCoapResponseDeleted = 0x42, kCoapResponseValid = 0x43, kCoapResponseChanged = 0x44, kCoapResponseContent = 0x45 } |
enum | otCoapOptionType { kCoapOptionObserve = 6, kCoapOptionUriPath = 11, kCoapOptionContentFormat = 12, kCoapOptionMaxAge = 14, kCoapOptionUriQuery = 15 } |
This module includes functions that control CoAP communication.
typedef enum otCoapCode otCoapCode |
CoAP Code values.
typedef struct otCoapHeader otCoapHeader |
This structure represents a CoAP header.
typedef struct otCoapOption otCoapOption |
This structure represents a CoAP option.
typedef enum otCoapOptionType otCoapOptionType |
CoAP Option Numbers
typedef void(* otCoapRequestHandler)(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) |
This function pointer is called when a CoAP request with a given Uri-Path is received.
[in] | aContext | A pointer to arbitrary context information. |
[in] | aHeader | A pointer to the CoAP header. |
[in] | aMessage | A pointer to the message. |
[in] | aMessageInfo | A pointer to the message info for aMessage . |
typedef struct otCoapResource otCoapResource |
This structure represents a CoAP resource.
typedef void(* otCoapResponseHandler)(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError aResult) |
This function pointer is called when a CoAP response is received or on the request timeout.
[in] | aContext | A pointer to application-specific context. |
[in] | aHeader | A pointer to the received CoAP header. NULL if no response was received. |
[in] | aMessage | A pointer to the message buffer containing the response. NULL if no response was received. |
[in] | aMessageInfo | A pointer to the message info for aMessage . NULL if no response was received. |
[in] | aResult | A result of the CoAP transaction. |
kThreadError_None | A response was received successfully. |
kThreadError_Abort | A CoAP transaction was reseted by peer. |
kThreadError_ResponseTimeout | No response or acknowledgment received during timeout period. |
typedef enum otCoapType otCoapType |
CoAP Type values.
enum otCoapCode |
CoAP Code values.
enum otCoapOptionType |
enum otCoapType |