User Tools

Site Tools


Collection Resource

Collections is a container holding reference to resources.

  • An OIC Resource that contains one or more references (specified as OIC Links) to other OIC Resources is an OIC Collection.
  • An OIC Link embraces and extends typed “web links” as specified in RFC 5988.

Resources that form together for collection may or may not be related to each other. Collection is a response of the structure returned by the server.

Collection includes multiple links combined together to respond to the query.

In Iotivity on the server end to create a collection resource. First a resource has to be created using createResource and then using bindResource API a resource is combined to form a collection


OCStackResult OCBindResource(OCResourceHandle collectionHandle, OCResourceHandle resourceHandle);

To unbind a resource from the collection:

OCStackResult OCUnBindResource(OCResourceHandle collectionHandle, OCResourceHandle resourceHandle); 


Two APIs, once to pass single resource handle and one to pass multiple resource handles.

OCStackResult bindResource(const OCResourceHandle collectionHandle, const OCResourceHandle resourceHandle);

OCStackResult bindResources(const OCResourceHandle collectionHandle, const std::vector<OCResourceHandle>& addedResourceHandleList);

To unbind the resource from the collection. Same as assigning, you can either pass one or multiple resource handles.

OCStackResult unbindResource(const OCResourceHandle collectionHandle, const OCResourceHandle resourceHandle);

OCStackResult unbindResources(const OCResourceHandle collectionHandle, const std::vector<OCResourceHandle>& resourceHandleList);


collection_resource.txt · Last modified: 2017/01/05 10:22 by Phil Coval