From: hyunuk.tak Date: Mon, 19 Oct 2020 07:48:39 +0000 (+0900) Subject: Add a number of iteration for updating device list X-Git-Tag: submit/tizen/20201028.023046^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=869e41e4e5c6a02544fc8c378cce5ee8fc77b229;p=platform%2Fcore%2Fconnectivity%2Fnet-config.git Add a number of iteration for updating device list Change-Id: Ia4c4f74ca41907cf154ed627f87f8a4fda094d51 --- diff --git a/src/wifi-state.c b/src/wifi-state.c index 8b7e4a6..ee3b1d4 100755 --- a/src/wifi-state.c +++ b/src/wifi-state.c @@ -33,11 +33,13 @@ #include "network-statistics.h" #include "wifi-background-scan.h" +#define NETCONFIG_UPDATE_DEVICE_LIST_COUNT 3 #define NETCONFIG_UPDATE_DEVICE_LIST_TIMEOUT 1 * 1000 #define NETCONFIG_NETWORK_NOTIFICATION_TIMEOUT 15 * 1000 static gboolean new_bss_found = FALSE; +static guint network_update_timer_cnt = 0; static guint network_update_timer_id = 0; static guint network_noti_timer_id = 0; @@ -727,8 +729,13 @@ GSList *wifi_state_get_device_list(void) static gboolean __state_update_device_list(gpointer data) { - if (wifi_state_update_device_list() == FALSE) - return TRUE; + if (wifi_state_update_device_list() == FALSE) { + if (network_update_timer_cnt < + NETCONFIG_UPDATE_DEVICE_LIST_COUNT) { + network_update_timer_cnt++; + return TRUE; + } + } netconfig_stop_timer(&network_update_timer_id); return FALSE;