From a84ecc2f9692fcf728bde4bb39e32b645e03d9be Mon Sep 17 00:00:00 2001 From: Mariusz Skamra Date: Tue, 6 Jun 2023 13:33:06 +0200 Subject: [PATCH] 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 --- subsys/bluetooth/audio/tbs_client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/bluetooth/audio/tbs_client.c b/subsys/bluetooth/audio/tbs_client.c index 1f8e9c6362a..fef89d7c511 100644 --- a/subsys/bluetooth/audio/tbs_client.c +++ b/subsys/bluetooth/audio/tbs_client.c @@ -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 "