OpenWSN Firmware
|
Data Structures | |
struct | coap_header_iht |
struct | coap_option_iht |
struct | coap_resource_desc_t |
struct | opencoap_vars_t |
Macros | |
#define | MAX_COAP_OPTIONS 10 |
the maximum number of options in a RX'ed CoAP message More... | |
#define | COAP_MAX_TKL 8 |
#define | COAP_PAYLOAD_MARKER 0xFF |
#define | COAP_VERSION 1 |
Typedefs | |
typedef owerror_t(* | callbackRx_cbt )(OpenQueueEntry_t *msg, coap_header_iht *coap_header, coap_option_iht *coap_options) |
typedef void(* | callbackSendDone_cbt )(OpenQueueEntry_t *msg, owerror_t error) |
typedef struct coap_resource_desc_t | coap_resource_desc_t |
Functions | |
void | opencoap_init (void) |
Initialize this module. More... | |
void | opencoap_receive (OpenQueueEntry_t *msg) |
Indicate a CoAP messages was received. More... | |
void | opencoap_sendDone (OpenQueueEntry_t *msg, owerror_t error) |
Indicates that the CoAP response has been sent. More... | |
void | opencoap_writeLinks (OpenQueueEntry_t *msg) |
Writes the links to all the resources on this mote into the message. More... | |
void | opencoap_register (coap_resource_desc_t *desc) |
Register a new CoAP resource. More... | |
owerror_t | opencoap_send (OpenQueueEntry_t *msg, coap_type_t type, coap_code_t code, uint8_t numOptions, coap_resource_desc_t *descSender) |
Send a CoAP request. More... | |
#define COAP_MAX_TKL 8 |
#define COAP_PAYLOAD_MARKER 0xFF |
#define COAP_VERSION 1 |
#define MAX_COAP_OPTIONS 10 |
the maximum number of options in a RX'ed CoAP message
typedef owerror_t(* callbackRx_cbt)(OpenQueueEntry_t *msg, coap_header_iht *coap_header, coap_option_iht *coap_options) |
typedef void(* callbackSendDone_cbt)(OpenQueueEntry_t *msg, owerror_t error) |
typedef struct coap_resource_desc_t coap_resource_desc_t |
enum coap_code_t |
enum coap_media_type_t |
enum coap_option_t |
enum coap_type_t |
void opencoap_init | ( | void | ) |
Initialize this module.
void opencoap_receive | ( | OpenQueueEntry_t * | msg | ) |
Indicate a CoAP messages was received.
A "CoAP message" is simply a UDP datagram received on the CoAP UDP port.
This function will call the appropriate resource, and send back its answer. The received packetbuffer is reused to contain the response (or error code).
[in] | msg | The received CoAP message. |
void opencoap_register | ( | coap_resource_desc_t * | desc | ) |
Register a new CoAP resource.
This function is called by a CoAP resource when it starts, allowing it to receive data sent to that resource.
Registration consists in adding a new resource at the end of the linked list of resources.
[in] | desc | The description of the CoAP resource. |
owerror_t opencoap_send | ( | OpenQueueEntry_t * | msg, |
coap_type_t | type, | ||
coap_code_t | code, | ||
uint8_t | TKL, | ||
coap_resource_desc_t * | descSender | ||
) |
Send a CoAP request.
This function is called by a CoAP resource when it wants to send some data. This function is NOT called for a response.
[in] | msg | The message to be sent. This messages should not contain the CoAP header. |
[in] | type | The CoAP type of the message. |
[in] | code | The CoAP code of the message. |
[in] | TKL | The Token Length of the message. |
[out] | descSender | A pointer to the description of the calling CoAP resource. |
void opencoap_sendDone | ( | OpenQueueEntry_t * | msg, |
owerror_t | error | ||
) |
Indicates that the CoAP response has been sent.
[in] | msg | A pointer to the message which was sent. |
[in] | error | The outcome of the send function. |
void opencoap_writeLinks | ( | OpenQueueEntry_t * | msg | ) |
Writes the links to all the resources on this mote into the message.
[out] | msg | The messge to write the links to. |