Support cancellation of observe relationships using GET w/ Observe: 1.

Adding and removal of observes is now handled by libcoap. The application's
GET handler only needs to add the Observe option (see server.c:hnd_get_time()).
This commit is contained in:
Olaf Bergmann committed 2014-03-09 02:27:52 +00:00
1 parent 1b3aa704e6
commit a3fae3ce3a
7 files changed
+108 -34

No files matched your search

+3
View File
@@ -737,6 +737,9 @@ coap_notify_observers(coap_context_t *context, coap_resource_t *r) {
/* fill with observer-specific data */
h(context, r, &obs->subscriber, NULL, &token, response);
/* TODO: do not send response and remove observer when
* COAP_RESPONSE_CLASS(response->hdr->code) > 2
*/
if (response->hdr->type == COAP_MESSAGE_CON) {
tid = coap_send_confirmed(context, &obs->subscriber, response);
obs->non_cnt = 0;