From 9c6f44de91328d616069122ce2c772223288a8ca Mon Sep 17 00:00:00 2001 From: Vincent Coubard Date: Wed, 21 Feb 2018 12:13:24 +0000 Subject: [PATCH] BLE: Force stop scan before connection initiation. --- features/FEATURE_BLE/source/generic/GenericGap.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/features/FEATURE_BLE/source/generic/GenericGap.cpp b/features/FEATURE_BLE/source/generic/GenericGap.cpp index 7efe40e9f7..5668e3715b 100644 --- a/features/FEATURE_BLE/source/generic/GenericGap.cpp +++ b/features/FEATURE_BLE/source/generic/GenericGap.cpp @@ -503,6 +503,9 @@ ble_error_t GenericGap::connect( // TODO fix upper layer API, address type factorization is incorrect. + // Force scan stop before initiating the scan used for connection + stopScan(); + return _pal_gap.create_connection( scanParams->getInterval(), scanParams->getWindow(),