User Tools

Site Tools


collection_resource

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
collection_resource [2017/04/04 21:59]
Ben Lloyd Pearson
collection_resource [2017/04/04 22:05] (current)
Ben Lloyd Pearson Added examples for C++ API
Line 27: Line 27:
 === C++ API === === C++ API ===
  
-**OC::OCPlatform::​bindResource** - Add a resource to a collection resource:+**OCPlatform::​bindResource** - Add a resource to a collection resource:
 <​code>​ <​code>​
 OCStackResult bindResource(const OCResourceHandle collectionHandle,​ const OCResourceHandle resourceHandle);​ OCStackResult bindResource(const OCResourceHandle collectionHandle,​ const OCResourceHandle resourceHandle);​
 </​code>​ </​code>​
  
-**OC::OCPlatform::​bindResources** - Add multiple resources to a collection resource:+**OCPlatform::​bindResources** - Add multiple resources to a collection resource:
 <​code>​ <​code>​
 OCStackResult bindResources(const OCResourceHandle collectionHandle,​ const std::​vector<​OCResourceHandle>&​ addedResourceHandleList);​ OCStackResult bindResources(const OCResourceHandle collectionHandle,​ const std::​vector<​OCResourceHandle>&​ addedResourceHandleList);​
 </​code>​ </​code>​
  
-**OC::OCPlatform::​unbindResource** - Unbind a resource from a collection resource:+**OCPlatform::​unbindResource** - Unbind a resource from a collection resource:
 <​code>​ <​code>​
 OCStackResult unbindResource(const OCResourceHandle collectionHandle,​ const OCResourceHandle resourceHandle);​ OCStackResult unbindResource(const OCResourceHandle collectionHandle,​ const OCResourceHandle resourceHandle);​
 </​code>​ </​code>​
  
-**OC::OCPlatform::​unbindResources** - Unbind multiple resources from a collection resource:+**OCPlatform::​unbindResources** - Unbind multiple resources from a collection resource:
 <​code>​ <​code>​
 OCStackResult unbindResources(const OCResourceHandle collectionHandle,​ const std::​vector<​OCResourceHandle>&​ resourceHandleList);​ OCStackResult unbindResources(const OCResourceHandle collectionHandle,​ const std::​vector<​OCResourceHandle>&​ resourceHandleList);​
 </​code>​ </​code>​
  
 +**Example**
 +
 +The following code examples demonstrates how to create resources and assigned them to a collection resource with OCPlatform::​bindResource.
 +  * Server: [[https://​gerrit.iotivity.org/​gerrit/​gitweb?​p=iotivity.git;​a=blob;​f=resource/​examples/​groupserver.cpp|iotivity/​resource/​examples/​groupserver.cpp]]
 +  * Client: [[https://​gerrit.iotivity.org/​gerrit/​gitweb?​p=iotivity.git;​a=blob;​f=resource/​examples/​groupclient.cpp;​h=ef146ab8c07ab313585d32ce1477a085ecf96d5d;​hb=HEAD|iotivity/​resource/​examples/​groupclient.cpp]]
  
collection_resource.txt ยท Last modified: 2017/04/04 22:05 by Ben Lloyd Pearson