Skip to content

Commit 77113a9

Browse files
paul-szczepanek-armadbridge
authored andcommitted
check scanning status first
1 parent a0b5b60 commit 77113a9

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
@@ -1480,16 +1480,16 @@ BLE_DEPRECATED_API_USE_END()
14801480

14811481
void GenericGap::on_scan_timeout()
14821482
{
1483+
if (!_scan_enabled) {
1484+
return;
1485+
}
1486+
14831487
/* if timeout happened on a 4.2 chip we need to stop the scan manually */
14841488
if (is_extended_advertising_available()) {
14851489
_pal_gap.scan_enable(false, false);
14861490
set_random_address_rotation(false);
14871491
}
14881492

1489-
if (!_scan_enabled) {
1490-
return;
1491-
}
1492-
14931493
_scan_enabled = false;
14941494

14951495
if (!_eventHandler) {

0 commit comments

Comments
 (0)