diff mbox series

[BlueZ,v2,1/1] Add command to create local endpoint in bluetoothctl

Message ID 20240301163946.5484-2-silviu.barbulescu@nxp.com (mailing list archive)
State New, archived
Headers show
Series Add command to create local endpoint in bluetoothctl | 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

Silviu Florian Barbulescu March 1, 2024, 4:39 p.m. UTC
Example:
endpoint.new_local_ep 00001852-0000-1000-8000-00805f9b34fb 0x06
Endpoint /local/endpoint/bcaa/lc3 registered

---
 client/player.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

Comments

bluez.test.bot@gmail.com March 1, 2024, 6:13 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=831596

---Test result---

Test Summary:
CheckPatch                    PASS      0.49 seconds
GitLint                       PASS      0.32 seconds
BuildEll                      PASS      25.16 seconds
BluezMake                     PASS      756.43 seconds
MakeCheck                     PASS      11.47 seconds
MakeDistcheck                 PASS      164.18 seconds
CheckValgrind                 PASS      231.40 seconds
CheckSmatch                   PASS      341.44 seconds
bluezmakeextell               PASS      107.68 seconds
IncrementalBuild              PASS      692.60 seconds
ScanBuild                     PASS      1002.86 seconds



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/client/player.c b/client/player.c
index a40bf66e3..e297bb615 100644
--- a/client/player.c
+++ b/client/player.c
@@ -4263,6 +4263,8 @@  done:
 	return bt_shell_noninteractive_quit(EXIT_SUCCESS);
 }
 
+static void cmd_new_local_endpoint(int argc, char *argv[]);
+
 static const struct bt_shell_menu endpoint_menu = {
 	.name = "endpoint",
 	.desc = "Media Endpoint Submenu",
@@ -4287,6 +4289,10 @@  static const struct bt_shell_menu endpoint_menu = {
 						cmd_presets_endpoint,
 						"List available presets",
 						uuid_generator },
+	{ "new_local_ep",  "<UUID> <codec[:company]>",
+						cmd_new_local_endpoint,
+						"Create local endpoint",
+						uuid_generator },
 	{} },
 };
 
@@ -4372,6 +4378,27 @@  static void register_endpoints(GDBusProxy *proxy)
 	}
 }
 
+static void cmd_new_local_endpoint(int argc, char *argv[])
+{
+	struct endpoint *ep = NULL;
+	size_t i;
+	char *uuid = g_strdup(argv[1]);
+
+	for (i = 0; i < ARRAY_SIZE(caps); i++) {
+		const struct capabilities *cap = &caps[i];
+
+		if (strcasecmp(cap->uuid, uuid))
+			continue;
+
+		ep = endpoint_new(cap);
+		endpoint_init_defaults(ep);
+		break;
+	}
+
+	if (ep)
+		bt_shell_printf("Endpoint %s registered\n", ep->path);
+}
+
 static void media_added(GDBusProxy *proxy)
 {
 	medias = g_list_append(medias, proxy);