1 #include <coap.h>
2 
3 coap_context_t *main_coap_context;
4 
server_coap_init(void)5 void server_coap_init(void)
6 {
7 	coap_address_t listenaddress;
8 
9 	coap_address_init(&listenaddress);
10 
11 	/* looks like a server address, but is used as end point for clients too */
12 	listenaddress.addr = *(IP_ADDR_ANY);
13 	listenaddress.port = COAP_DEFAULT_PORT;
14 
15 	main_coap_context = coap_new_context(&listenaddress);
16 
17 	LWIP_ASSERT("Failed to initialize context", main_coap_context != NULL);
18 }
19 
server_coap_poll(void)20 void server_coap_poll(void)
21 {
22 	coap_check_notify(main_coap_context);
23 }
24