Skip to content

Commit e1a8fb5

Browse files
check scanning status first
1 parent 7f888f8 commit e1a8fb5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

features/FEATURE_BLE/source/generic/GenericGap.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,16 +1482,16 @@ BLE_DEPRECATED_API_USE_END()
14821482

14831483
void GenericGap::on_scan_timeout()
14841484
{
1485+
if (!_scan_enabled) {
1486+
return;
1487+
}
1488+
14851489
/* if timeout happened on a 4.2 chip we need to stop the scan manually */
14861490
if (is_extended_advertising_available()) {
14871491
_pal_gap.scan_enable(false, false);
14881492
set_random_address_rotation(false);
14891493
}
14901494

1491-
if (!_scan_enabled) {
1492-
return;
1493-
}
1494-
14951495
_scan_enabled = false;
14961496

14971497
if (!_eventHandler) {

0 commit comments

Comments
 (0)