{"action":"created","issue":{"url":"https://api.github.com/repos/obgm/libcoap/issues/147","repository_url":"https://api.github.com/repos/obgm/libcoap","labels_url":"https://api.github.com/repos/obgm/libcoap/issues/147/labels{/name}","comments_url":"https://api.github.com/repos/obgm/libcoap/issues/147/comments","events_url":"https://api.github.com/repos/obgm/libcoap/issues/147/events","html_url":"https://github.com/obgm/libcoap/issues/147","id":302225509,"number":147,"title":"Observe functionality challenges","user":{"login":"mrdeep1","id":35105050,"avatar_url":"https://avatars3.githubusercontent.com/u/35105050?v=4","gravatar_id":"","url":"https://api.github.com/users/mrdeep1","html_url":"https://github.com/mrdeep1","followers_url":"https://api.github.com/users/mrdeep1/followers","following_url":"https://api.github.com/users/mrdeep1/following{/other_user}","gists_url":"https://api.github.com/users/mrdeep1/gists{/gist_id}","starred_url":"https://api.github.com/users/mrdeep1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrdeep1/subscriptions","organizations_url":"https://api.github.com/users/mrdeep1/orgs","repos_url":"https://api.github.com/users/mrdeep1/repos","events_url":"https://api.github.com/users/mrdeep1/events{/privacy}","received_events_url":"https://api.github.com/users/mrdeep1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-03-05T09:27:27Z","updated_at":"2018-04-03T12:04:33Z","closed_at":null,"author_association":"NONE","body":"It currently is not intuitive as to how to get CoAP Observe to work\r\n\r\n*Setting up Observe*\r\na) Enabling Observer\r\nresource->observable = 1;\r\nb) Triggering a Observe to get sent\r\ncoap_resource_set_dirty(resource, NULL);\r\nc) Getting the actual observe packet sent\r\ncoap_check_notify(ctx); /* Done in the main IO processing loop */\r\n\r\nI would like to see this\r\na) coap_set_resource_get_observable(resource)\r\nb) coap_resource_trigger_observe(resource)\r\nc) coap_check_notify(ctx) should be done internally by coap_write(), and the application need not do it at all\r\n\r\n*GET handler calling - determining Uri*\r\nWhen the GET handler is called by handle_request(), the request parameter is set.\r\nWhen the GET handler is called by coap_check_notify(), the request parameter is not set.\r\n\r\n'request' not getting set will catch some people out - I can document this in a man page.  However, getting the Uri requires knowledge of the implementation and used of resource->uri.  I would like to see a coap_resource_get_uri(resource) function.\r\n\r\nIf you are happy with all of this, I will create a PR and do it."},"comment":{"url":"https://api.github.com/repos/obgm/libcoap/issues/comments/378226296","html_url":"https://github.com/obgm/libcoap/issues/147#issuecomment-378226296","issue_url":"https://api.github.com/repos/obgm/libcoap/issues/147","id":378226296,"user":{"login":"obgm","id":7488145,"avatar_url":"https://avatars1.githubusercontent.com/u/7488145?v=4","gravatar_id":"","url":"https://api.github.com/users/obgm","html_url":"https://github.com/obgm","followers_url":"https://api.github.com/users/obgm/followers","following_url":"https://api.github.com/users/obgm/following{/other_user}","gists_url":"https://api.github.com/users/obgm/gists{/gist_id}","starred_url":"https://api.github.com/users/obgm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obgm/subscriptions","organizations_url":"https://api.github.com/users/obgm/orgs","repos_url":"https://api.github.com/users/obgm/repos","events_url":"https://api.github.com/users/obgm/events{/privacy}","received_events_url":"https://api.github.com/users/obgm/received_events","type":"User","site_admin":false},"created_at":"2018-04-03T12:04:33Z","updated_at":"2018-04-03T12:04:33Z","author_association":"OWNER","body":"@hongnguyen-tma This is implemented in libcoap. The RST method is designed such that clients that have lost their state (e.g., due to reboot) can finish the observe relationship. Usually, a cleaner method would be employed to cancel an existing observe relationship by sending a `GET` with `Observe: 1` for the observed resource."}}
{"actor":{"display_login":"obgm"}}