Remove logic of scan timer in netlink-scan method. 05/171205/1 accepted/tizen/unified/20180302.061528 submit/tizen/20180228.035728
authorNiraj Kumar Goit <niraj.g@samsung.com>
Tue, 27 Feb 2018 11:53:17 +0000 (17:23 +0530)
committerNiraj Kumar Goit <niraj.g@samsung.com>
Tue, 27 Feb 2018 11:53:17 +0000 (17:23 +0530)
Change-Id: I01c3d9a0538c20c0518bfd74532e21d994fd2c82
Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
src/wifi-netlink-scan.c

index c1eab05..320078f 100755 (executable)
 #include <ctype.h>
 
 static GSList *bss_info_list = NULL;
-static guint scan_timer = 0;
 static unsigned char samsung_oui[3] = {0x00, 0x16, 0x32};
 
-static gboolean __netconfig_scan_timeout(gpointer data)
-{
-       __netconfig_notify_netlink_scan_done();
-
-       return FALSE;
-}
-
-static void __netconfig_start_scan_timer(void)
-{
-       if (scan_timer == 0) {
-               netconfig_start_timer_seconds(5, __netconfig_scan_timeout, NULL, &scan_timer);
-               INFO("Get scan data timer started: %d", scan_timer);
-       }
-}
-
-static void __netconfig_stop_scan_timer(void)
-{
-       netconfig_stop_timer(&scan_timer);
-       INFO("Get scan data timer stopped: %d", scan_timer);
-}
-
 void __netconfig_notify_netlink_scan_done(void)
 {
        GVariantBuilder *builder = NULL;
@@ -93,7 +71,6 @@ void __netconfig_notify_netlink_scan_done(void)
                g_slist_free_full(bss_info_list, g_free);
 
        bss_info_list = NULL;
-       __netconfig_stop_scan_timer();
        INFO("NetlinkScanCompleted");
 
        return;
@@ -349,10 +326,6 @@ static int __netconfig_netlink_scan_cb(struct nl_msg *msg, void *user_data)
                else
                        bss_info_list = g_slist_append(bss_info_list, bss_info);
 
-               if (scan_timer == 0) {
-                       DBG("Start scan timer");
-                       __netconfig_start_scan_timer();
-               }
        }
 
        return NL_SKIP;
@@ -593,5 +566,7 @@ int handle_netlink_scan(Wifi *wifi, GDBusMethodInvocation *context, GVariant *pa
        }
 
        wifi_complete_netlink_scan(wifi, context);
+       __netconfig_notify_netlink_scan_done();
+
        return 1;
 }