+ if(resource->getResourceTypes().at(0) != OC_RSRVD_ES_RES_TYPE_EASYSETUP ||
+ resource->connectivityType() & CT_ADAPTER_TCP)
+ {
+ OIC_LOG (ERROR, EASYSETUP_TAG, "Given resource is not valid due to wrong rt or conntype");
+ return nullptr;
+ }
+
+ auto interfaces = resource->getResourceInterfaces();
+ for(auto interface : interfaces)
+ {
+ if(interface.compare(BATCH_INTERFACE) == 0)
+ {
+ OIC_LOG (INFO, EASYSETUP_TAG, "RemoteEnrollee object is succeessfully created");
+ OIC_LOG_V (INFO_PRIVATE, EASYSETUP_TAG, "HOST: %s", resource->host().c_str());
+ OIC_LOG_V (INFO_PRIVATE, EASYSETUP_TAG, "URI: %s", resource->uri().c_str());
+ OIC_LOG_V (INFO_PRIVATE, EASYSETUP_TAG, "SID: %s", resource->sid().c_str());
+ OIC_LOG_V (INFO_PRIVATE, EASYSETUP_TAG, "CONNECTIVITY: %d", resource->connectivityType());
+ return std::shared_ptr< RemoteEnrollee > (new RemoteEnrollee(resource));
+ }
+ }