check scanning status first

pull/9549/head
paul-szczepanek-arm 2019-01-30 11:45:26 +00:00
parent 7f888f86bf
commit e1a8fb5a7a
1 changed files with 4 additions and 4 deletions

View File

@ -1482,16 +1482,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) {