Bluetooth: audio: tbs_client: Remove GATT subscriptions upon disconnection

As long as we do not have NVS support in TBS, the subscriptions shall be
removed once ACL is disconnected to avoid potential crash on
reconnection, as the subscription parameters might be not valid anymore.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This commit is contained in:
Mariusz Skamra 2023-06-06 13:33:06 +02:00 committed by Anas Nashif
commit a84ecc2f96

View file

@ -1509,6 +1509,7 @@ static uint8_t discover_func(struct bt_conn *conn,
sub_params->ccc_handle = 0;
sub_params->end_handle = current_inst->end_handle;
sub_params->notify = notify_handler;
atomic_set_bit(sub_params->flags, BT_GATT_SUBSCRIBE_FLAG_VOLATILE);
err = bt_gatt_subscribe(conn, sub_params);
if (err != 0) {
LOG_DBG("Could not subscribe to "