diff mbox series

[BlueZ,1/3] transport: Add "select" method

Message ID 20240710081338.17262-2-vlad.pruteanu@nxp.com (mailing list archive)
State Accepted
Commit 083d1a7b66b5c495d2545670d5d255aef340dbf9
Headers show
Series Add transport.select method | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch fail ERROR:SPACING: need consistent spacing around '*' (ctx:WxV) #127: FILE: profiles/audio/transport.c:966: +static DBusMessage *select_transport(DBusConnection *conn, DBusMessage *msg, ^ ERROR:SPACING: need consistent spacing around '*' (ctx:WxV) #127: FILE: profiles/audio/transport.c:966: +static DBusMessage *select_transport(DBusConnection *conn, DBusMessage *msg, ^ ERROR:SPACING: need consistent spacing around '*' (ctx:WxV) #127: FILE: profiles/audio/transport.c:966: +static DBusMessage *select_transport(DBusConnection *conn, DBusMessage *msg, ^ /github/workspace/src/src/13728985.patch total: 3 errors, 0 warnings, 42 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. /github/workspace/src/src/13728985.patch has style problems, please review. NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.
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

Vlad Pruteanu July 10, 2024, 8:13 a.m. UTC
This adds the "select" method for Broadcast transports. It's role
is to change the transport's state from idle to pending. This
allows the user to select the desired stream when running the setup
with PipeWire since it acquires any transport that is pending.
---
 profiles/audio/transport.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

Comments

bluez.test.bot@gmail.com July 10, 2024, 10:38 a.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=870003

---Test result---

Test Summary:
CheckPatch                    FAIL      1.26 seconds
GitLint                       PASS      0.64 seconds
BuildEll                      PASS      24.52 seconds
BluezMake                     PASS      1739.85 seconds
MakeCheck                     PASS      13.02 seconds
MakeDistcheck                 PASS      178.35 seconds
CheckValgrind                 PASS      257.44 seconds
CheckSmatch                   PASS      356.38 seconds
bluezmakeextell               PASS      120.24 seconds
IncrementalBuild              PASS      4541.04 seconds
ScanBuild                     PASS      998.06 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[BlueZ,1/3] transport: Add "select" method
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#127: FILE: profiles/audio/transport.c:966:
+static DBusMessage *select_transport(DBusConnection *conn, DBusMessage *msg,
                    ^

ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#127: FILE: profiles/audio/transport.c:966:
+static DBusMessage *select_transport(DBusConnection *conn, DBusMessage *msg,
                                                     ^

ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#127: FILE: profiles/audio/transport.c:966:
+static DBusMessage *select_transport(DBusConnection *conn, DBusMessage *msg,
                                                                        ^

/github/workspace/src/src/13728985.patch total: 3 errors, 0 warnings, 42 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/src/13728985.patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.




---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index 922911cf3..d6493edd0 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -963,6 +963,9 @@  static gboolean get_endpoint(const GDBusPropertyTable *property,
 	return TRUE;
 }
 
+static DBusMessage *select_transport(DBusConnection *conn, DBusMessage *msg,
+					void *data);
+
 static const GDBusMethodTable transport_methods[] = {
 	{ GDBUS_ASYNC_METHOD("Acquire",
 			NULL,
@@ -975,6 +978,8 @@  static const GDBusMethodTable transport_methods[] = {
 							{ "mtu_w", "q" }),
 			try_acquire) },
 	{ GDBUS_ASYNC_METHOD("Release", NULL, NULL, release) },
+	{ GDBUS_ASYNC_METHOD("Select",
+			NULL, NULL, select_transport) },
 	{ },
 };
 
@@ -1292,6 +1297,25 @@  static void transport_update_playing(struct media_transport *transport,
 		transport_set_state(transport, TRANSPORT_STATE_PENDING);
 }
 
+static DBusMessage *select_transport(DBusConnection *conn, DBusMessage *msg,
+					void *data)
+{
+	struct media_transport *transport = data;
+
+	if (transport->owner != NULL)
+		return btd_error_not_authorized(msg);
+
+	if (transport->state >= TRANSPORT_STATE_REQUESTING)
+		return btd_error_not_authorized(msg);
+
+	if (!strcmp(media_endpoint_get_uuid(transport->endpoint),
+						BAA_SERVICE_UUID)) {
+		transport_update_playing(transport, TRUE);
+	}
+
+	return NULL;
+}
+
 static void sink_state_changed(struct btd_service *service,
 						sink_state_t old_state,
 						sink_state_t new_state,