Bluetooth: services: Fix ID check for bt_gatt_ots_obj_manager_obj_get

The ID validation check would always fail with IDs less than
OTS_OBJ_ID_START_RANGE, where the intention was that it should
allow the OTS_OBJ_ID_DIR_LIST (0) value as well if
CONFIG_BT_OTS_DIR_LIST_OBJ was enabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2021-03-30 10:43:28 +02:00 committed by Anas Nashif
parent f4b6231a9d
commit 929aec19ed
1 changed files with 1 additions and 1 deletions

View File

@ -161,7 +161,7 @@ int bt_gatt_ots_obj_manager_obj_get(
return -ENOENT;
}
if (id < OTS_OBJ_ID_START_RANGE ||
if (id < OTS_OBJ_ID_START_RANGE &&
(IS_ENABLED(CONFIG_BT_OTS_DIR_LIST_OBJ) &&
id != OTS_OBJ_ID_DIR_LIST)) {
return -EINVAL;