Bluetooth: Audio: Add missing error checks for calls to bt_gatt_subscribe
Several places the LE Audio clients called bt_gatt_subscribe without checking the return value, which could cause some issues in the worst case, and in the best case, cause some unexpected behavior. Some implementations had a bit more updating to handle the new behavior. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
ad89bf377d
commit
922ac3c7c1
8 changed files with 65 additions and 20 deletions
|
@ -1297,7 +1297,13 @@ static uint8_t discover_otc_char_func(struct bt_conn *conn,
|
|||
sub_params->value_handle = chrc->value_handle;
|
||||
sub_params->notify = bt_ots_client_indicate_handler;
|
||||
|
||||
bt_gatt_subscribe(conn, sub_params);
|
||||
err = bt_gatt_subscribe(conn, sub_params);
|
||||
if (err != 0) {
|
||||
LOG_DBG("Failed to subscribe (err %d)", err);
|
||||
discovery_complete(conn, err);
|
||||
|
||||
return BT_GATT_ITER_STOP;
|
||||
}
|
||||
}
|
||||
|
||||
return BT_GATT_ITER_CONTINUE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue