linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ v2 0/3] Broadcast source reconfiguration support
@ 2024-03-13 17:02 Silviu Florian Barbulescu
  2024-03-13 17:02 ` [PATCH BlueZ v2 1/3] player: Add reconfiguration prompt for broadcast source Silviu Florian Barbulescu
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Silviu Florian Barbulescu @ 2024-03-13 17:02 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: mihai-octavian.urzica, silviu.barbulescu, vlad.pruteanu,
	andrei.istodorescu, luiz.dentz, iulia.tanasescu

This patch adds support for broadcast source to reconfigure a BIS.
endpoint.config command has a new prompt for broadcast source:
" This is a BIS Reconfiguration? (yes/no)"
Yes or y if a BIS reconfiguration is required
No or n if it is a new BIS configuration
"The BIS index is assigned in the order of the configuration
starting with 1"
"BIS Index (value):" a value representing the BIS index if this is a
BIS reconfiguration.
endpoint.register 00001852-0000-1000-8000-00805f9b34fb 0x06
endpoint.config /org/bluez/hci0/pac_bcast0 /local/endpoint/ep0 48_4_1
BIS Index for reconfiguration? (value(1-31)/no): 0
[/local/endpoint/ep0] BIG (auto/value): 0
[/local/endpoint/ep0] Enter channel location (value/no): 1
[/local/endpoint/ep0] Enter Metadata (value/no): n
endpoint.config /org/bluez/hci0/pac_bcast0 /local/endpoint/ep0 48_4_1
[/local/endpoint/ep0] BIS Index for reconfiguration? (value(1-31)/no): 1
[/local/endpoint/ep0] BIG (auto/value): 0
[/local/endpoint/ep0] Enter channel location (value/no): 2
[/local/endpoint/ep0] Enter Metadata (value/no): n
transport.show /org/bluez/hci0/pac_bcast0/fd0 to view the update
Transport /org/bluez/hci0/pac_bcast0/fd0

Configuration.Location: 0x00000002
Configuration.Location: Front Right (0x00000002)


Silviu Florian Barbulescu (3):
  player: Add reconfiguration prompt for broadcast source
  transport: Add support to update the transport configuration
  bap: Broadcast source reconfiguration support added

 client/player.c            | 33 ++++++++++++++++-
 profiles/audio/bap.c       | 76 ++++++++++++++++++++++++++++++++++++++
 profiles/audio/transport.c | 27 +++++++++++++-
 profiles/audio/transport.h |  1 +
 src/shared/bap.c           | 11 +++++-
 5 files changed, 144 insertions(+), 4 deletions(-)


base-commit: c9dddb642663b8bafe8998fef6132a2bb36d609d
-- 
2.39.2


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH BlueZ 1/3] player: Add reconfiguration prompt for broadcast source
@ 2024-03-08 16:52 Silviu Florian Barbulescu
  2024-03-08 19:33 ` Broadcast source reconfiguration support bluez.test.bot
  0 siblings, 1 reply; 8+ messages in thread
From: Silviu Florian Barbulescu @ 2024-03-08 16:52 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: mihai-octavian.urzica, silviu.barbulescu, vlad.pruteanu,
	andrei.istodorescu, luiz.dentz, iulia.tanasescu

endpoint.config /org/bluez/hci0/pac_bcast0 /local/endpoint/ep0 48_4_1
[/local/endpoint/ep0] This is a BIS Reconfiguration? (yes/no): y
The BIS index is assigned in the order of the configuration
starting with 1
[/local/endpoint/ep0] BIS Index (value): 1
[/local/endpoint/ep0] BIG (auto/value): 0
[/local/endpoint/ep0] Enter channel location (value/no): 2
[/local/endpoint/ep0] Enter Metadata (value/no): n

---
 client/player.c | 46 ++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 44 insertions(+), 2 deletions(-)

diff --git a/client/player.c b/client/player.c
index a40bf66e3..35143115a 100644
--- a/client/player.c
+++ b/client/player.c
@@ -3809,6 +3809,48 @@ static void config_endpoint_iso_group(const char *input, void *user_data)
 	}
 }
 
+static void endpoint_set_reconfigure_cfg(const char *input, void *user_data)
+{
+	char *endptr = NULL;
+	int value;
+	struct endpoint_config *cfg = user_data;
+
+	value = strtol(input, &endptr, 0);
+
+	if (!endptr || *endptr != '\0' || value > UINT8_MAX) {
+		bt_shell_printf("Invalid argument: %s\n", input);
+		return bt_shell_noninteractive_quit(EXIT_FAILURE);
+	}
+
+	cfg->ep->iso_stream = value;
+
+	bt_shell_prompt_input(cfg->ep->path,
+		"BIG (auto/value):",
+		config_endpoint_iso_group, cfg);
+}
+
+static void endpoint_is_reconfigure_cfg(const char *input, void *user_data)
+{
+	struct endpoint_config *cfg = user_data;
+
+	if (!strcasecmp(input, "n") || !strcasecmp(input, "no")) {
+		cfg->ep->iso_stream = BT_ISO_QOS_STREAM_UNSET;
+		goto done;
+	} else {
+		bt_shell_printf("The BIS index is assigned  in the order of "
+				"the configuration starting with 1\n");
+		bt_shell_prompt_input(cfg->ep->path,
+		"BIS Index (value):",
+		endpoint_set_reconfigure_cfg, cfg);
+		return;
+	}
+
+done:
+	bt_shell_prompt_input(cfg->ep->path,
+		"BIG (auto/value):",
+		config_endpoint_iso_group, cfg);
+}
+
 static void endpoint_set_config_bcast(struct endpoint_config *cfg)
 {
 	cfg->ep->bcode = g_new0(struct iovec, 1);
@@ -3835,8 +3877,8 @@ static void endpoint_set_config_bcast(struct endpoint_config *cfg)
 	}
 
 	bt_shell_prompt_input(cfg->ep->path,
-		"BIG (auto/value):",
-		config_endpoint_iso_group, cfg);
+		"This is a BIS reconfiguration? (yes/no):",
+		endpoint_is_reconfigure_cfg, cfg);
 }
 
 static void cmd_config_endpoint(int argc, char *argv[])
-- 
2.39.2


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

end of thread, other threads:[~2024-03-13 20:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-13 17:02 [PATCH BlueZ v2 0/3] Broadcast source reconfiguration support Silviu Florian Barbulescu
2024-03-13 17:02 ` [PATCH BlueZ v2 1/3] player: Add reconfiguration prompt for broadcast source Silviu Florian Barbulescu
2024-03-13 19:31   ` Broadcast source reconfiguration support bluez.test.bot
2024-03-13 17:02 ` [PATCH BlueZ v2 2/3] transport: Add support to update the transport config Silviu Florian Barbulescu
2024-03-13 17:03 ` [PATCH BlueZ v2 3/3] bap: Broadcast source reconfiguration support added Silviu Florian Barbulescu
2024-03-13 20:04 ` [PATCH BlueZ v2 0/3] Broadcast source reconfiguration support Luiz Augusto von Dentz
2024-03-13 20:49   ` Luiz Augusto von Dentz
  -- strict thread matches above, loose matches on Subject: below --
2024-03-08 16:52 [PATCH BlueZ 1/3] player: Add reconfiguration prompt for broadcast source Silviu Florian Barbulescu
2024-03-08 19:33 ` Broadcast source reconfiguration support bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).