From: arya.k Date: Thu, 10 Sep 2015 11:58:54 +0000 (+0530) Subject: [TIZEN] Updated properties of Configuration resource in Things manager. X-Git-Tag: 1.2.0+RC1~1133^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7aca2c89f54ea3a0ea99b543f0c179aa98bd2fa3;p=platform%2Fupstream%2Fiotivity.git [TIZEN] Updated properties of Configuration resource in Things manager. "Device Name" and "Location Name" properties are added and "SystemTime" property is removed. diagnosticsresource file is renamed to maintenanceresource. Change-Id: I4fab4b7989a714d2aa1089f22f8adde674597bab Signed-off-by: arya.k Reviewed-on: https://gerrit.iotivity.org/gerrit/2445 Tested-by: jenkins-iotivity Reviewed-by: Madan Lanka --- diff --git a/service/things-manager/sampleapp/tizen/ConServerApp/inc/configurationresource.h b/service/things-manager/sampleapp/tizen/ConServerApp/inc/configurationresource.h index 7c3a424..9601cf8 100755 --- a/service/things-manager/sampleapp/tizen/ConServerApp/inc/configurationresource.h +++ b/service/things-manager/sampleapp/tizen/ConServerApp/inc/configurationresource.h @@ -17,8 +17,8 @@ * limitations under the License. * ******************************************************************/ -#ifndef __CONFIGURATION_RESOURCE_H__ -#define __CONFIGURATION_RESOURCE_H__ +#ifndef CONFIGURATION_RESOURCE_H__ +#define CONFIGURATION_RESOURCE_H__ #include @@ -27,8 +27,9 @@ #pragma once +#define DEFAULT_DEVICENAME "n" #define DEFAULT_LOCATION "loc" -#define DEFAULT_SYSTIME "st" +#define DEFAULT_LOCATIONNAME "locn" #define DEFAULT_CURRENCY "c" #define DEFAULT_REGION "r" @@ -40,8 +41,9 @@ ResourceEntityHandler; 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; @@ -50,8 +52,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; @@ -76,4 +79,4 @@ class ConfigurationResource void deleteResource(); }; -#endif // __CONFIGURATION_RESOURCE_H__ \ No newline at end of file +#endif // CONFIGURATION_RESOURCE_H__ \ No newline at end of file diff --git a/service/things-manager/sampleapp/tizen/ConServerApp/inc/conserverapp.h b/service/things-manager/sampleapp/tizen/ConServerApp/inc/conserverapp.h index 7558b90..8f35f69 100644 --- a/service/things-manager/sampleapp/tizen/ConServerApp/inc/conserverapp.h +++ b/service/things-manager/sampleapp/tizen/ConServerApp/inc/conserverapp.h @@ -18,8 +18,8 @@ * ******************************************************************/ -#ifndef __CONSERVERAPP_H__ -#define __CONSERVERAPP_H__ +#ifndef CONSERVERAPP_H__ +#define CONSERVERAPP_H__ #include #include @@ -41,4 +41,4 @@ #define ELM_DEMO_EDJ "opt/usr/apps/org.tizen.conserverapp/res/ui_controls.edj" -#endif // __CONSERVERAPP_H__ +#endif // CONSERVERAPP_H__ \ No newline at end of file diff --git a/service/things-manager/sampleapp/tizen/ConServerApp/inc/factorysetresource.h b/service/things-manager/sampleapp/tizen/ConServerApp/inc/factorysetresource.h index eb60060..ce8a995 100644 --- a/service/things-manager/sampleapp/tizen/ConServerApp/inc/factorysetresource.h +++ b/service/things-manager/sampleapp/tizen/ConServerApp/inc/factorysetresource.h @@ -17,8 +17,8 @@ * limitations under the License. * ******************************************************************/ -#ifndef __FACTORYSET_RESOURCE_H__ -#define __FACTORYSET_RESOURCE_H__ +#ifndef FACTORYSET_RESOURCE_H__ +#define FACTORYSET_RESOURCE_H__ #include @@ -52,4 +52,4 @@ class FactorySetResource : public ConfigurationResource void deleteResource(); }; -#endif // __FACTORYSET_RESOURCE_H__ \ No newline at end of file +#endif // FACTORYSET_RESOURCE_H__ \ No newline at end of file diff --git a/service/things-manager/sampleapp/tizen/ConServerApp/inc/diagnosticsresource.h b/service/things-manager/sampleapp/tizen/ConServerApp/inc/maintenanceresource.h similarity index 90% rename from service/things-manager/sampleapp/tizen/ConServerApp/inc/diagnosticsresource.h rename to service/things-manager/sampleapp/tizen/ConServerApp/inc/maintenanceresource.h index 35a604e..3451517 100644 --- a/service/things-manager/sampleapp/tizen/ConServerApp/inc/diagnosticsresource.h +++ b/service/things-manager/sampleapp/tizen/ConServerApp/inc/maintenanceresource.h @@ -17,8 +17,8 @@ * limitations under the License. * ******************************************************************/ -#ifndef __DIAGNOSTICS_RESOURCE_H__ -#define __DIAGNOSTICS_RESOURCE_H__ +#ifndef MAINTENANCE_RESOURCE_H__ +#define MAINTENANCE_RESOURCE_H__ #include #include @@ -29,6 +29,10 @@ #pragma once +#define DEFAULT_REBOOT "rb" +#define DEFAULT_FACTORYRESET "fr" +#define DEFAULT_STARTCOLLECTION "ssc" + using namespace OC; typedef std::function request)> @@ -70,4 +74,4 @@ class MaintenanceResource void deleteResource(); }; -#endif // __DIAGNOSTICS_RESOURCE_H__ \ No newline at end of file +#endif // MAINTENANCE_RESOURCE_H__ \ No newline at end of file diff --git a/service/things-manager/sampleapp/tizen/ConServerApp/src/configurationresource.cpp b/service/things-manager/sampleapp/tizen/ConServerApp/src/configurationresource.cpp index a025e96..1f56a2e 100755 --- a/service/things-manager/sampleapp/tizen/ConServerApp/src/configurationresource.cpp +++ b/service/things-manager/sampleapp/tizen/ConServerApp/src/configurationresource.cpp @@ -30,14 +30,16 @@ using namespace OC; // Constructor ConfigurationResource::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 = defaultConURI; // URI of the resource m_configurationTypes.push_back(defaultConResourceType); // resource type name m_configurationInterfaces.push_back(DEFAULT_INTERFACE); // resource interface + m_configurationRep.setValue(DEFAULT_DEVICENAME, m_deviceName); m_configurationRep.setValue(DEFAULT_LOCATION, m_location); - m_configurationRep.setValue(DEFAULT_SYSTIME, m_systemTime); + m_configurationRep.setValue(DEFAULT_LOCATIONNAME, m_locationName); m_configurationRep.setValue(DEFAULT_CURRENCY, m_currency); m_configurationRep.setValue(DEFAULT_REGION, m_region); m_configurationRep.setUri(m_configurationUri); @@ -76,6 +78,13 @@ void ConfigurationResource::setConfigurationRepresentation(OCRepresentation &rep { std::string value; + if (rep.getValue(DEFAULT_DEVICENAME, value)) + { + m_deviceName = value; + dlog_print(DLOG_INFO, "ConfigurationResource", "#### m_deviceName: %s", + m_deviceName.c_str()); + } + if (rep.getValue(DEFAULT_LOCATION, value)) { m_location = value; @@ -83,10 +92,11 @@ void ConfigurationResource::setConfigurationRepresentation(OCRepresentation &rep m_location.c_str()); } - if (rep.getValue(DEFAULT_SYSTIME, value)) + if (rep.getValue(DEFAULT_LOCATIONNAME, value)) { - dlog_print(DLOG_INFO, "ConfigurationResource", "#### SystemTime is not" - "allowed to be written"); + m_locationName = value; + dlog_print(DLOG_INFO, "ConfigurationResource", "#### m_locationName: %s", + m_locationName.c_str()); } if (rep.getValue(DEFAULT_CURRENCY, value)) @@ -106,8 +116,9 @@ void ConfigurationResource::setConfigurationRepresentation(OCRepresentation &rep OCRepresentation ConfigurationResource::getConfigurationRepresentation() { + m_configurationRep.setValue(DEFAULT_DEVICENAME, m_deviceName); m_configurationRep.setValue(DEFAULT_LOCATION, m_location); - m_configurationRep.setValue(DEFAULT_SYSTIME, m_systemTime); + m_configurationRep.setValue(DEFAULT_LOCATIONNAME, m_locationName); m_configurationRep.setValue(DEFAULT_CURRENCY, m_currency); m_configurationRep.setValue(DEFAULT_REGION, m_region); @@ -122,8 +133,9 @@ std::string ConfigurationResource::getUri() // Assigns default values to all the attributes of the configuration resource void ConfigurationResource::factoryReset() { + m_deviceName = defaultDeviceName; m_location = defaultLocation; - m_systemTime = defaultSystemTime; + m_locationName = defaultLocationName; m_currency = defaultCurrency; m_region = defaultRegion; } diff --git a/service/things-manager/sampleapp/tizen/ConServerApp/src/conserverapp.cpp b/service/things-manager/sampleapp/tizen/ConServerApp/src/conserverapp.cpp index 0361109..88d223d 100644 --- a/service/things-manager/sampleapp/tizen/ConServerApp/src/conserverapp.cpp +++ b/service/things-manager/sampleapp/tizen/ConServerApp/src/conserverapp.cpp @@ -26,7 +26,7 @@ #include "ThingsConfiguration.h" #include "ThingsMaintenance.h" #include "configurationresource.h" -#include "diagnosticsresource.h" +#include "maintenanceresource.h" #include "factorysetresource.h" using namespace OC; @@ -37,9 +37,10 @@ namespace PH = std::placeholders; /* Default system configuration value's variables The variable's names should be same as the names of "extern" variables defined in "configurationresource.h" */ +std::string defaultDeviceName; std::string defaultLocation; +std::string defaultLocationName; std::string defaultRegion; -std::string defaultSystemTime; std::string defaultCurrency; static ThingsConfiguration *g_thingsConf; @@ -298,12 +299,14 @@ void onBootStrapCallback(const HeaderOptions &headerOptions, const OCRepresentat logMessage += "URI : " + rep.getUri() + "
"; defaultRegion = rep.getValue< std::string >(DEFAULT_REGION); - defaultSystemTime = rep.getValue< std::string >(DEFAULT_SYSTIME); defaultCurrency = rep.getValue< std::string >(DEFAULT_CURRENCY); defaultLocation = rep.getValue< std::string >(DEFAULT_LOCATION); + defaultLocationName = rep.getValue< std::string >(DEFAULT_LOCATIONNAME); + defaultDeviceName = rep.getValue< std::string >(DEFAULT_DEVICENAME); + logMessage += "Device Name : " + defaultDeviceName + "
"; logMessage += "Location : " + defaultLocation + "
"; - logMessage += "SystemTime : " + defaultSystemTime + "
"; + logMessage += "Location Name : " + defaultLocationName + "
"; logMessage += "currency : " + defaultCurrency + "
"; logMessage += "Region : " + defaultRegion + "
"; diff --git a/service/things-manager/sampleapp/tizen/ConServerApp/src/factorysetresource.cpp b/service/things-manager/sampleapp/tizen/ConServerApp/src/factorysetresource.cpp index 3271609..b856107 100644 --- a/service/things-manager/sampleapp/tizen/ConServerApp/src/factorysetresource.cpp +++ b/service/things-manager/sampleapp/tizen/ConServerApp/src/factorysetresource.cpp @@ -71,6 +71,13 @@ void FactorySetResource::setFactorySetRepresentation(OCRepresentation &rep) { std::string value; + if (rep.getValue(DEFAULT_DEVICENAME, value)) + { + m_deviceName = value; + dlog_print(DLOG_INFO, "FactorySetResource", "#### m_deviceName: %s", + m_deviceName.c_str()); + } + if (rep.getValue(DEFAULT_LOCATION, value)) { m_location = value; @@ -78,10 +85,11 @@ void FactorySetResource::setFactorySetRepresentation(OCRepresentation &rep) m_location.c_str()); } - if (rep.getValue(DEFAULT_SYSTIME, value)) + if (rep.getValue(DEFAULT_LOCATIONNAME, value)) { - dlog_print(DLOG_INFO, "FactorySetResource", "#### SystemTime is not" - "allowed to be written"); + m_locationName = value; + dlog_print(DLOG_INFO, "FactorySetResource", "#### m_locationName: %s", + m_locationName.c_str()); } if (rep.getValue(DEFAULT_CURRENCY, value)) @@ -101,8 +109,9 @@ void FactorySetResource::setFactorySetRepresentation(OCRepresentation &rep) OCRepresentation FactorySetResource::getFactorySetRepresentation() { + m_configurationRep.setValue(DEFAULT_DEVICENAME, m_deviceName); m_configurationRep.setValue(DEFAULT_LOCATION, m_location); - m_configurationRep.setValue(DEFAULT_SYSTIME, m_systemTime); + m_configurationRep.setValue(DEFAULT_LOCATIONNAME, m_locationName); m_configurationRep.setValue(DEFAULT_CURRENCY, m_currency); m_configurationRep.setValue(DEFAULT_REGION, m_region); diff --git a/service/things-manager/sampleapp/tizen/ConServerApp/src/diagnosticsresource.cpp b/service/things-manager/sampleapp/tizen/ConServerApp/src/maintenanceresource.cpp similarity index 89% rename from service/things-manager/sampleapp/tizen/ConServerApp/src/diagnosticsresource.cpp rename to service/things-manager/sampleapp/tizen/ConServerApp/src/maintenanceresource.cpp index 0a48056..d0d32f0 100644 --- a/service/things-manager/sampleapp/tizen/ConServerApp/src/diagnosticsresource.cpp +++ b/service/things-manager/sampleapp/tizen/ConServerApp/src/maintenanceresource.cpp @@ -18,7 +18,7 @@ * ******************************************************************/ -#include "diagnosticsresource.h" +#include "maintenanceresource.h" #include #include @@ -46,9 +46,9 @@ MaintenanceResource::MaintenanceResource() : m_maintenanceUri = defaultMntURI; // URI of the resource m_maintenanceTypes.push_back(defaultMntResourceType); // resource type name m_maintenanceInterfaces.push_back(DEFAULT_INTERFACE); // resource interface - m_maintenanceRep.setValue("fr", m_factoryReset); - m_maintenanceRep.setValue("rb", m_reboot); - m_maintenanceRep.setValue("ssc", m_startStatCollection); + m_maintenanceRep.setValue(DEFAULT_FACTORYRESET, m_factoryReset); + m_maintenanceRep.setValue(DEFAULT_REBOOT, m_reboot); + m_maintenanceRep.setValue(DEFAULT_STARTCOLLECTION, m_startStatCollection); m_maintenanceRep.setUri(m_maintenanceUri); m_maintenanceRep.setResourceTypes(m_maintenanceTypes); m_maintenanceRep.setResourceInterfaces(m_maintenanceInterfaces); @@ -91,20 +91,20 @@ void MaintenanceResource::setMaintenanceRepresentation(OCRepresentation &rep) { std::string value; - if (rep.getValue("fr", value)) + if (rep.getValue(DEFAULT_FACTORYRESET, value)) { m_factoryReset = value; dlog_print(DLOG_INFO, "MaintenanceResource", "#### m_factoryReset: %s", m_factoryReset.c_str()); } - if (rep.getValue("rb", value)) + if (rep.getValue(DEFAULT_REBOOT, value)) { m_reboot = value; dlog_print(DLOG_INFO, "MaintenanceResource", "#### m_reboot: %s", m_reboot.c_str()); } - if (rep.getValue("ssc", value)) + if (rep.getValue(DEFAULT_STARTCOLLECTION, value)) { m_startStatCollection = value; dlog_print(DLOG_INFO, "MaintenanceResource", "#### m_startStatCollection: %s", @@ -114,9 +114,9 @@ void MaintenanceResource::setMaintenanceRepresentation(OCRepresentation &rep) OCRepresentation MaintenanceResource::getMaintenanceRepresentation() { - m_maintenanceRep.setValue("fr", m_factoryReset); - m_maintenanceRep.setValue("rb", m_reboot); - m_maintenanceRep.setValue("ssc", m_startStatCollection); + m_maintenanceRep.setValue(DEFAULT_FACTORYRESET, m_factoryReset); + m_maintenanceRep.setValue(DEFAULT_REBOOT, m_reboot); + m_maintenanceRep.setValue(DEFAULT_STARTCOLLECTION, m_startStatCollection); return m_maintenanceRep; } diff --git a/service/things-manager/sampleapp/tizen/TMSampleApp/inc/tmsampleapp.h b/service/things-manager/sampleapp/tizen/TMSampleApp/inc/tmsampleapp.h index 8655eea..0742dab 100644 --- a/service/things-manager/sampleapp/tizen/TMSampleApp/inc/tmsampleapp.h +++ b/service/things-manager/sampleapp/tizen/TMSampleApp/inc/tmsampleapp.h @@ -18,8 +18,8 @@ * ******************************************************************/ -#ifndef __TMSAMPLEAPP_H__ -#define __TMSAMPLEAPP_H__ +#ifndef TMSAMPLEAPP_H__ +#define TMSAMPLEAPP_H__ #include #include @@ -48,12 +48,13 @@ #define FINDGROUP_TIMEOUT 5 #define FINDRESOURCE_TIMEOUT 6 +#define DEFAULT_DEVICENAME "n" #define DEFAULT_LOCATION "loc" -#define DEFAULT_SYSTIME "st" +#define DEFAULT_LOCATIONNAME "locn" #define DEFAULT_CURRENCY "c" #define DEFAULT_REGION "r" void group_cb(void *data, Evas_Object *obj, void *event_info); void configuration_cb(void *data, Evas_Object *obj, void *event_info); -#endif // __TMSAMPLEAPP_H__ \ No newline at end of file +#endif // TMSAMPLEAPP_H__ \ No newline at end of file diff --git a/service/things-manager/sampleapp/tizen/TMSampleApp/inc/tmutil.h b/service/things-manager/sampleapp/tizen/TMSampleApp/inc/tmutil.h index 373ec4f..47346f3 100644 --- a/service/things-manager/sampleapp/tizen/TMSampleApp/inc/tmutil.h +++ b/service/things-manager/sampleapp/tizen/TMSampleApp/inc/tmutil.h @@ -22,9 +22,9 @@ using namespace std; -#ifndef __TMUTIL_H__ -#define __TMUTIL_H__ +#ifndef TMUTIL_H__ +#define TMUTIL_H__ extern std::string getOCStackResultStringFromInt(int result); -#endif // __TMUTIL_H__ \ No newline at end of file +#endif // TMUTIL_H__ \ No newline at end of file diff --git a/service/things-manager/sampleapp/tizen/TMSampleApp/src/configuration.cpp b/service/things-manager/sampleapp/tizen/TMSampleApp/src/configuration.cpp index ef1ee8d..bdeccb0 100644 --- a/service/things-manager/sampleapp/tizen/TMSampleApp/src/configuration.cpp +++ b/service/things-manager/sampleapp/tizen/TMSampleApp/src/configuration.cpp @@ -62,9 +62,9 @@ string CONFIGURATION_RESOURCE_URI = "/oic/con"; string MAINTENANCE_RESOURCE_URI = "/oic/mnt"; string FACTORYSET_RESOURCE_URI = "/factorySet"; -GroupManager *g_groupManager = new GroupManager(); -ThingsConfiguration *g_thingsConfig = new ThingsConfiguration(); -ThingsMaintenance *g_thingsMnt = new ThingsMaintenance(); +GroupManager *g_groupManager = nullptr; +ThingsConfiguration *g_thingsConfig = nullptr; +ThingsMaintenance *g_thingsMnt = nullptr; typedef struct region_popup @@ -276,29 +276,40 @@ static void onUpdateConfigurationsCallback(const HeaderOptions &headerOptions, string logMessage = "Resource URI: " + rep.getUri() + "
"; dlog_print(DLOG_INFO, LOG_TAG, "#### Resource URI: %s", rep.getUri().c_str()); + if (rep.hasAttribute(DEFAULT_DEVICENAME)) + { + dlog_print(DLOG_INFO, LOG_TAG, "#### Device Name : %s", + rep.getValue< std::string >(DEFAULT_DEVICENAME).c_str()); + logMessage = logMessage + "Device Name : " + + rep.getValue< std::string >(DEFAULT_DEVICENAME) + "
"; + } if (rep.hasAttribute(DEFAULT_LOCATION)) { dlog_print(DLOG_INFO, LOG_TAG, "#### Location : %s", - rep.getValue< std::string >("loc").c_str()); - logMessage = logMessage + "Location : " + rep.getValue< std::string >("loc") + "
"; + rep.getValue< std::string >(DEFAULT_LOCATION).c_str()); + logMessage = logMessage + "Location : " + + rep.getValue< std::string >(DEFAULT_LOCATION) + "
"; } - if (rep.hasAttribute(DEFAULT_SYSTIME)) + if (rep.hasAttribute(DEFAULT_LOCATIONNAME)) { - dlog_print(DLOG_INFO, LOG_TAG, "#### SystemTime : %s", - rep.getValue< std::string >("st").c_str()); - logMessage = logMessage + "SystemTime : " + rep.getValue< std::string >("st") + "
"; + dlog_print(DLOG_INFO, LOG_TAG, "#### Location Name : %s", + rep.getValue< std::string >(DEFAULT_LOCATIONNAME).c_str()); + logMessage = logMessage + "Location Name: " + + rep.getValue< std::string >(DEFAULT_LOCATIONNAME) + "
"; } if (rep.hasAttribute(DEFAULT_CURRENCY)) { dlog_print(DLOG_INFO, LOG_TAG, "#### Currency : %s", - rep.getValue< std::string >("c").c_str()); - logMessage = logMessage + "Currency : " + rep.getValue< std::string >("c") + "
"; + rep.getValue< std::string >(DEFAULT_CURRENCY).c_str()); + logMessage = logMessage + "Currency : " + + rep.getValue< std::string >(DEFAULT_CURRENCY) + "
"; } if (rep.hasAttribute(DEFAULT_REGION)) { dlog_print(DLOG_INFO, LOG_TAG, "#### Region : %s", - rep.getValue< std::string >("r").c_str()); - logMessage = logMessage + "Region : " + rep.getValue< std::string >("r") + "
"; + rep.getValue< std::string >(DEFAULT_REGION).c_str()); + logMessage = logMessage + "Region : " + + rep.getValue< std::string >(DEFAULT_REGION) + "
"; } logMessage += "----------------------
"; dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str()); @@ -325,29 +336,40 @@ static void onGetConfigurationsCallback(const HeaderOptions &headerOptions, string logMessage = "Resource URI: " + rep.getUri() + "
"; dlog_print(DLOG_INFO, LOG_TAG, "#### Resource URI: %s", rep.getUri().c_str()); + if (rep.hasAttribute(DEFAULT_DEVICENAME)) + { + dlog_print(DLOG_INFO, LOG_TAG, "#### Device Name : %s", + rep.getValue< std::string >(DEFAULT_DEVICENAME).c_str()); + logMessage = logMessage + "Device Name : " + + rep.getValue< std::string >(DEFAULT_DEVICENAME) + "
"; + } if (rep.hasAttribute(DEFAULT_LOCATION)) { dlog_print(DLOG_INFO, LOG_TAG, "#### Location : %s", rep.getValue< std::string >(DEFAULT_LOCATION).c_str()); - logMessage = logMessage + "Location : " + rep.getValue< std::string >(DEFAULT_LOCATION) + "
"; + logMessage = logMessage + "Location : " + + rep.getValue< std::string >(DEFAULT_LOCATION) + "
"; } - if (rep.hasAttribute(DEFAULT_SYSTIME)) + if (rep.hasAttribute(DEFAULT_LOCATIONNAME)) { - dlog_print(DLOG_INFO, LOG_TAG, "#### SystemTime : %s", - rep.getValue< std::string >(DEFAULT_SYSTIME).c_str()); - logMessage = logMessage + "SystemTime : " + rep.getValue< std::string >(DEFAULT_SYSTIME) + "
"; + dlog_print(DLOG_INFO, LOG_TAG, "#### Location Name : %s", + rep.getValue< std::string >(DEFAULT_LOCATIONNAME).c_str()); + logMessage = logMessage + "Location Name : " + + rep.getValue< std::string >(DEFAULT_LOCATIONNAME) + "
"; } if (rep.hasAttribute(DEFAULT_CURRENCY)) { dlog_print(DLOG_INFO, LOG_TAG, "#### Currency : %s", rep.getValue< std::string >(DEFAULT_CURRENCY).c_str()); - logMessage = logMessage + "Currency : " + rep.getValue< std::string >(DEFAULT_CURRENCY) + "
"; + logMessage = logMessage + "Currency : " + + rep.getValue< std::string >(DEFAULT_CURRENCY) + "
"; } if (rep.hasAttribute(DEFAULT_REGION)) { dlog_print(DLOG_INFO, LOG_TAG, "#### Region : %s", rep.getValue< std::string >(DEFAULT_REGION).c_str()); - logMessage = logMessage + "Region : " + rep.getValue< std::string >(DEFAULT_REGION) + "
"; + logMessage = logMessage + "Region : " + + rep.getValue< std::string >(DEFAULT_REGION) + "
"; } logMessage += "----------------------
"; @@ -574,7 +596,7 @@ static void updateConfiguration(std::string newRegionValue) } OCStackResult result; - ConfigurationName name = "r"; + ConfigurationName name = DEFAULT_REGION; ConfigurationValue value = newRegionValue; std::map< ConfigurationName, ConfigurationValue > configurations; @@ -701,6 +723,10 @@ static void onStartConfigure() createResourceCollection(FACTORYSET_COLLECTION_RESOURCE_URI, FACTORYSET_COLLECTION_RESOURCE_TYPE, setCollectionHandle); + + g_groupManager = new GroupManager(); + g_thingsConfig = new ThingsConfiguration(); + g_thingsMnt = new ThingsMaintenance(); } // Deletes all the resources @@ -708,11 +734,15 @@ static void onDestroyConfigure() { dlog_print(DLOG_INFO, LOG_TAG, "#### Destroy sequence called"); - deleteResource(configurationCollectionHandle, configurationFoundHandle); + deleteResource(setCollectionHandle, setFoundHandle); deleteResource(maintenanceCollectionHandle, maintenanceFoundHandle); - deleteResource(setCollectionHandle, setFoundHandle); + deleteResource(configurationCollectionHandle, configurationFoundHandle); + + delete g_thingsMnt; + delete g_thingsConfig; + delete g_groupManager; dlog_print(DLOG_INFO, LOG_TAG, "#### Resources destroyed successfully"); }