Skip to content

Commit 03fda0c

Browse files
paul-szczepanek-armadbridge
authored andcommitted
review fixes
1 parent 77113a9 commit 03fda0c

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

@@ -1485,7 +1486,7 @@ void GenericGap::on_scan_timeout()
14851486
}
14861487

14871488
/* if timeout happened on a 4.2 chip we need to stop the scan manually */
1488-
if (is_extended_advertising_available()) {
1489+
if (!is_extended_advertising_available()) {
14891490
_pal_gap.scan_enable(false, false);
14901491
set_random_address_rotation(false);
14911492
}
@@ -2920,8 +2921,6 @@ ble_error_t GenericGap::startScan(
29202921
if (err) {
29212922
return err;
29222923
}
2923-
2924-
_scan_enabled = true;
29252924
} else {
29262925
if (period.value() != 0) {
29272926
return BLE_ERROR_INVALID_PARAM;
@@ -2936,8 +2935,6 @@ ble_error_t GenericGap::startScan(
29362935
return err;
29372936
}
29382937

2939-
_scan_enabled = true;
2940-
29412938
_scan_timeout.detach();
29422939
if (duration.value()) {
29432940
_scan_timeout.attach_us(
@@ -2947,6 +2944,8 @@ ble_error_t GenericGap::startScan(
29472944
}
29482945
}
29492946

2947+
_scan_enabled = true;
2948+
29502949
return BLE_ERROR_NONE;
29512950
}
29522951

0 commit comments

Comments
 (0)