It was not included implementation.
So We implement about bindResourceToGroup for Group Formation feature.
Change-Id: Iade53004d8b3d974846a3b9056c6c3b6649104fa
Signed-off-by: HyunJun Kim <hyunjun2.kim@samsung.com>
return OC_STACK_OK;
}
+
+OCStackResult GroupManager::bindResourceToGroup(OCResourceHandle& childHandle, std::shared_ptr< OCResource > resource, OCResourceHandle& collectionHandle)
+{
+
+ OCStackResult result = OCPlatform::registerResource(childHandle, resource);
+
+ cout << "\tresource registed!" << endl;
+
+ if(result == OC_STACK_OK)
+ {
+ OCPlatform::bindResource(collectionHandle, childHandle);
+ }
+ else
+ {
+ cout << "\tresource Error!" << endl;
+ }
+
+ return result;
+ }
+
+
+
/*
Presence Check
*/
OCStackResult subscribeCollectionPresence(std::shared_ptr< OCResource > resource,
CollectionPresenceCallback);
+ OCStackResult bindResourceToGroup(OCResourceHandle& childHandle, std::shared_ptr< OCResource > resource, OCResourceHandle& collectionHandle);
+
private:
void onFoundResource(std::shared_ptr< OCResource > resource, int waitsec);
return result;
}
+ OCStackResult ThingsManager::bindResourceToGroup(OCResourceHandle& childHandle, std::shared_ptr< OCResource > resource, OCResourceHandle& collectionHandle)
+ {
+ OCStackResult result = g_groupManager->bindResourceToGroup(childHandle,resource,collectionHandle);
+
+ return result;
+ }
+
OCStackResult ThingsManager::findGroup(std::vector< std::string > collectionResourceTypes,
FindCallback callback)
{