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:
Emil Gydesen 2024-01-15 17:49:10 +01:00 committed by Maureen Helm
commit 922ac3c7c1
8 changed files with 65 additions and 20 deletions

View file

@ -1545,6 +1545,9 @@ static uint8_t discover_func(struct bt_conn *conn,
"characterstic at handle 0x%04X"
"(%d)",
sub_params->value_handle, err);
tbs_client_discover_complete(conn, err);
return BT_GATT_ITER_STOP;
} else {
LOG_DBG("Subscribed to characterstic at "
"handle 0x%04X",