BLE: Fix release of advertising sets.

pull/8738/head
Vincent Coubard 2018-11-10 17:24:14 +00:00
parent 413908d594
commit 0d90671842
1 changed files with 5 additions and 1 deletions

View File

@ -1617,11 +1617,15 @@ ble_error_t GenericGap::createAdvertisingSet(
} }
ble_error_t GenericGap::destroyAdvertisingSet(AdvHandle_t handle) { ble_error_t GenericGap::destroyAdvertisingSet(AdvHandle_t handle) {
if (is_extended_advertising_available()) {
return BLE_ERROR_OPERATION_NOT_PERMITTED;
}
if (handle >= getMaxAdvertisingSetNumber()) { if (handle >= getMaxAdvertisingSetNumber()) {
return BLE_ERROR_INVALID_PARAM; return BLE_ERROR_INVALID_PARAM;
} }
if (_existing_sets.get(handle)) { if (_existing_sets.get(handle) == false) {
return BLE_ERROR_INVALID_PARAM; return BLE_ERROR_INVALID_PARAM;
} }