disallow removing the legacy handle

pull/8738/head
paul-szczepanek-arm 2018-11-13 11:18:33 +00:00 committed by Vincent Coubard
parent d01b4a53ee
commit cfde4ed019
1 changed files with 4 additions and 0 deletions

View File

@ -1688,6 +1688,10 @@ ble_error_t GenericGap::destroyAdvertisingSet(AdvHandle_t handle) {
return BLE_ERROR_OPERATION_NOT_PERMITTED;
}
if (handle == LEGACY_ADVERTISING_HANDLE) {
return BLE_ERROR_INVALID_PARAM;
}
if (handle >= getMaxAdvertisingSetNumber()) {
return BLE_ERROR_INVALID_PARAM;
}