diff mbox series

[BlueZ,v2,1/2] player: Fix endpoint.config for broadcast

Message ID 20240118213314.2066415-1-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Commit 4908e58bd1a953d2a48c543d15b246b9f69fddf6
Headers show
Series [BlueZ,v2,1/2] player: Fix endpoint.config for broadcast | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/IncrementalBuild success Incremental Build PASS
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Luiz Augusto von Dentz Jan. 18, 2024, 9:33 p.m. UTC
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(-)

Comments

bluez.test.bot@gmail.com Jan. 18, 2024, 11:17 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=817943

---Test result---

Test Summary:
CheckPatch                    PASS      0.97 seconds
GitLint                       PASS      0.61 seconds
BuildEll                      PASS      23.76 seconds
BluezMake                     PASS      714.53 seconds
MakeCheck                     PASS      11.76 seconds
MakeDistcheck                 PASS      160.17 seconds
CheckValgrind                 PASS      222.21 seconds
CheckSmatch                   PASS      337.08 seconds
bluezmakeextell               PASS      106.76 seconds
IncrementalBuild              PASS      1343.92 seconds
ScanBuild                     PASS      927.03 seconds



---
Regards,
Linux Bluetooth
patchwork-bot+bluetooth@kernel.org Jan. 19, 2024, 8:40 p.m. UTC | #2
Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Thu, 18 Jan 2024 16:33:13 -0500 you wrote:
> 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:
> 
> [...]

Here is the summary with links:
  - [BlueZ,v2,1/2] player: Fix endpoint.config for broadcast
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=4908e58bd1a9
  - [BlueZ,v2,2/2] bap: Fix crash when attempting to setup a broadcast source
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=2ef2f122e608

You are awesome, thank you!
diff mbox series

Patch

diff --git a/client/player.c b/client/player.c
index 39d1be665c8f..1bc64af3c2ae 100644
--- a/client/player.c
+++ b/client/player.c
@@ -3642,10 +3642,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);
 
@@ -3660,33 +3656,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;
 		}
 
@@ -4105,8 +4082,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 },