Skip to contentSkip to conversation

client/btpclient: Add BTP_OP_BAP_DISCOVER support

PATCH Applied Frédéric Danis 3 participants 3 messages Apr 16 – Apr 20

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 client/btpclient: Add BTP_OP_BAP_DISCOVER support

BAP/CL/CGGIT/SER/BV-01-C expects IUT to discover the services before continuation.

This reduces connection time for the BAP tests.

---
 Makefile.tools          |   1 +
 client/btpclient/bap.c  | 109 ++++++++++++++++++++++++++++++++++++++++
 client/btpclient/bap.h  |  13 +++++
 client/btpclient/core.c |  15 ++++++
 src/shared/btp.h        |  16 ++++++
 5 files changed, 154 insertions(+)
 create mode 100644 client/btpclient/bap.c
 create mode 100644 client/btpclient/bap.h
Makefile.tools +1 -0
index 8e0eae04e..001d0129f 100644
@@ -562,6 +562,7 @@ noinst_PROGRAMS += client/btpclient/btpclient client/btpclient/btpclientctl
 client_btpclient_btpclient_SOURCES = client/btpclient/btpclient.c \
 				client/btpclient/btpclient.h \
 				src/shared/btp.c src/shared/btp.h \
+				client/btpclient/bap.c client/btpclient/bap.h \
 				client/btpclient/core.c client/btpclient/core.h \
 				client/btpclient/gap.c client/btpclient/gap.h \
 				client/btpclient/gatt.c client/btpclient/gatt.h
client/btpclient/bap.c new file +109 -0

109 lines not on this page · raw message

client/btpclient/bap.h new file +13 -0
new file mode 100644
index 000000000..2b7a218b5
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
+/*
+ *
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2026  Collabora Ltd.
+ *
+ */
+
+bool bap_register_service(struct btp *btp_, struct l_dbus *dbus_,
+					struct l_dbus_client *client);
+void bap_unregister_service(struct btp *btp);
+bool bap_is_service_registered(void);
client/btpclient/core.c +15 -0
index cfff131f1..772178670 100644
@@ -13,6 +13,7 @@
 #include "bluetooth/uuid.h"
 #include "src/shared/btp.h"
 #include "btpclient.h"
+#include "bap.h"
 #include "core.h"
 #include "gap.h"
 #include "gatt.h"
@@ -89,6 +90,14 @@ static void btp_core_register(uint8_t index, const void *param,
 		if (!gatt_register_service(btp, dbus, client))
 			goto failed;
 
+		break;
+	case BTP_BAP_SERVICE:
+		if (bap_is_service_registered())
+			goto failed;
+
+		if (!bap_register_service(btp, dbus, client))
+			goto failed;
+
 		break;
 	case BTP_L2CAP_SERVICE:
 	case BTP_MESH_NODE_SERVICE:
@@ -132,6 +141,12 @@ static void btp_core_unregister(uint8_t index, const void *param,
 
 		gatt_unregister_service(btp);
 		break;
+	case BTP_BAP_SERVICE:
+		if (!bap_is_service_registered())
+			goto failed;
+
+		bap_unregister_service(btp);
+		break;
 	case BTP_L2CAP_SERVICE:
 	case BTP_MESH_NODE_SERVICE:
 	case BTP_CORE_SERVICE:
src/shared/btp.h +16 -0
index 8b5078f82..c23346f4e 100644
@@ -26,6 +26,7 @@
 #define BTP_GATT_SERVICE	2
 #define BTP_L2CAP_SERVICE	3
 #define BTP_MESH_NODE_SERVICE	4
+#define BTP_BAP_SERVICE		14
 
 struct btp_hdr {
 	uint8_t service;
@@ -344,6 +345,21 @@ struct btp_gatt_write_rp {
 	uint8_t att_response;
 } __packed;
 
+#define BTP_OP_BAP_READ_SUPPORTED_COMMANDS	0x01
+
+#define BTP_OP_BAP_DISCOVER			0x02
+struct btp_bap_discover_cp {
+	uint8_t address_type;
+	bdaddr_t address;
+} __packed;
+
+#define BTP_EV_BAP_DISCOVERY_COMPLETED		0x80
+struct btp_bap_discovery_completed_ev {
+	uint8_t address_type;
+	bdaddr_t address;
+	uint8_t status;
+} __packed;
+
 struct btp;
 
 typedef void (*btp_destroy_func_t)(void *user_data);
Signature · 1 line
2.43.0
#1 lore raw

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=1082169

---Test result---

Test Summary:

CheckPatch                    PASS      0.45 seconds
GitLint                       PASS      0.27 seconds
BuildEll                      PASS      19.95 seconds
BluezMake                     PASS      590.39 seconds
MakeCheck                     PASS      18.31 seconds
MakeDistcheck                 PASS      231.93 seconds
CheckValgrind                 PASS      269.97 seconds
CheckSmatch                   PASS      316.65 seconds
bluezmakeextell               PASS      163.07 seconds
IncrementalBuild              PASS      599.28 seconds
ScanBuild                     PASS      902.88 seconds

https://github.com/bluez/bluez/pull/2049

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to Frédéric Danis
This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 4 lines · On Thu, 16 Apr 2026 20:49:14 +0200 you wrote:

BAP/CL/CGGIT/SER/BV-01-C expects IUT to discover the services before continuation.

This reduces connection time for the BAP tests.

Quoted 9 lines
---
 Makefile.tools          |   1 +
 client/btpclient/bap.c  | 109 ++++++++++++++++++++++++++++++++++++++++
 client/btpclient/bap.h  |  13 +++++
 client/btpclient/core.c |  15 ++++++
 src/shared/btp.h        |  16 ++++++
 5 files changed, 154 insertions(+)
 create mode 100644 client/btpclient/bap.c
 create mode 100644 client/btpclient/bap.h

Here is the summary with links:
- [BlueZ] client/btpclient: Add BTP_OP_BAP_DISCOVER support

    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=b57658668c7c

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html