X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fresource-container%2Fexamples%2FHueSampleBundle%2Fsrc%2FHueSampleBundleActivator.cpp;h=02b045a2fd46872eed26a50128348a37d98400c8;hb=390866079e285d2c74918432c0d597d5da52f8a0;hp=36fad24828a78389c46355c6d75ed3cc4611331a;hpb=3e9402ad71cb3e93266a77796f44d17bab9853fd;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/resource-container/examples/HueSampleBundle/src/HueSampleBundleActivator.cpp b/service/resource-container/examples/HueSampleBundle/src/HueSampleBundleActivator.cpp index 36fad24..02b045a 100644 --- a/service/resource-container/examples/HueSampleBundle/src/HueSampleBundleActivator.cpp +++ b/service/resource-container/examples/HueSampleBundle/src/HueSampleBundleActivator.cpp @@ -74,14 +74,14 @@ void HueSampleBundleActivator::deactivateBundle() void HueSampleBundleActivator::createResource(resourceInfo resourceInfo) { - if (resourceInfo.resourceType == "oic.r.light") { static int lightCount = 1; BundleResource::Ptr hueLight = std::make_shared< HueLight >(m_connector, resourceInfo.address); - resourceInfo.uri = "/hue/light/" + std::to_string(lightCount++); + hueLight->m_bundleId = m_bundleId; - hueLight->m_uri = resourceInfo.uri; + hueLight->m_uri = resourceInfo.uri.empty() ? + "/hue/light/" + std::to_string(lightCount++) : resourceInfo.uri; hueLight->m_resourceType = resourceInfo.resourceType; hueLight->m_name = resourceInfo.name;