39 #ifndef ER_COAP_ENGINE_H_
40 #define ER_COAP_ENGINE_H_
47 #include "er-coap-observe-client.h"
49 #define SERVER_LISTEN_PORT UIP_HTONS(COAP_SERVER_PORT)
51 typedef coap_packet_t rest_request_t;
52 typedef coap_packet_t rest_response_t;
54 void coap_init_engine(
void);
59 struct request_state_t {
61 struct process *process;
62 coap_transaction_t *transaction;
63 coap_packet_t *response;
67 typedef void (*blocking_response_handler)(
void *response);
70 (
struct request_state_t *state, process_event_t ev,
71 uip_ipaddr_t *remote_ipaddr, uint16_t remote_port,
72 coap_packet_t *request,
73 blocking_response_handler request_callback));
75 #define COAP_BLOCKING_REQUEST(server_addr, server_port, request, chunk_handler) \
77 static struct request_state_t request_state; \
78 PT_SPAWN(process_pt, &request_state.pt, \
79 coap_blocking_request(&request_state, ev, \
80 server_addr, server_port, \
81 request, chunk_handler) \
Protothreads implementation.
CoAP module for observing resources (draft-ietf-core-observe-11).
CoAP module for reliable transport
#define PT_THREAD(name_args)
Declaration of a protothread.
An implementation of the Constrained Application Protocol (RFC).
CoAP module for separate responses.