Hi Kishen, I'm very happy to receive your reply! I've been waiting for you :)
BTW, thank you for explanation. Some of them matches what I have guessed. But, I have additional question.. please see inline Thanks & BR :) - Kevin On Wed, Jul 24, 2019 at 3:41 PM Maloor, Kishen <[email protected]> wrote: > Hi Kevin, > > > > Notifications are constructed and sent internally by the stack following a > few triggers as explained below. > > > > Notifications are automatically sent following all POST/PUT requests to > any Observable resource. This is handled internally by capturing the > > most recent resource state and packaging it into a notification. > *==> Basically I understand this situation. but what if a server updates its Observable Resource by itself without any POST/PUT requests from outside? * *Can current stack send notification automatically in this case?* > > > The resource's state is whatever is usually read by the GET handler of the > resource. > > > > If you want notifications to be periodic, you must use > oc_resource_set_periodic_observable() on the resource specifying a > frequency of that > > observation. In this case, the stack internally polls the resource and > sends out a notification with its most recent state every time a > notification is scheduled. > > The application doesn't have to do thing. > > > > If you need to send notifications asynchronously, you will instead use > oc_resource_set_observable() on the resource, and later call > oc_notify_observers() > > (synchronizing with oc_main_poll()) from any task in your application that > produces a change in the resource's state (again data structures > > read by the resource's GET handler). > > > > -Kishen. > > > > -- > > Kishen Maloor > > Intel Corporation > > > > *From: *<[email protected]> on behalf of Joo-Chul Lee < > [email protected]> > *Date: *Tuesday, July 23, 2019 at 7:28 PM > *To: *iotivity-dev <[email protected]> > *Subject: *[dev] [iotivity-lite] how to handle notification in > iotivity-lite? > > > > Hi iotivity folks, > > > > I have a question about notification mechanism in IoTivity-lite. > In IoTivity classic, server can check existence of “observe option” in > callback function registered to specific Resource. > and therefore the server can send following notification responses based > on its notification logic. > > However, I can’t find such codes in IoTivity-lite samples. > How can server know if there is “observe option” in request message? > Could anyone explain how notification works in IoTivity-lite stack ? > > Thanks & BR :) > > - Kevin > > > > -- > > -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > Joo-Chul Kevin Lee, ETRI > 161 Gajeong-dong, Yuseong-gu, daejon, 305-700, KOREA > E-mail: [email protected]/[email protected] Tel: +82-42-860-1021 > -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > > > -- -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Joo-Chul Kevin Lee, ETRI 161 Gajeong-dong, Yuseong-gu, daejon, 305-700, KOREA E-mail: [email protected]/[email protected] Tel: +82-42-860-1021 -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#10244): https://lists.iotivity.org/g/iotivity-dev/message/10244 Mute This Topic: https://lists.iotivity.org/mt/32580414/21656 Group Owner: [email protected] Unsubscribe: https://lists.iotivity.org/g/iotivity-dev/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
