4 #define COAP_DATA_BUFF_SIZE 300
7 #include "coap-common.h"
12 #define MOTE_SERVER_LISTEN_PORT 61616
13 #define MOTE_CLIENT_LISTEN_PORT 61617
15 void parse_message(coap_packet_t* packet, uint8_t* buf, uint16_t size);
17 uint16_t coap_get_payload(coap_packet_t* packet, uint8_t** payload);
18 int coap_set_payload(coap_packet_t* packet, uint8_t* payload, uint16_t size);
20 content_type_t coap_get_header_content_type(coap_packet_t* packet);
21 int coap_set_header_content_type(coap_packet_t* packet, content_type_t content_type);
23 int coap_get_header_subscription_lifetime(coap_packet_t* packet, uint32_t* lifetime);
24 int coap_set_header_subscription_lifetime(coap_packet_t* packet, uint32_t lifetime);
26 int coap_get_header_block(coap_packet_t* packet, block_option_t* block);
27 int coap_set_header_block(coap_packet_t* packet, uint32_t number, uint8_t more, uint8_t size);
29 int coap_set_header_uri(coap_packet_t* packet,
char* uri);
30 int coap_set_header_etag(coap_packet_t* packet, uint8_t* etag, uint8_t size);
32 void coap_set_code(coap_packet_t* packet, status_code_t code);
34 coap_method_t coap_get_method(coap_packet_t* packet);
35 void coap_set_method(coap_packet_t* packet, coap_method_t method);
37 int coap_get_query_variable(coap_packet_t* packet,
const char *name,
char* output, uint16_t output_size);
38 int coap_get_post_variable(coap_packet_t* packet,
const char *name,
char* output, uint16_t output_size);
40 header_option_t* coap_get_option(coap_packet_t* packet, option_type option_type);
41 int coap_set_option(coap_packet_t* packet, option_type option_type, uint16_t len, uint8_t* value);
44 typedef int (*service_callback) (coap_packet_t* request, coap_packet_t* response);
49 void coap_set_service_callback(service_callback callback);
51 struct periodic_resource_t;
52 void resource_changed(
struct periodic_resource_t* resource);
#define PROCESS_NAME(name)
Declare the name of a process.