From b091948a1e47779993d25339d3223eda50c6bfd2 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 | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/wifi-state.c b/src/wifi-state.c index 8b7e4a6..5764df4 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,10 +729,17 @@ 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); + network_update_timer_cnt = 0; + return FALSE; } -- 2.34.1