From 80cae52441425fa68a618cf3c0366aa18ccb5da7 Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Fri, 9 Mar 2018 17:33:06 +0000 Subject: [PATCH] examples/coap-server.c: Update inline with new Observe functions As we are talking about Observe here --- examples/coap-server.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/examples/coap-server.c b/examples/coap-server.c index 917911e6..90c9f75b 100644 --- a/examples/coap-server.c +++ b/examples/coap-server.c @@ -292,11 +292,11 @@ init_resources(coap_context_t *ctx) { coap_register_handler(r, COAP_REQUEST_GET, hnd_get_time); coap_register_handler(r, COAP_REQUEST_PUT, hnd_put_time); coap_register_handler(r, COAP_REQUEST_DELETE, hnd_delete_time); + coap_resource_set_get_observable(r, 1); coap_add_attr(r, (unsigned char *)"ct", 2, (unsigned char *)"0", 1, 0); coap_add_attr(r, (unsigned char *)"title", 5, (unsigned char *)"\"Internal Clock\"", 16, 0); coap_add_attr(r, (unsigned char *)"rt", 2, (unsigned char *)"\"Ticks\"", 7, 0); - r->observable = 1; coap_add_attr(r, (unsigned char *)"if", 2, (unsigned char *)"\"clock\"", 7, 0); coap_add_resource(ctx, r); @@ -556,11 +556,6 @@ main(int argc, char **argv) { coap_ticks( &now ); check_async(ctx, now); #endif /* WITHOUT_ASYNC */ - -#ifndef WITHOUT_OBSERVE - /* check if we have to send observe notifications */ - coap_check_notify(ctx); -#endif /* WITHOUT_OBSERVE */ } coap_free_context(ctx);