public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v1 1/2] client/player: Add 'auto' option to transport.acquire
@ 2025-10-14 19:48 Luiz Augusto von Dentz
  2025-10-14 19:48 ` [PATCH BlueZ v1 2/2] client/player: Add 'auto' option to transport.select Luiz Augusto von Dentz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2025-10-14 19:48 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This enables transport.acquire auto which enables to overwrite the
default behavior of prompting when endpoint is registering without
setting auto accept.
---
 client/player.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/client/player.c b/client/player.c
index a8d05cf175c9..4f8293ce7842 100644
--- a/client/player.c
+++ b/client/player.c
@@ -134,6 +134,7 @@ static GList *local_endpoints = NULL;
 static GList *transports = NULL;
 static struct queue *ios = NULL;
 static uint8_t bcast_code[] = BCAST_CODE;
+static bool auto_acquire = false;
 
 struct transport {
 	GDBusProxy *proxy;
@@ -5072,10 +5073,8 @@ static void transport_property_changed(GDBusProxy *proxy, const char *name,
 
 	dbus_message_iter_get_basic(iter, &str);
 
-	if (strcmp(str, "pending"))
-		return;
-
-	transport_acquire(proxy, true);
+	if (!strcmp(str, "pending") || !strcmp(str, "broadcasting"))
+		transport_acquire(proxy, !auto_acquire);
 }
 
 static void property_changed(GDBusProxy *proxy, const char *name,
@@ -5224,6 +5223,11 @@ static void cmd_acquire_transport(int argc, char *argv[])
 	GDBusProxy *proxy;
 	int i;
 
+	if (argc == 2 && !strcmp(argv[1], "auto")) {
+		auto_acquire = true;
+		return bt_shell_noninteractive_quit(EXIT_SUCCESS);
+	}
+
 	for (i = 1; i < argc; i++) {
 		proxy = g_dbus_proxy_lookup(transports, NULL, argv[i],
 					BLUEZ_MEDIA_TRANSPORT_INTERFACE);
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-14 22:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-14 19:48 [PATCH BlueZ v1 1/2] client/player: Add 'auto' option to transport.acquire Luiz Augusto von Dentz
2025-10-14 19:48 ` [PATCH BlueZ v1 2/2] client/player: Add 'auto' option to transport.select Luiz Augusto von Dentz
2025-10-14 21:15 ` [BlueZ,v1,1/2] client/player: Add 'auto' option to transport.acquire bluez.test.bot
2025-10-14 22:30 ` [PATCH BlueZ v1 1/2] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox