All of lore.kernel.org
 help / color / mirror / Atom feed
From: Silviu Florian Barbulescu <silviu.barbulescu@nxp.com>
To: linux-bluetooth@vger.kernel.org
Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com,
	vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com,
	luiz.dentz@gmail.com, iulia.tanasescu@nxp.com
Subject: [PATCH BlueZ v2 1/3] player: Add reconfiguration prompt for broadcast source
Date: Wed, 13 Mar 2024 19:02:58 +0200	[thread overview]
Message-ID: <20240313170300.40974-2-silviu.barbulescu@nxp.com> (raw)
In-Reply-To: <20240313170300.40974-1-silviu.barbulescu@nxp.com>

endpoint.config /org/bluez/hci0/pac_bcast0 /local/endpoint/ep0 48_4_1
[/local/endpoint/ep0] BIS Index for reconfiguration? (value(1-31)/no): n
[/local/endpoint/ep0] BIG (auto/value): 0
[/local/endpoint/ep0] Enter channel location (value/no): 1
[/local/endpoint/ep0] Enter Metadata (value/no): n
---
 client/player.c | 33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/client/player.c b/client/player.c
index a40bf66e3..688ad02ab 100644
--- a/client/player.c
+++ b/client/player.c
@@ -3809,6 +3809,35 @@ static void config_endpoint_iso_group(const char *input, void *user_data)
 	}
 }
 
+static void endpoint_is_reconfigure_cfg(const char *input, void *user_data)
+{
+	struct endpoint_config *cfg = user_data;
+	int value;
+	char *endptr = NULL;
+
+	if (!strcasecmp(input, "n") || !strcasecmp(input, "no")) {
+		cfg->ep->iso_stream = BT_ISO_QOS_STREAM_UNSET;
+		goto done;
+	} else {
+		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);
+		}
+
+		if (value == 0x0)
+			cfg->ep->iso_stream = BT_ISO_QOS_STREAM_UNSET;
+		else
+			cfg->ep->iso_stream = value;
+	}
+
+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 +3864,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);
+		"BIS Index for reconfiguration? (value(1-31)/no):",
+		endpoint_is_reconfigure_cfg, cfg);
 }
 
 static void cmd_config_endpoint(int argc, char *argv[])
-- 
2.39.2


  reply	other threads:[~2024-03-13 17:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13 17:02 [PATCH BlueZ v2 0/3] Broadcast source reconfiguration support Silviu Florian Barbulescu
2024-03-13 17:02 ` Silviu Florian Barbulescu [this message]
2024-03-13 19:31   ` 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240313170300.40974-2-silviu.barbulescu@nxp.com \
    --to=silviu.barbulescu@nxp.com \
    --cc=andrei.istodorescu@nxp.com \
    --cc=iulia.tanasescu@nxp.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=mihai-octavian.urzica@nxp.com \
    --cc=vlad.pruteanu@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.