Add discovery busy logic if bonding is in progress 13/284713/1
authorWootak Jung <wootak.jung@samsung.com>
Thu, 24 Nov 2022 06:13:20 +0000 (15:13 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 24 Nov 2022 06:13:54 +0000 (15:13 +0900)
Change-Id: I151e022e58c996e26d5d503836e9a2a799661431
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
bt-service/services/adapter/bt-service-core-adapter.c

index 3538516..db731c0 100644 (file)
@@ -1789,6 +1789,12 @@ static int __bt_adapter_state_discovery_request(gboolean enable,
                if (!enable)
                        return BLUETOOTH_ERROR_NOT_IN_OPERATION;
                else {
+                       if (_bt_device_is_bonding()) {
+                               BT_ERR("Device is in bonding, discovery can not preoceed now");
+                               result = BLUETOOTH_ERROR_DEVICE_BUSY;
+                               break;
+                       }
+
                        BT_DBG("max_resp: %u, duration: %u, cod: 0x%X", max_response, duration, mask);
 
                        if (!is_custom)