dlog_print(DLOG_INFO, LOG_TAG, "#### calling findCandidateResources ENTRY!!!!");
std::vector<string> resourceTypes;
resourceTypes.push_back("oic.wk.con");
-
- if (NULL != g_groupManager)
- {
- g_groupManager->findCandidateResources(resourceTypes, &onFoundCandidateResource,
- FINDRESOURCE_TIMEOUT);
- }
-
- resourceTypes.clear();
resourceTypes.push_back("oic.wk.mnt");
- if (NULL != g_groupManager)
- {
- g_groupManager->findCandidateResources(resourceTypes, &onFoundCandidateResource,
- FINDRESOURCE_TIMEOUT);
- }
-
- resourceTypes.clear();
resourceTypes.push_back("factoryset");
+
if (NULL != g_groupManager)
{
g_groupManager->findCandidateResources(resourceTypes, &onFoundCandidateResource,
return;
}
+ if (NULL == g_configurationResource)
+ {
+ dlog_print(DLOG_INFO, LOG_TAG, "Configuration Resource not found.");
+ string logMessage = "FIRST FIND CONFIGURATION RESOURCE <br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
+ ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
+ return;
+ }
+
ConfigurationName name = "all";
std::vector< ConfigurationName > configurations;
configurations.push_back(name);
dlog_print(DLOG_INFO, LOG_TAG, "#### getConfiguration EXIT!!!!");
}
-// Updates the configuration i.e. region value to INDIA
-static void updateConfiguration(std::string newRegionValue)
+// Updates the configuration i.e. Device name to OIC Device
+static void updateConfiguration(std::string newDeviceName)
{
dlog_print(DLOG_INFO, LOG_TAG, "#### updateConfiguration ENTRY!!!!");
- dlog_print(DLOG_INFO, LOG_TAG, "#### %s", newRegionValue.c_str());
+ dlog_print(DLOG_INFO, LOG_TAG, "#### %s", newDeviceName.c_str());
if (NULL == g_configurationCollection || NULL == g_configurationCollection.get())
{
return;
}
+ if (NULL == g_configurationResource)
+ {
+ dlog_print(DLOG_INFO, LOG_TAG, "Configuration Resource not found.");
+ string logMessage = "FIRST FIND CONFIGURATION RESOURCE <br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
+ ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
+ return;
+ }
+
OCStackResult result;
- ConfigurationName name = DEFAULT_REGION;
- ConfigurationValue value = newRegionValue;
+ ConfigurationName name = DEFAULT_DEVICENAME;
+ ConfigurationValue value = newDeviceName;
std::map< ConfigurationName, ConfigurationValue > configurations;
configurations.insert(std::make_pair(name, value));
return;
}
+ if (NULL == g_maintenanceResource)
+ {
+ dlog_print(DLOG_INFO, LOG_TAG, "Maintenance Resource not found.");
+ string logMessage = "FIRST FIND MAINTENANCE RESOURCE <br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
+ ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
+ return;
+ }
+
OCStackResult result;
try
return;
}
+ if (NULL == g_maintenanceResource)
+ {
+ dlog_print(DLOG_INFO, LOG_TAG, "Maintenance Resource not found.");
+ string logMessage = "FIRST FIND MAINTENANCE RESOURCE <br>";
+ dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
+ ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
+ return;
+ }
+
OCStackResult result;
try
}
static void
-list_update_region_cb(void *data, Evas_Object *obj, void *event_info)
+list_update_devicename_cb(void *data, Evas_Object *obj, void *event_info)
{
if (NULL == g_configurationCollection || NULL == g_configurationCollection.get())
{
elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL);
evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_object_part_text_set(popup, "title,text", "Enter New Region Value");
+ elm_object_part_text_set(popup, "title,text", "Enter new device name to update");
layout = elm_layout_add(popup);
elm_layout_file_set(layout, ELM_DEMO_EDJ, "popup_region_text");
evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
eext_entry_selection_back_event_allow_set(entry, EINA_TRUE);
- elm_object_part_text_set(entry, "elm.guide", "region value");
+ elm_object_part_text_set(entry, "elm.guide", "e.g. OIC Device");
elm_object_part_content_set(layout, "elm.swallow.content" , entry);
region_popup_fields *popup_fields;
elm_list_item_append(list, "Find All Resources",
NULL, NULL, findAllResources, NULL);
elm_list_item_append(list, "Get a Configuration Resource", NULL, NULL, getConfiguration, NULL);
- elm_list_item_append(list, "Update Attribute (Region)", NULL, NULL,
- list_update_region_cb, nf);
+ elm_list_item_append(list, "Update Attribute (Device Name)", NULL, NULL,
+ list_update_devicename_cb, nf);
elm_list_item_append(list, "Factory Reset", NULL, NULL, factoryReset, NULL);
elm_list_item_append(list, "Reboot", NULL, NULL, reboot, NULL);
elm_list_item_append(list, "Get Supported Configuration Units", NULL, NULL,