mirror of https://github.com/ARMmbed/mbed-os.git
check scanning status first
parent
a0b5b60e6b
commit
77113a9f2c
|
@ -1480,16 +1480,16 @@ BLE_DEPRECATED_API_USE_END()
|
||||||
|
|
||||||
void GenericGap::on_scan_timeout()
|
void GenericGap::on_scan_timeout()
|
||||||
{
|
{
|
||||||
|
if (!_scan_enabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_scan_enabled) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_scan_enabled = false;
|
_scan_enabled = false;
|
||||||
|
|
||||||
if (!_eventHandler) {
|
if (!_eventHandler) {
|
||||||
|
|
Loading…
Reference in New Issue