mirror of https://github.com/ARMmbed/mbed-os.git
review fixes
parent
77113a9f2c
commit
03fda0c842
|
@ -591,6 +591,7 @@ ble_error_t GenericGap::stopScan()
|
||||||
set_random_address_rotation(false);
|
set_random_address_rotation(false);
|
||||||
|
|
||||||
_scan_timeout.detach();
|
_scan_timeout.detach();
|
||||||
|
|
||||||
return BLE_ERROR_NONE;
|
return BLE_ERROR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1485,7 +1486,7 @@ void GenericGap::on_scan_timeout()
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if timeout happened on a 4.2 chip we need to stop the scan manually */
|
/* if timeout happened on a 4.2 chip we need to stop the scan manually */
|
||||||
if (is_extended_advertising_available()) {
|
if (!is_extended_advertising_available()) {
|
||||||
_pal_gap.scan_enable(false, false);
|
_pal_gap.scan_enable(false, false);
|
||||||
set_random_address_rotation(false);
|
set_random_address_rotation(false);
|
||||||
}
|
}
|
||||||
|
@ -2920,8 +2921,6 @@ ble_error_t GenericGap::startScan(
|
||||||
if (err) {
|
if (err) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
_scan_enabled = true;
|
|
||||||
} else {
|
} else {
|
||||||
if (period.value() != 0) {
|
if (period.value() != 0) {
|
||||||
return BLE_ERROR_INVALID_PARAM;
|
return BLE_ERROR_INVALID_PARAM;
|
||||||
|
@ -2936,8 +2935,6 @@ ble_error_t GenericGap::startScan(
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
_scan_enabled = true;
|
|
||||||
|
|
||||||
_scan_timeout.detach();
|
_scan_timeout.detach();
|
||||||
if (duration.value()) {
|
if (duration.value()) {
|
||||||
_scan_timeout.attach_us(
|
_scan_timeout.attach_us(
|
||||||
|
@ -2947,6 +2944,8 @@ ble_error_t GenericGap::startScan(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_scan_enabled = true;
|
||||||
|
|
||||||
return BLE_ERROR_NONE;
|
return BLE_ERROR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue