Skip to content

Commit d9c919b

Browse files
review fixes
1 parent e1a8fb5 commit d9c919b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

features/FEATURE_BLE/source/generic/GenericGap.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,7 @@ ble_error_t GenericGap::stopScan()
591591
set_random_address_rotation(false);
592592

593593
_scan_timeout.detach();
594+
594595
return BLE_ERROR_NONE;
595596
}
596597

@@ -1487,7 +1488,7 @@ void GenericGap::on_scan_timeout()
14871488
}
14881489

14891490
/* if timeout happened on a 4.2 chip we need to stop the scan manually */
1490-
if (is_extended_advertising_available()) {
1491+
if (!is_extended_advertising_available()) {
14911492
_pal_gap.scan_enable(false, false);
14921493
set_random_address_rotation(false);
14931494
}
@@ -2983,8 +2984,6 @@ ble_error_t GenericGap::startScan(
29832984
if (err) {
29842985
return err;
29852986
}
2986-
2987-
_scan_enabled = true;
29882987
} else {
29892988
if (period.value() != 0) {
29902989
return BLE_ERROR_INVALID_PARAM;
@@ -2999,8 +2998,6 @@ ble_error_t GenericGap::startScan(
29992998
return err;
30002999
}
30013000

3002-
_scan_enabled = true;
3003-
30043001
_scan_timeout.detach();
30053002
if (duration.value()) {
30063003
_scan_timeout.attach_us(
@@ -3010,6 +3007,8 @@ ble_error_t GenericGap::startScan(
30103007
}
30113008
}
30123009

3010+
_scan_enabled = true;
3011+
30133012
return BLE_ERROR_NONE;
30143013
}
30153014

0 commit comments

Comments
 (0)