projects
/
platform
/
upstream
/
iotivity.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 1.0.0
[platform/upstream/iotivity.git]
/
service
/
things-manager
/
sampleapp
/
linux
/
configuration
/
ConfigurationCollection.cpp
diff --git
a/service/things-manager/sampleapp/linux/configuration/ConfigurationCollection.cpp
b/service/things-manager/sampleapp/linux/configuration/ConfigurationCollection.cpp
index
1096799
..
a01b3c6
100644
(file)
--- a/
service/things-manager/sampleapp/linux/configuration/ConfigurationCollection.cpp
+++ b/
service/things-manager/sampleapp/linux/configuration/ConfigurationCollection.cpp
@@
-24,13
+24,14
@@
#include <functional>
#include <thread>
#include <functional>
#include <thread>
+#include <string.h>
#include "OCPlatform.h"
#include "OCApi.h"
#include "OCPlatform.h"
#include "OCApi.h"
-#include "ThingsManager.h"
#include "ConfigurationCollection.h"
using namespace OC;
#include "ConfigurationCollection.h"
using namespace OC;
+using namespace std;
/// This function internally calls registerResource API.
void ConfigurationResource::createResources(ResourceEntityHandler callback)
/// This function internally calls registerResource API.
void ConfigurationResource::createResources(ResourceEntityHandler callback)
@@
-60,15
+61,22
@@
void ConfigurationResource::setConfigurationRepresentation(OCRepresentation& rep
{
string value;
{
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("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))
}
if (rep.getValue("c", value))
@@
-86,8
+94,9
@@
void ConfigurationResource::setConfigurationRepresentation(OCRepresentation& rep
OCRepresentation ConfigurationResource::getConfigurationRepresentation()
{
OCRepresentation ConfigurationResource::getConfigurationRepresentation()
{
+ m_configurationRep.setValue("n", m_deviceName);
m_configurationRep.setValue("loc", m_location);
m_configurationRep.setValue("loc", m_location);
- m_configurationRep.setValue("
st", m_systemTi
me);
+ m_configurationRep.setValue("
locn", m_locationNa
me);
m_configurationRep.setValue("c", m_currency);
m_configurationRep.setValue("r", m_region);
m_configurationRep.setValue("c", m_currency);
m_configurationRep.setValue("r", m_region);
@@
-101,8
+110,9
@@
std::string ConfigurationResource::getUri()
void ConfigurationResource::factoryReset()
{
void ConfigurationResource::factoryReset()
{
+ m_deviceName = defaultDeviceName;
m_location = defaultLocation;
m_location = defaultLocation;
- m_
systemTime = defaultSystemTi
me;
+ m_
locationName = defaultLocationNa
me;
m_currency = defaultCurrency;
m_region = defaultRegion;
}
m_currency = defaultCurrency;
m_region = defaultRegion;
}