summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Sansanwal <abhishek.s94@samsung.com>2018-10-03 14:45:30 +0530
committerAbhishek Sansanwal <abhishek.s94@samsung.com>2018-10-03 14:48:23 +0530
commit247db8a34997b5fed5b7a04df8bacd74a3aafb90 (patch)
tree691d2732eef874efa952757f5a026eb63e5b1dad
parent2452d583708a72a68c3b26135df04891e81013b0 (diff)
downloadwifi-247db8a34997b5fed5b7a04df8bacd74a3aafb90.tar.gz
wifi-247db8a34997b5fed5b7a04df8bacd74a3aafb90.tar.bz2
wifi-247db8a34997b5fed5b7a04df8bacd74a3aafb90.zip
Signed-off-by: Abhishek Sansanwal <abhishek.s94@samsung.com> Change-Id: I43141c0ed9cef6c9c45237a7d46fe7bdeb51b437
-rw-r--r--sources/wearable/src/wearable-circle/app_main.c74
1 files changed, 59 insertions, 15 deletions
diff --git a/sources/wearable/src/wearable-circle/app_main.c b/sources/wearable/src/wearable-circle/app_main.c
index 4b6f592..f6e749c 100644
--- a/sources/wearable/src/wearable-circle/app_main.c
+++ b/sources/wearable/src/wearable-circle/app_main.c
@@ -6878,6 +6878,48 @@ static Evas_Object *__main_menu_power_content_get_cb(void *data, Evas_Object *ob
return NULL;
}
+static void __wifi_manager_deactivate_cb(wifi_manager_object *manager,
+ wifi_ap_object *ap, wifi_manager_error_e error_code, gpointer user_data)
+{
+ app_object *app_obj = user_data;
+
+ __WIFI_FUNC_ENTER__;
+
+ WIFI_RET_IF_FAIL(manager != NULL);
+ WIFI_RET_IF_FAIL(app_obj != NULL);
+
+ if (error_code != WIFI_MANAGER_ERROR_NONE) {
+ WIFI_LOG_ERR("Wi-Fi deactivate failed. error code = %s",
+ wifi_error_to_string(error_code));
+ return;
+ }
+
+ if (app_obj->checkbox_power)
+ elm_check_state_set(app_obj->checkbox_power, EINA_FALSE);
+}
+
+
+static void __wifi_manager_activate_cb(wifi_manager_object *manager,
+ wifi_ap_object *ap, wifi_manager_error_e error_code, gpointer user_data)
+{
+ app_object *app_obj = user_data;
+
+ __WIFI_FUNC_ENTER__;
+
+ WIFI_RET_IF_FAIL(manager != NULL);
+ WIFI_RET_IF_FAIL(app_obj != NULL);
+
+ if (error_code != WIFI_MANAGER_ERROR_NONE) {
+ WIFI_LOG_ERR("Wi-Fi activate failed. error code = %s",
+ wifi_error_to_string(error_code));
+ return;
+ }
+
+ if (app_obj->checkbox_power)
+ elm_check_state_set(app_obj->checkbox_power, EINA_TRUE);
+}
+
+
static void __main_menu_power_tap_cb(void *data, Evas_Object *obj, void *event_info)
{
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
@@ -6896,32 +6938,34 @@ static void __main_menu_power_tap_cb(void *data, Evas_Object *obj, void *event_i
}
if (wifi_is_wifi_use(app_obj->wifi_manager)) {
- WIFI_LOG_INFO("disable for wifi_power_off");
+ WIFI_LOG_INFO("disable for wifi_power_off");
_main_menu_disable_for_wifi_power_off(app_obj);
wifi_set_wifi_use(app_obj->wifi_manager, FALSE);
- WIFI_LOG_INFO("After deactive setting");
+ WIFI_LOG_INFO("After deactive setting");
- err = wifi_deactivate(app_obj->wifi_manager, NULL, NULL);
- if (err != WIFI_MANAGER_ERROR_NONE) {
- WIFI_LOG_ERR("wifi_deactivate() is failed. error = %s",
- wifi_error_to_string(err));
+ err = wifi_deactivate(app_obj->wifi_manager,
+ __wifi_manager_deactivate_cb, app_obj);
+ if (err != WIFI_MANAGER_ERROR_NONE) {
+ WIFI_LOG_ERR("wifi_deactivate() is failed. error = %s",
+ wifi_error_to_string(err));
return;
}
} else {
WIFI_LOG_INFO("disable_for_wifi_power_on");
- _main_menu_disable_for_wifi_power_on(app_obj);
- wifi_set_wifi_use(app_obj->wifi_manager, TRUE);
+ _main_menu_disable_for_wifi_power_on(app_obj);
+ wifi_set_wifi_use(app_obj->wifi_manager, TRUE);
WIFI_LOG_INFO("After active setting");
- err = wifi_activate(app_obj->wifi_manager, NULL, NULL);
- if (err != WIFI_MANAGER_ERROR_NONE) {
- WIFI_LOG_ERR("wifi_activate() is failed. error = %s",
- wifi_error_to_string(err));
- return;
- }
+ err = wifi_activate(app_obj->wifi_manager,
+ __wifi_manager_activate_cb, app_obj);
+ if (err != WIFI_MANAGER_ERROR_NONE) {
+ WIFI_LOG_ERR("wifi_activate() is failed. error = %s",
+ wifi_error_to_string(err));
+ return;
+ }
- _popup_scanning_show(app_obj, TRUE);
+ _popup_scanning_show(app_obj, TRUE);
}
}