From 35858e173aadb5e8e746e8f90503c225325e1b73 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 25 Jan 2024 09:16:36 -0500 Subject: [PATCH] bap: Mark device as connectable if a broadcast Endpoint is found If a broadcast Endpoint is found this uses btd_device_set_connectable to make it as connectable since the Endpoint can be used to setup a broadcast stream which requires the device object. --- profiles/audio/bap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index a4036bbbd..864761dfd 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -1378,6 +1378,7 @@ static bool pac_select(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac, static bool pac_found_bcast(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac, void *user_data) { + struct bap_data *data = user_data; struct bap_ep *ep; DBG("lpac %p rpac %p", lpac, rpac); @@ -1388,6 +1389,9 @@ static bool pac_found_bcast(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac, return true; } + /* Mark the device as connetable if an Endpoint is registered */ + btd_device_set_connectable(data->device, true); + return true; } @@ -2456,6 +2460,8 @@ static void bap_bcast_remove(struct btd_service *service) error("BAP service not handled by profile"); return; } + + bap_data_remove(data); } static int bap_probe(struct btd_service *service) -- 2.47.3