Commit bbc610a5 authored by Minji Park's avatar Minji Park Committed by Uze Choi

fix configuration parsing problem in Resource Container

- fix configuration parsing for input information with bundle resource uri

Change-Id: I8a45b7a00179ab11a018ef1c3030df0233339090
Signed-off-by: default avatarMinji Park <minjii.park@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/6217Reviewed-by: default avatarMarkus Jung <markus.jung85@gmail.com>
Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
parent 7a551aee
......@@ -57,10 +57,10 @@ void BMISensorResource::onUpdatedInputResource(const std::string attributeName,
m_mapInputData.clear();
if (!attributeName.compare("weight"))
m_mapInputData.insert(std::make_pair("weight", values.back().toString()));
m_mapInputData.insert(std::make_pair("weight", values.back().get< std::string >()));
if (!attributeName.compare("height"))
m_mapInputData.insert(std::make_pair("height", values.back().toString()));
m_mapInputData.insert(std::make_pair("height", values.back().get< std::string >()));
executeLogic();
}
......@@ -191,7 +191,7 @@ namespace OIC
}
}
void Configuration::getResourceConfiguration(std::string bundleId, std::string resourceName,
void Configuration::getResourceConfiguration(std::string bundleId, std::string resourceUri,
resourceInfo *resourceInfoOut){
rapidxml::xml_node< char > *bundle;
rapidxml::xml_node< char > *resource;
......@@ -200,7 +200,7 @@ namespace OIC
string strBundleId;
string strKey, strValue;
OIC_LOG_V(INFO, CONTAINER_TAG, "Loading resource configuration for %s %s!",
bundleId.c_str(), resourceName.c_str());
bundleId.c_str(), resourceUri.c_str());
if (m_loaded)
{
......@@ -209,8 +209,8 @@ namespace OIC
// <bundle>
if (m_xmlDoc.first_node())
{
for (bundle = m_xmlDoc.first_node()->first_node(BUNDLE_TAG); bundle; bundle =
bundle->next_sibling())
for (bundle = m_xmlDoc.first_node()->first_node(BUNDLE_TAG); bundle;
bundle = bundle->next_sibling())
{
// <id>
strBundleId = bundle->first_node(BUNDLE_ID)->value();
......@@ -236,12 +236,18 @@ namespace OIC
if (!strKey.compare(OUTPUT_RESOURCE_NAME))
{
if (trim_both(strValue).compare(resourceName) != 0) break;
resourceInfoOut->name = trim_both(strValue);
}
else if (!strKey.compare(OUTPUT_RESOURCE_URI))
{
if (trim_both(strValue).compare(resourceUri) != 0)
{
break;
}
resourceInfoOut->uri = trim_both(strValue);
}
else if (!strKey.compare(OUTPUT_RESOURCE_ADDR))
resourceInfoOut->address = trim_both(strValue);
......
......@@ -817,11 +817,10 @@ namespace OIC
{
OIC_LOG_V(DEBUG, CONTAINER_TAG, "Discover input resource %s", outputResourceUri.c_str());
auto foundOutputResource = m_mapResources.find(outputResourceUri);
// auto resourceProperty = foundOutputResource->second->m_mapResourceProperty;
resourceInfo info;
m_config->getResourceConfiguration(foundOutputResource->second->m_bundleId,
foundOutputResource->second->m_name, &info);
outputResourceUri, &info);
map< string, vector< map< string, string > > > resourceProperty = info.resourceProperty;
try
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment