Skip to content

Commit 50d1818

Browse files
call advertising end even if stopped by us
1 parent 13a10f3 commit 50d1818

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

features/FEATURE_BLE/source/generic/GenericGap.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,9 +2387,6 @@ ble_error_t GenericGap::stopAdvertising(advertising_handle_t handle)
23872387
ble_error_t status;
23882388

23892389
if (is_extended_advertising_available()) {
2390-
2391-
_active_sets.clear(handle);
2392-
23932390
status = _pal_gap.extended_advertising_enable(
23942391
/*enable ? */ false,
23952392
/* number of advertising sets */ 1,
@@ -2399,26 +2396,24 @@ ble_error_t GenericGap::stopAdvertising(advertising_handle_t handle)
23992396
);
24002397

24012398
if (status) {
2402-
_active_sets.set(handle);
24032399
return status;
24042400
}
24052401
} else {
24062402
if (handle != LEGACY_ADVERTISING_HANDLE) {
24072403
return BLE_ERROR_INVALID_PARAM;
24082404
}
24092405

2410-
_active_sets.clear(handle);
2411-
24122406
status = _pal_gap.advertising_enable(false);
24132407

24142408
if (status) {
2415-
_active_sets.set(handle);
24162409
return status;
24172410
}
24182411

24192412
_advertising_timeout.detach();
24202413
}
24212414

2415+
_active_sets.clear(handle);
2416+
24222417
return status;
24232418
}
24242419

@@ -2746,10 +2741,6 @@ void GenericGap::on_advertising_set_terminated(
27462741
uint8_t number_of_completed_extended_advertising_events
27472742
)
27482743
{
2749-
if (!_active_sets.get(advertising_handle)) {
2750-
return;
2751-
}
2752-
27532744
_active_sets.clear(advertising_handle);
27542745

27552746
if (!_eventHandler) {

0 commit comments

Comments
 (0)