2024-02-01 15:42:46

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH BlueZ v1 4/5] shared/bap: Allow using bt_bap_attach for broadcast

From: Luiz Augusto von Dentz <[email protected]>

This enables use of bt_bap_attach for broadcast by checking if there is
a client or ATT instance.
---
src/shared/bap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 851d6a5facc3..ce8d35f86af3 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -4156,7 +4156,8 @@ bool bt_bap_attach(struct bt_bap *bap, struct bt_gatt_client *client)
queue_foreach(bap_cbs, bap_attached, bap);

if (!client) {
- bap_attach_att(bap, bap->att);
+ if (bap->att)
+ bap_attach_att(bap, bap->att);
return true;
}

--
2.43.0