This is an old revision of the document!
Observe happens at Resource level and operates in server/client model. Handling of observation registration is application specific. Server application decides whether resource is observable and when to send the observe notification. Client application fetches and registers as an observer for the resource. Notifications from the server to the client may be confirmable or non-confirmable, which can be specified in application via QoS levels.
Additionally, attributes can be declared observable to enable remote devices to subscribe to changes
Once initialization has been setup server side, server can declare resource property attributes to be observable to enable remote devices to subscribe to changes.
There are a couple of Samples in resource directory provide examples to use observe APIs.
uint8_t resourceFlag = OC_DISCOVERABLE | OC_OBSERVABLE; result = OCPlatform::registerResource// ( handle, resourceUri, resourceType, resourceInterface, // handler, resourceFlag); //
Previously published documentation which this (living) wiki page is based on : https://www.iotivity.org/documentation/linux/programmers-guide/observing-resource-state-observe