[Resource-Encapsulation] Enabled Sample bundle build for Android platform
authorJay Sharma <jay.sharma@samsung.com>
Wed, 9 Sep 2015 16:03:14 +0000 (21:33 +0530)
committerMadan Lanka <lanka.madan@samsung.com>
Thu, 10 Sep 2015 04:18:03 +0000 (04:18 +0000)
- [Resource Container] Soft Sensor Bundle build for android

Change-Id: I56104b8f738da175ff1c424532bad26bcfd37403
Signed-off-by: Jay Sharma <jay.sharma@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2427
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
service/resource-encapsulation/src/resourceContainer/SConscript
service/resource-encapsulation/src/resourceContainer/examples/SoftSensorSampleBundle/src/SoftSensorBundleActivator.cpp

index 8703b55..dd24342 100644 (file)
@@ -128,7 +128,7 @@ resource_container_env.InstallTarget([res_container_static,res_container_shared]
 ######################################################################
 # build soft sensor sample bundle
 ######################################################################
-if target_os in ['linux', 'tizen']:
+if target_os in ['linux', 'tizen', 'android']:
        ss_resource_bundle_env = resource_container_env.Clone()
        ss_resource_bundle_env.AppendUnique(CCFLAGS = ['-fPIC'])
 
index 2647188..1a60d57 100644 (file)
@@ -21,6 +21,7 @@
 #include "SoftSensorBundleActivator.h"
 #include "DiscomfortIndexSensorResource.h"
 #include <algorithm>
+#include <sstream>
 
 SoftSensorBundleActivator *bundle;
 
@@ -70,8 +71,14 @@ void SoftSensorBundleActivator::createResource(resourceInfo resourceInfo)
         DiscomfortIndexSensorResource *newResource = new DiscomfortIndexSensorResource();
 
         newResource->m_bundleId = m_bundleId;
-        newResource->m_uri = "/softsensor/discomfortIndex/" + std::to_string(
-                                 discomfortIndexSensorCount++);
+
+        std::string indexCount;//string which will contain the indexCount
+        stringstream convert; // stringstream used for the conversion
+        convert << discomfortIndexSensorCount++;//add the value of Number to the characters in the stream
+        indexCount = convert.str();//set indexCount to the content of the stream
+
+        newResource->m_uri = "/softsensor/discomfortIndex/" + indexCount;
+
         newResource->m_resourceType = resourceInfo.resourceType;
         newResource->m_mapResourceProperty = resourceInfo.resourceProperty;