check scanning status first

pull/9646/head
paul-szczepanek-arm 2019-01-30 11:45:26 +00:00 committed by adbridge
parent a0b5b60e6b
commit 77113a9f2c
1 changed files with 4 additions and 4 deletions

View File

@ -1480,16 +1480,16 @@ BLE_DEPRECATED_API_USE_END()
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 (is_extended_advertising_available()) {
_pal_gap.scan_enable(false, false);
set_random_address_rotation(false);
}
if (!_scan_enabled) {
return;
}
_scan_enabled = false;
if (!_eventHandler) {