diff mbox series

[BlueZ,v2,4/8] shared/bap: Allow using bt_bap_attach for broadcast

Message ID 20240201191016.1122194-4-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Commit b983c31d4a76bb8b90f42099c21ffacf833ab271
Headers show
Series [BlueZ,v2,1/8] client/mgmt: Add missing settings strings | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/IncrementalBuild success Incremental Build PASS

Commit Message

Luiz Augusto von Dentz Feb. 1, 2024, 7:10 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

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 mbox series

Patch

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;
 	}