Fix LE stop scanning related bugs 98/42198/1
authorseungku kim <seungku.kim@samsung.com>
Wed, 24 Jun 2015 10:46:54 +0000 (19:46 +0900)
committerseungku kim <seungku.kim@samsung.com>
Wed, 24 Jun 2015 10:48:31 +0000 (19:48 +0900)
When the LE stopped by non-user, it was not stopped properly.

Change-Id: I9cbdbe453f19e6ad8742ecc19275577ade9b591e

bt-service/bt-service-adapter-le.c
bt-service/bt-service-event-receiver.c
bt-service/include/bt-service-adapter-le.h

index e7693ad..605815e 100644 (file)
@@ -1311,6 +1311,17 @@ int _bt_stop_le_scan(const char *sender)
        return BLUETOOTH_ERROR_NONE;
 }
 
+void _bt_disable_all_scanner_status(void)
+{
+       GSList *l;
+       bt_adapter_le_scanner_t *scanner;
+
+       for (l = scanner_list; l != NULL; l = g_slist_next(l)) {
+               scanner = l->data;
+               scanner->is_scanning = FALSE;
+       }
+}
+
 void _bt_set_le_scan_status(gboolean mode)
 {
        is_le_scanning = mode;
index 87e2dbe..3258b70 100644 (file)
@@ -302,6 +302,7 @@ gboolean _bt_discovery_finished_cb(gpointer user_data)
                }
 
                _bt_set_cancel_by_user(FALSE);
+               _bt_disable_all_scanner_status();
                _bt_set_discovery_status(FALSE);
                param = g_variant_new("(i)", result);
                _bt_send_event(BT_ADAPTER_EVENT,
index 04f61b2..1953514 100644 (file)
@@ -102,6 +102,8 @@ int _bt_start_le_scan(const char *sender);
 
 int _bt_stop_le_scan(const char *sender);
 
+void _bt_disable_all_scanner_status(void);
+
 void _bt_set_le_scan_status(gboolean mode);
 
 gboolean _bt_is_le_scanning(void);