X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fthings-manager%2Fsampleapp%2Flinux%2Fconfiguration%2FConfigurationCollection.cpp;h=a01b3c6677144a06eb7639b5910ce43cb725ed80;hb=17c68b2fd1e74586f85e552eeab4e32dc121f8a0;hp=1096799858ac36421f02e67d43adc195e220ffc4;hpb=8c01dff2c5bc5496f7dc1632c498943ec6ecb015;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/things-manager/sampleapp/linux/configuration/ConfigurationCollection.cpp b/service/things-manager/sampleapp/linux/configuration/ConfigurationCollection.cpp index 1096799..a01b3c6 100644 --- a/service/things-manager/sampleapp/linux/configuration/ConfigurationCollection.cpp +++ b/service/things-manager/sampleapp/linux/configuration/ConfigurationCollection.cpp @@ -24,13 +24,14 @@ #include #include +#include #include "OCPlatform.h" #include "OCApi.h" -#include "ThingsManager.h" #include "ConfigurationCollection.h" using namespace OC; +using namespace std; /// This function internally calls registerResource API. void ConfigurationResource::createResources(ResourceEntityHandler callback) @@ -60,15 +61,22 @@ void ConfigurationResource::setConfigurationRepresentation(OCRepresentation& rep { string value; + if (rep.getValue("n", value)) + { + m_deviceName = value; + std::cout << "\t\t\t\t" << "m_deviceName: " << m_deviceName << std::endl; + } + if (rep.getValue("loc", value)) { m_location = value; std::cout << "\t\t\t\t" << "m_location: " << m_location << std::endl; } - if (rep.getValue("st", value)) + if (rep.getValue("locn", value)) { - std::cout << "\t\t\t\t" << "SystemTime is not allowed to be written." << std::endl; + m_locationName = value; + std::cout << "\t\t\t\t" << "m_locationName: " << m_locationName << std::endl; } if (rep.getValue("c", value)) @@ -86,8 +94,9 @@ void ConfigurationResource::setConfigurationRepresentation(OCRepresentation& rep OCRepresentation ConfigurationResource::getConfigurationRepresentation() { + m_configurationRep.setValue("n", m_deviceName); m_configurationRep.setValue("loc", m_location); - m_configurationRep.setValue("st", m_systemTime); + m_configurationRep.setValue("locn", m_locationName); m_configurationRep.setValue("c", m_currency); m_configurationRep.setValue("r", m_region); @@ -101,8 +110,9 @@ std::string ConfigurationResource::getUri() void ConfigurationResource::factoryReset() { + m_deviceName = defaultDeviceName; m_location = defaultLocation; - m_systemTime = defaultSystemTime; + m_locationName = defaultLocationName; m_currency = defaultCurrency; m_region = defaultRegion; }