From aed4948cd3c072fb2f8dada49c41f59882ad3a06 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 29 May 2025 15:31:37 -0400 Subject: [PATCH] MediaAssistant: Refactor object path This includes the SID as part of the object path, also rework the order of order of the terms to first show the device object path and later the broadcast source address so device_get_path can be used instead of doing another conversion. --- doc/org.bluez.MediaAssistant.rst | 2 +- profiles/audio/bass.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/org.bluez.MediaAssistant.rst b/doc/org.bluez.MediaAssistant.rst index 4aac89536..4940251fa 100644 --- a/doc/org.bluez.MediaAssistant.rst +++ b/doc/org.bluez.MediaAssistant.rst @@ -16,7 +16,7 @@ Interface :Service: org.bluez :Interface: org.bluez.MediaAssistant1 -:Object path: /org/bluez/{hci0,hci1,...}/src_XX_XX_XX_XX_XX_XX/dev_YY_YY_YY_YY_YY_YY/bisZ +:Object path: /org/bluez/{hci0,hci1,...}/dev_{BDADDR}/src_{BDADDR}/sid#/bis# Methods ------- diff --git a/profiles/audio/bass.c b/profiles/audio/bass.c index 2d4a86619..b27a3fc12 100644 --- a/profiles/audio/bass.c +++ b/profiles/audio/bass.c @@ -1076,7 +1076,6 @@ static struct bass_assistant *assistant_new(struct btd_adapter *adapter, { struct bass_assistant *assistant; char src_addr[18]; - char dev_addr[18]; assistant = new0(struct bass_assistant, 1); if (!assistant) @@ -1101,10 +1100,10 @@ static struct bass_assistant *assistant_new(struct btd_adapter *adapter, assistant); ba2str(device_get_address(device), src_addr); - ba2str(device_get_address(data->device), dev_addr); - assistant->path = g_strdup_printf("%s/src_%s/dev_%s/sid%d/bis%d", - adapter_get_path(adapter), src_addr, dev_addr, sid, bis); + assistant->path = g_strdup_printf("%s/src_%s/sid%d/bis%d", + device_get_path(data->device), src_addr, + sid, bis); g_strdelimit(assistant->path, ":", '_'); -- 2.47.3