VALIDATE_INPUT(configPath.empty(), "Empty path!")
std::shared_ptr<SimulatorResource> resource =
- SimulatorResourceFactory::getInstance()->createResource(configPath);
+ SimulatorResourceFactory::getInstance()->createResource(configPath);
if (!resource)
throw SimulatorException(SIMULATOR_ERROR, "Failed to create resource!");
return resource;
VALIDATE_INPUT(!count, "Count is zero!")
std::vector<std::shared_ptr<SimulatorResource>> resources =
- SimulatorResourceFactory::getInstance()->createResource(configPath, count);
+ SimulatorResourceFactory::getInstance()->createResource(configPath, count);
if (!resources.size())
throw SimulatorException(SIMULATOR_ERROR, "Failed to create resource!");
return resources;
CT_DEFAULT, findCallback);
}
-void SimulatorManager::getDeviceInfo(DeviceInfoCallback callback)
+void SimulatorManager::getDeviceInfo(const std::string &host, DeviceInfoCallback callback)
{
VALIDATE_CALLBACK(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<GetDeviceInfo>(OC::OCPlatform::getDeviceInfo), "",
- uri.str(), CT_DEFAULT, deviceCallback);
+ invokeocplatform(static_cast<GetDeviceInfo>(OC::OCPlatform::getDeviceInfo), host.c_str(),
+ "/oic/d", CT_DEFAULT, deviceCallback);
}
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)
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<GetPlatformInfo>(OC::OCPlatform::getPlatformInfo), "",
- uri.str(), CT_DEFAULT, platformCallback);
+ invokeocplatform(static_cast<GetPlatformInfo>(OC::OCPlatform::getPlatformInfo), host.c_str(),
+ "/oic/p", CT_DEFAULT, platformCallback);
}
void SimulatorManager::setPlatformInfo(PlatformInfo &platformInfo)