User Tools

Site Tools


resource_observe

This is an old revision of the document!


A shared resource could be observed from it's listeners.

Once initialization has been setup server side, the resource can be registered with OC_OBSERVABLE feature emabled.

https://www.iotivity.org/documentation/linux/programmers-guide/observing-resource-state-observe

Sample code:

  uint8_t resourceFlag = OC_DISCOVERABLE | OC_OBSERVABLE;
  result = OCPlatform::registerResource//
                 ( handle,
                   resourceUri, 
                   resourceType,
                   resourceInterface, //
                   handler, 
                   resourceFlag); //
                   

resource_observe.1467815018.txt.gz · Last modified: 2016/07/06 14:23 by Ziran Sun