From 5297663eae7ea57aedda731fd978fea8c3aa88f0 Mon Sep 17 00:00:00 2001 From: Maneesh Jain Date: Wed, 14 Dec 2016 16:33:02 +0530 Subject: [PATCH] [wifi-ug-efl]:Refactoring the Scan handling Path Description: This patch is used to handle following case. 1. Issue the Scan using "scan" button 2. Press the "WiFi" option to get the Scan list Change-Id: Ic3a63d5e4ddf72f454a1336506af9dcc335b32c1 Signed-off-by: Maneesh Jain --- sources/libraries/WlanManager/WlanManager/wlan_manager.c | 6 ++++-- sources/ui-gadget/wifi-efl-UG.c | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sources/libraries/WlanManager/WlanManager/wlan_manager.c b/sources/libraries/WlanManager/WlanManager/wlan_manager.c index 0fe7208..a8c7bc6 100755 --- a/sources/libraries/WlanManager/WlanManager/wlan_manager.c +++ b/sources/libraries/WlanManager/WlanManager/wlan_manager.c @@ -173,8 +173,10 @@ static void wlan_manager_network_event_cb( goto exit; /* fall through */ case WLAN_MANAGER_REQ_TYPE_SCAN: + INFO_LOG(UG_NAME_NORMAL, "Scan Complete Event "); if (WIFI_ERROR_NONE == error_code) { event_info.event_type = WLAN_MANAGER_RESPONSE_TYPE_SCAN_OK; + manager_object->b_scan_blocked = FALSE; } else { goto exit; } @@ -813,6 +815,7 @@ int wlan_manager_scan(void) wlan_mgr_req_data_t *req_data = g_new0(wlan_mgr_req_data_t, 1); req_data->req_type = WLAN_MANAGER_REQ_TYPE_SCAN; + manager_object->b_scan_blocked = TRUE; int ret = wifi_scan(wlan_manager_network_event_cb, req_data); if (ret != WLAN_MANAGER_ERR_NONE) { ERROR_LOG(UG_NAME_REQ, "Scan failed. Ret: %d", ret); @@ -824,9 +827,8 @@ int wlan_manager_scan(void) } /* Since the scan request was success, - * lets reset the ui refresh and scan update blocked flags. + * lets reset the ui refresh */ - manager_object->b_scan_blocked = FALSE; manager_object->b_ui_refresh = FALSE; __COMMON_FUNC_EXIT__; diff --git a/sources/ui-gadget/wifi-efl-UG.c b/sources/ui-gadget/wifi-efl-UG.c index 8da98c1..350a791 100755 --- a/sources/ui-gadget/wifi-efl-UG.c +++ b/sources/ui-gadget/wifi-efl-UG.c @@ -77,8 +77,9 @@ static void _bg_scan_status_callback(GDBusConnection *conn, if (g_strcmp0(key, "Scanning") == 0) { value = g_variant_get_boolean(var); if (value) { - viewer_manager_header_mode_set(HEADER_MODE_SEARCHING); - viewer_manager_show(VIEWER_WINSET_SEARCHING); + //TODO: Ignore the Supplicant Property Change Singal. + //viewer_manager_header_mode_set(HEADER_MODE_SEARCHING); + //viewer_manager_show(VIEWER_WINSET_SEARCHING); } g_variant_unref(var); @@ -259,8 +260,10 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, case WLAN_MANAGER_UNCONNECTED: case WLAN_MANAGER_CONNECTED: viewer_manager_hide(VIEWER_WINSET_SEARCHING); + viewer_manager_header_mode_set(HEADER_MODE_ON); viewer_manager_show(VIEWER_WINSET_SUB_CONTENTS); - viewer_manager_header_mode_set(HEADER_MODE_SEARCHING); + INFO_LOG(UG_NAME_NORMAL, "Issue the WiFi Scan"); + viewer_manager_request_scan(); break; case WLAN_MANAGER_ERROR: -- 2.7.4