From 869e41e4e5c6a02544fc8c378cce5ee8fc77b229 Mon Sep 17 00:00:00 2001 From: "hyunuk.tak" Date: Mon, 19 Oct 2020 16:48:39 +0900 Subject: [PATCH] Add a number of iteration for updating device list Change-Id: Ia4c4f74ca41907cf154ed627f87f8a4fda094d51 --- src/wifi-state.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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; -- 2.34.1