Merge pull request #14202 from paul-szczepanek-arm/fix-stop-advert

BLE: return OK when stopping advertising set that is not active
pull/14232/head
Martin Kojtal 2021-02-03 09:31:24 +00:00 committed by GitHub
commit 5e1d13886c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -2120,10 +2120,14 @@ ble_error_t Gap::stopAdvertising(advertising_handle_t handle)
} }
#endif // BLE_FEATURE_EXTENDED_ADVERTISING #endif // BLE_FEATURE_EXTENDED_ADVERTISING
if (!_active_sets.get(handle) || _pending_sets.get(handle)) { if (_pending_sets.get(handle)) {
return BLE_STACK_BUSY; return BLE_STACK_BUSY;
} }
if (!_active_sets.get(handle)) {
return BLE_ERROR_NONE;
}
#if BLE_FEATURE_EXTENDED_ADVERTISING #if BLE_FEATURE_EXTENDED_ADVERTISING
if (is_extended_advertising_available()) { if (is_extended_advertising_available()) {
status = _pal_gap.extended_advertising_enable( status = _pal_gap.extended_advertising_enable(