Imported Upstream version 1.0.0
[platform/upstream/iotivity.git] / service / things-manager / sampleapp / linux / configuration / ConfigurationCollection.h
index 2dc3bbf..e40b6bd 100644 (file)
@@ -27,7 +27,6 @@
 
 #include "OCPlatform.h"
 #include "OCApi.h"
-#include "ThingsManager.h"
 
 #pragma once
 
@@ -36,11 +35,12 @@ using namespace OC;
 typedef std::function<
     OCEntityHandlerResult(std::shared_ptr< OCResourceRequest > request) > ResourceEntityHandler;
 
-static std::string defaultURIPrefix = "/oic/con";
-static std::string defaultResourceTypePrefix = "oic.con";
+static std::string defaultConURI = "/oic/con";
+static std::string defaultConResourceType = "oic.wk.con";
 
+extern std::string defaultDeviceName;
 extern std::string defaultLocation;
-extern std::string defaultSystemTime;
+extern std::string defaultLocationName;
 extern std::string defaultCurrency;
 extern std::string defaultRegion;
 
@@ -49,8 +49,9 @@ class ConfigurationResource
 public:
     // Configuration members
     std::string m_configurationUri;
+    std::string m_deviceName;
     std::string m_location;
-    std::string m_systemTime;
+    std::string m_locationName;
     std::string m_currency;
     std::string m_region;
     std::vector< std::string > m_configurationTypes;
@@ -61,16 +62,16 @@ public:
 public:
     /// Constructor
     ConfigurationResource() :
-            m_location(defaultLocation), m_systemTime(defaultSystemTime), m_currency(
-                    defaultCurrency), m_region(defaultRegion)
+            m_deviceName(defaultDeviceName), m_location(defaultLocation),
+                m_locationName(defaultLocationName), m_currency(defaultCurrency),
+                m_region(defaultRegion)
     {
-        m_configurationUri = "/oic/con"; // URI of the resource
-        m_configurationTypes.push_back("oic.con"); // resource type name.
+        m_configurationUri = defaultConURI; // URI of the resource
+        m_configurationTypes.push_back(defaultConResourceType); // resource type name.
         m_configurationInterfaces.push_back(DEFAULT_INTERFACE); // resource interface.
-        //m_configurationInterfaces.push_back(BATCH_INTERFACE); // resource interface.
-        //m_configurationInterfaces.push_back(LINK_INTERFACE); // resource interface.
+        m_configurationRep.setValue("st", 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);
         m_configurationRep.setUri(m_configurationUri);