Set LE scanning mode to true only in case of success 08/41808/1
authorAnupam <anupam.r@samsung.com>
Wed, 17 Jun 2015 14:32:15 +0000 (10:32 -0400)
committerAnupam <anupam.r@samsung.com>
Wed, 17 Jun 2015 14:41:36 +0000 (10:41 -0400)
'is_scanning' status of LE scanner should be set only
when LE Scan is successfully triggered.In case, adapter proxy
fetch is failed or LE Scan is not triggered successfully,
scanning status of particular scanner should remain FALSE,
which can save unneccessary processing in _bt_stop_le_scan method.

Change-Id: I34ce0f3a3eaca50cd3233468dde705d32d6f074e
Signed-off-by: Anupam <anupam.r@samsung.com>
bt-service/bt-service-adapter-le.c

index 6d8aebb..e7693ad 100644 (file)
@@ -1155,7 +1155,6 @@ int _bt_start_le_scan(const char *sender)
                BT_ERR("BT is already in LE scanning");
                return BLUETOOTH_ERROR_IN_PROGRESS;
        }
-       scanner->is_scanning = TRUE;
 
        proxy = _bt_get_adapter_proxy();
        retv_if(proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
@@ -1182,6 +1181,8 @@ int _bt_start_le_scan(const char *sender)
                } else {
                        BT_INFO("LE Full Scan is already on progress");
                }
+
+               scanner->is_scanning = TRUE;
                return BLUETOOTH_ERROR_NONE;
        } else {
                if (is_le_set_scan_parameter == FALSE) {
@@ -1225,6 +1226,8 @@ int _bt_start_le_scan(const char *sender)
 
        if (ret)
                g_variant_unref(ret);
+
+       scanner->is_scanning = TRUE;
        return BLUETOOTH_ERROR_NONE;
 }