X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fsimulator%2Fsrc%2Fsimulator_manager.cpp;h=4b10c1451b703e8feffc23d6eb073918f6bda7cf;hb=b76f9709482b03334b468ab47a295761b3fd6a78;hp=001cbb3d90021a526eff625c73ff3a3f653e39d7;hpb=d0686ee241a3102399a7135dbe3eb2930219aab9;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/simulator/src/simulator_manager.cpp b/service/simulator/src/simulator_manager.cpp index 001cbb3..4b10c14 100644 --- a/service/simulator/src/simulator_manager.cpp +++ b/service/simulator/src/simulator_manager.cpp @@ -49,7 +49,7 @@ std::shared_ptr SimulatorManager::createResource( VALIDATE_INPUT(configPath.empty(), "Empty path!") std::shared_ptr resource = - SimulatorResourceFactory::getInstance()->createResource(configPath); + SimulatorResourceFactory::getInstance()->createResource(configPath); if (!resource) throw SimulatorException(SIMULATOR_ERROR, "Failed to create resource!"); return resource; @@ -62,7 +62,7 @@ std::vector> SimulatorManager::createResource VALIDATE_INPUT(!count, "Count is zero!") std::vector> resources = - SimulatorResourceFactory::getInstance()->createResource(configPath, count); + SimulatorResourceFactory::getInstance()->createResource(configPath, count); if (!resources.size()) throw SimulatorException(SIMULATOR_ERROR, "Failed to create resource!"); return resources; @@ -133,7 +133,7 @@ void SimulatorManager::findResource(const std::string &resourceType, CT_DEFAULT, findCallback); } -void SimulatorManager::getDeviceInfo(DeviceInfoCallback callback) +void SimulatorManager::getDeviceInfo(const std::string &host, DeviceInfoCallback callback) { VALIDATE_CALLBACK(callback) @@ -149,14 +149,11 @@ void SimulatorManager::getDeviceInfo(DeviceInfoCallback callback) callback(deviceInfo); }, std::placeholders::_1, callback); - std::ostringstream uri; - uri << OC_MULTICAST_PREFIX << OC_RSRVD_DEVICE_URI; - typedef OCStackResult (*GetDeviceInfo)(const std::string &, const std::string &, OCConnectivityType, OC::FindDeviceCallback); - invokeocplatform(static_cast(OC::OCPlatform::getDeviceInfo), "", - uri.str(), CT_DEFAULT, deviceCallback); + invokeocplatform(static_cast(OC::OCPlatform::getDeviceInfo), host.c_str(), + "/oic/d", CT_DEFAULT, deviceCallback); } void SimulatorManager::setDeviceInfo(const std::string &deviceName) @@ -171,7 +168,7 @@ void SimulatorManager::setDeviceInfo(const std::string &deviceName) ocDeviceInfo); } -void SimulatorManager::getPlatformInfo(PlatformInfoCallback callback) +void SimulatorManager::getPlatformInfo(const std::string &host, PlatformInfoCallback callback) { VALIDATE_CALLBACK(callback) @@ -194,14 +191,11 @@ void SimulatorManager::getPlatformInfo(PlatformInfoCallback callback) callback(platformInfo); }, std::placeholders::_1, callback); - std::ostringstream uri; - uri << OC_MULTICAST_PREFIX << OC_RSRVD_PLATFORM_URI; - typedef OCStackResult (*GetPlatformInfo)(const std::string &, const std::string &, OCConnectivityType, OC::FindPlatformCallback); - invokeocplatform(static_cast(OC::OCPlatform::getPlatformInfo), "", - uri.str(), CT_DEFAULT, platformCallback); + invokeocplatform(static_cast(OC::OCPlatform::getPlatformInfo), host.c_str(), + "/oic/p", CT_DEFAULT, platformCallback); } void SimulatorManager::setPlatformInfo(PlatformInfo &platformInfo)