From 284da66deb59e54ac00f0a5f769becc40af6f9e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Danis?= Date: Thu, 7 Jul 2022 11:23:17 +0200 Subject: [PATCH] bluez5: Add BAP_SINK/SOURCE from PACS UUID to adapter profiles BAP sink/source are characteristics of the PACS profile, but we're more interested by those characteristics then the more generic profile. --- spa/plugins/bluez5/bluez5-dbus.c | 6 ++++++ spa/plugins/bluez5/defs.h | 1 + 2 files changed, 7 insertions(+) diff --git a/spa/plugins/bluez5/bluez5-dbus.c b/spa/plugins/bluez5/bluez5-dbus.c index 0221df4b6..68d403607 100644 --- a/spa/plugins/bluez5/bluez5-dbus.c +++ b/spa/plugins/bluez5/bluez5-dbus.c @@ -848,6 +848,12 @@ static int adapter_update_props(struct spa_bt_adapter *adapter, if (profile && (adapter->profiles & profile) == 0) { spa_log_debug(monitor->log, "adapter %p: add UUID=%s", adapter, uuid); adapter->profiles |= profile; + } else if (strcasecmp(uuid, SPA_BT_UUID_PACS) == 0 && + (adapter->profiles & SPA_BT_PROFILE_BAP_SINK) == 0) { + spa_log_debug(monitor->log, "adapter %p: add UUID=%s", adapter, SPA_BT_UUID_BAP_SINK); + adapter->profiles |= SPA_BT_PROFILE_BAP_SINK; + spa_log_debug(monitor->log, "adapter %p: add UUID=%s", adapter, SPA_BT_UUID_BAP_SOURCE); + adapter->profiles |= SPA_BT_PROFILE_BAP_SOURCE; } dbus_message_iter_next(&iter); } diff --git a/spa/plugins/bluez5/defs.h b/spa/plugins/bluez5/defs.h index 1a910bee6..4c4437dbc 100644 --- a/spa/plugins/bluez5/defs.h +++ b/spa/plugins/bluez5/defs.h @@ -141,6 +141,7 @@ extern "C" { #define SPA_BT_UUID_HSP_AG "00001112-0000-1000-8000-00805f9b34fb" #define SPA_BT_UUID_HFP_HF "0000111e-0000-1000-8000-00805f9b34fb" #define SPA_BT_UUID_HFP_AG "0000111f-0000-1000-8000-00805f9b34fb" +#define SPA_BT_UUID_PACS "00001850-0000-1000-8000-00805f9b34fb" #define SPA_BT_UUID_BAP_SINK "00002bc9-0000-1000-8000-00805f9b34fb" #define SPA_BT_UUID_BAP_SOURCE "00002bcb-0000-1000-8000-00805f9b34fb"