From 50c2641a04e356fdac9c53fae56f5004f26605e0 Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Thu, 1 Aug 2024 13:46:34 +0530 Subject: [PATCH] feat/nimble: Add support to allow connection during scanning --- nimble/host/src/ble_gap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c index 839540494..f0b468941 100644 --- a/nimble/host/src/ble_gap.c +++ b/nimble/host/src/ble_gap.c @@ -6110,10 +6110,12 @@ ble_gap_ext_connect(uint8_t own_addr_type, const ble_addr_t *peer_addr, goto done; } +#if !MYNEWT_VAL(BLE_HOST_ALLOW_CONNECT_WITH_SCAN) if (ble_gap_disc_active()) { rc = BLE_HS_EBUSY; goto done; } +#endif if (!ble_hs_is_enabled()) { rc = BLE_HS_EDISABLED; @@ -6287,10 +6289,12 @@ ble_gap_connect(uint8_t own_addr_type, const ble_addr_t *peer_addr, goto done; } +#if !MYNEWT_VAL(BLE_HOST_ALLOW_CONNECT_WITH_SCAN) if (ble_gap_disc_active()) { rc = BLE_HS_EBUSY; goto done; } +#endif if (!ble_hs_is_enabled()) { rc = BLE_HS_EDISABLED;