Skip to content

Commit 402a447

Browse files
committed
BLE: Ensure scan process is stopped before connecting.
1 parent 78468fb commit 402a447

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

features/FEATURE_BLE/source/generic/GenericGap.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,9 @@ ble_error_t GenericGap::connect(
675675
return BLE_ERROR_INVALID_PARAM;
676676
}
677677

678+
// ensure scan is stopped.
679+
_pal_gap.scan_enable(false, false);
680+
678681
return _pal_gap.create_connection(
679682
connectionParams.getScanIntervalArray()[0],
680683
connectionParams.getScanWindowArray()[0],
@@ -691,6 +694,9 @@ ble_error_t GenericGap::connect(
691694
);
692695
}
693696

697+
// ensure scan is stopped.
698+
_pal_gap.extended_scan_enable(false, pal::duplicates_filter_t::DISABLE, 0, 0);
699+
694700
// reduce the address type to public or random
695701
peer_address_type_t adjusted_address_type(peer_address_type_t::PUBLIC);
696702

0 commit comments

Comments
 (0)