39 #ifndef ER_COAP_ENGINE_H_
40 #define ER_COAP_ENGINE_H_
48 #define SERVER_LISTEN_PORT UIP_HTONS(COAP_SERVER_PORT)
50 typedef coap_packet_t rest_request_t;
51 typedef coap_packet_t rest_response_t;
53 void coap_init_engine(
void);
58 struct request_state_t {
60 struct process *process;
61 coap_transaction_t *transaction;
62 coap_packet_t *response;
66 typedef void (*blocking_response_handler)(
void *response);
69 (
struct request_state_t *state, process_event_t ev,
70 uip_ipaddr_t *remote_ipaddr, uint16_t remote_port,
71 coap_packet_t *request,
72 blocking_response_handler request_callback));
74 #define COAP_BLOCKING_REQUEST(server_addr, server_port, request, chunk_handler) \
76 static struct request_state_t request_state; \
77 PT_SPAWN(process_pt, &request_state.pt, \
78 coap_blocking_request(&request_state, ev, \
79 server_addr, server_port, \
80 request, chunk_handler) \
CoAP module for separate responses.
#define PT_THREAD(name_args)
Declaration of a protothread.
An implementation of the Constrained Application Protocol (RFC).
CoAP module for reliable transport
Protothreads implementation.
CoAP module for observing resources (draft-ietf-core-observe-11).