- [Resource Container] Soft Sensor Bundle build for android
- Added Exception to RCSRemoteResourceObject API
Change-Id: I98e3711857a6339efc09e146c2e6fb399e654b44
Signed-off-by: Jay Sharma <jay.sharma@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2329
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
{
SCOPE_LOG_F(DEBUG, TAG);
{
SCOPE_LOG_F(DEBUG, TAG);
- return getCachedAttributes().at(key);
+ //check whether key is available or not
+ RCSResourceAttributes cachedAttributes= getCachedAttributes();
+ if(cachedAttributes.contains(key))
+ {
+ return getCachedAttributes().at(key);
+ }
+ else
+ {
+ throw BadRequestException{ "Requested Attribute is not present" };
+ }
}
std::string RCSRemoteResourceObject::getUri() const
}
std::string RCSRemoteResourceObject::getUri() const
######################################################################
# build soft sensor sample bundle
######################################################################
######################################################################
# build soft sensor sample bundle
######################################################################
-if target_os == 'linux':
+if target_os in ['linux', 'android']:
ss_resource_bundle_env = resource_container_env.Clone()
ss_resource_bundle_env.AppendUnique(CCFLAGS = ['-fPIC'])
ss_resource_bundle_env = resource_container_env.Clone()
ss_resource_bundle_env.AppendUnique(CCFLAGS = ['-fPIC'])
#include "SoftSensorBundleActivator.h"
#include "DiscomfortIndexSensorResource.h"
#include <algorithm>
#include "SoftSensorBundleActivator.h"
#include "DiscomfortIndexSensorResource.h"
#include <algorithm>
SoftSensorBundleActivator *bundle;
SoftSensorBundleActivator *bundle;
DiscomfortIndexSensorResource *newResource = new DiscomfortIndexSensorResource();
newResource->m_bundleId = m_bundleId;
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;
newResource->m_resourceType = resourceInfo.resourceType;
newResource->m_mapResourceProperty = resourceInfo.resourceProperty;