mirror of
https://github.com/obgm/libcoap.git
synced 2026-12-05 20:02:19 +03:00
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:
1 parent
1b3aa704e6
commit
a3fae3ce3a
7 files changed
+108
-34
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user