* [PATCH BlueZ v1] player: Fix endpoint.config for broadcast
@ 2024-01-18 17:00 Luiz Augusto von Dentz
2024-01-18 18:07 ` [BlueZ,v1] " bluez.test.bot
0 siblings, 1 reply; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2024-01-18 17:00 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
endpoint.config where taking different arguments for broadcast which is
not recommended with shell as it doesn't support such a thing.
So instead of taking different arguments for broadcast both remote and
local endpoints shall be passed but in case of broadcast sync both the
remote and the local endpoint actually refer to the same endpoint
registered by bluetoothctl:
endpoint.config /org/bluez/hci0/pac_bcast0 /local/endpoint/ep2 16_2_1
---
client/player.c | 36 ++++++------------------------------
1 file changed, 6 insertions(+), 30 deletions(-)
diff --git a/client/player.c b/client/player.c
index cd06ffd41c82..eff35ff87a00 100644
--- a/client/player.c
+++ b/client/player.c
@@ -3972,10 +3972,6 @@ static void cmd_config_endpoint(int argc, char *argv[])
{
struct endpoint_config *cfg;
const struct codec_preset *preset;
- const struct capabilities *cap;
- char *uuid;
- uint8_t codec_id;
- bool broadcast = false;
cfg = new0(struct endpoint_config, 1);
@@ -3990,33 +3986,14 @@ static void cmd_config_endpoint(int argc, char *argv[])
/* Search for the local endpoint */
cfg->ep = endpoint_find(argv[2]);
if (!cfg->ep) {
-
- /* When the local endpoint was not found either we received
- * UUID, or the provided local endpoint is not available
- */
- uuid = argv[2];
- codec_id = strtol(argv[3], NULL, 0);
- cap = find_capabilities(uuid, codec_id);
- if (cap) {
- broadcast = true;
- cfg->ep = endpoint_new(cap);
- cfg->ep->preset = find_presets_name(uuid, argv[3]);
- if (!cfg->ep->preset)
- bt_shell_printf("Preset not found\n");
- } else {
- bt_shell_printf("Local Endpoint %s,"
- "or capabilities not found\n", uuid);
- goto fail;
- }
+ bt_shell_printf("Local Endpoint %s not found\n", argv[2]);
+ goto fail;
}
- if (((broadcast == false) && (argc > 3)) ||
- ((broadcast == true) && (argc > 4))) {
- char *preset_name = (broadcast == false)?argv[3]:argv[4];
-
- preset = preset_find_name(cfg->ep->preset, preset_name);
+ if (argc > 3) {
+ preset = preset_find_name(cfg->ep->preset, argv[3]);
if (!preset) {
- bt_shell_printf("Preset %s not found\n", preset_name);
+ bt_shell_printf("Preset %s not found\n", argv[3]);
goto fail;
}
@@ -4435,8 +4412,7 @@ static const struct bt_shell_menu endpoint_menu = {
{ "unregister", "<UUID/object>", cmd_unregister_endpoint,
"Register Endpoint",
local_endpoint_generator },
- { "config",
- "<endpoint> [local endpoint/UUID] [preset/codec id] [preset]",
+ { "config", "<endpoint> [local endpoint] [preset]",
cmd_config_endpoint,
"Configure Endpoint",
endpoint_generator },
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-18 18:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-18 17:00 [PATCH BlueZ v1] player: Fix endpoint.config for broadcast Luiz Augusto von Dentz
2024-01-18 18:07 ` [BlueZ,v1] " bluez.test.bot
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.