[PATCH BlueZ 07/10] shared/bass: Add API to get GATT client reference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some use cases require the BASS plugin to differentiate between client and
server BASS sessions - for example, the BAP Broadcast Assistant role only
considers client BASS sessions.

This adds a BASS API to obtain a reference to the bt_gatt_client structure
attached to the bt_bass session.
---
 src/shared/bass.c | 8 ++++++++
 src/shared/bass.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/src/shared/bass.c b/src/shared/bass.c
index d82c043ac..268e3bd86 100644
--- a/src/shared/bass.c
+++ b/src/shared/bass.c
@@ -1683,6 +1683,14 @@ struct bt_att *bt_bass_get_att(struct bt_bass *bass)
 	return bt_gatt_client_get_att(bass->client);
 }
 
+struct bt_gatt_client *bt_bass_get_client(struct bt_bass *bass)
+{
+	if (!bass)
+		return NULL;
+
+	return bass->client;
+}
+
 bool bt_bass_set_debug(struct bt_bass *bass, bt_bass_debug_func_t func,
 			void *user_data, bt_bass_destroy_func_t destroy)
 {
diff --git a/src/shared/bass.h b/src/shared/bass.h
index c4b5b76ba..1674146bc 100644
--- a/src/shared/bass.h
+++ b/src/shared/bass.h
@@ -121,6 +121,7 @@ typedef void (*bt_bass_destroy_func_t)(void *user_data);
 typedef void (*bt_bass_debug_func_t)(const char *str, void *user_data);
 
 struct bt_att *bt_bass_get_att(struct bt_bass *bass);
+struct bt_gatt_client *bt_bass_get_client(struct bt_bass *bass);
 unsigned int bt_bass_register(bt_bass_func_t attached, bt_bass_func_t detached,
 							void *user_data);
 bool bt_bass_unregister(unsigned int id);
-- 
2.39.2





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux