* [PATCH BlueZ] client/btpclient: Add BTP_EV_GAP_SEC_LEVEL_CHANGED support
@ 2026-05-07 16:16 Frédéric Danis
2026-05-07 16:56 ` Luiz Augusto von Dentz
2026-05-07 17:50 ` [BlueZ] " bluez.test.bot
0 siblings, 2 replies; 3+ messages in thread
From: Frédéric Danis @ 2026-05-07 16:16 UTC (permalink / raw)
To: linux-bluetooth
This allows reduces connection time for the BAP tests.
---
client/btpclient/gap.c | 22 ++++++++++++++++++++++
src/shared/btp.h | 11 +++++++++++
2 files changed, 33 insertions(+)
diff --git a/client/btpclient/gap.c b/client/btpclient/gap.c
index 68e029dcc..1a6c2c2f0 100644
--- a/client/btpclient/gap.c
+++ b/client/btpclient/gap.c
@@ -2538,6 +2538,21 @@ static void btp_gap_device_connection_ev(struct l_dbus_proxy *proxy,
}
}
+static void btp_security_changed_ev(struct l_dbus_proxy *proxy, bool paired)
+{
+ struct btp_device *dev = find_device_by_proxy(proxy);
+ struct btp_adapter *adapter = find_adapter_by_device(dev);
+ struct btp_gap_sec_level_changed_ev ev;
+
+ /* TODO: get real security level */
+ memcpy(&ev.address, &dev->address, sizeof(ev.address));
+ ev.address_type = dev->address_type;
+ ev.sec_level = BTP_GAP_SEC_LEVEL_AUTH_ENC;
+
+ btp_send(btp, BTP_GAP_SERVICE, BTP_EV_GAP_SEC_LEVEL_CHANGED,
+ adapter->index, sizeof(ev), &ev);
+}
+
static void btp_identity_resolved_ev(struct l_dbus_proxy *proxy)
{
struct btp_device *dev = find_device_by_proxy(proxy);
@@ -2709,6 +2724,13 @@ void gap_property_changed(struct l_dbus_proxy *proxy, const char *name,
*/
if (!prop)
btp_gap_device_connection_ev(proxy, prop);
+ } else if (!strcmp(name, "Paired")) {
+ bool prop;
+
+ if (!l_dbus_message_get_arguments(msg, "b", &prop))
+ return;
+
+ btp_security_changed_ev(proxy, prop);
} else if (!strcmp(name, "AddressType")) {
/* Address property change came first along with address
* type.
diff --git a/src/shared/btp.h b/src/shared/btp.h
index b99ad3a28..4d3c4ec6f 100644
--- a/src/shared/btp.h
+++ b/src/shared/btp.h
@@ -286,6 +286,17 @@ struct btp_gap_identity_resolved_ev {
bdaddr_t identity_address;
} __packed;
+#define BTP_GAP_SEC_LEVEL_UNAUTH_ENC 0x01
+#define BTP_GAP_SEC_LEVEL_AUTH_ENC 0x02
+#define BTP_GAP_SEC_LEVEL_AUTH_SC 0x03
+
+#define BTP_EV_GAP_SEC_LEVEL_CHANGED 0x89
+struct btp_gap_sec_level_changed_ev {
+ uint8_t address_type;
+ bdaddr_t address;
+ uint8_t sec_level;
+} __packed;
+
struct btp_gatt_service {
uint16_t start_handle;
uint16_t end_handle;
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH BlueZ] client/btpclient: Add BTP_EV_GAP_SEC_LEVEL_CHANGED support
2026-05-07 16:16 [PATCH BlueZ] client/btpclient: Add BTP_EV_GAP_SEC_LEVEL_CHANGED support Frédéric Danis
@ 2026-05-07 16:56 ` Luiz Augusto von Dentz
2026-05-07 17:50 ` [BlueZ] " bluez.test.bot
1 sibling, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2026-05-07 16:56 UTC (permalink / raw)
To: Frédéric Danis; +Cc: linux-bluetooth
Hi Frédéric,
On Thu, May 7, 2026 at 12:23 PM Frédéric Danis
<frederic.danis@collabora.com> wrote:
>
> This allows reduces connection time for the BAP tests.
> ---
> client/btpclient/gap.c | 22 ++++++++++++++++++++++
> src/shared/btp.h | 11 +++++++++++
> 2 files changed, 33 insertions(+)
>
> diff --git a/client/btpclient/gap.c b/client/btpclient/gap.c
> index 68e029dcc..1a6c2c2f0 100644
> --- a/client/btpclient/gap.c
> +++ b/client/btpclient/gap.c
> @@ -2538,6 +2538,21 @@ static void btp_gap_device_connection_ev(struct l_dbus_proxy *proxy,
> }
> }
>
> +static void btp_security_changed_ev(struct l_dbus_proxy *proxy, bool paired)
> +{
> + struct btp_device *dev = find_device_by_proxy(proxy);
> + struct btp_adapter *adapter = find_adapter_by_device(dev);
> + struct btp_gap_sec_level_changed_ev ev;
> +
> + /* TODO: get real security level */
I guess it wouldn't hurt to expose the security level somehow, not the
key itself just the level.
> + memcpy(&ev.address, &dev->address, sizeof(ev.address));
> + ev.address_type = dev->address_type;
> + ev.sec_level = BTP_GAP_SEC_LEVEL_AUTH_ENC;
> +
> + btp_send(btp, BTP_GAP_SERVICE, BTP_EV_GAP_SEC_LEVEL_CHANGED,
> + adapter->index, sizeof(ev), &ev);
> +}
> +
> static void btp_identity_resolved_ev(struct l_dbus_proxy *proxy)
> {
> struct btp_device *dev = find_device_by_proxy(proxy);
> @@ -2709,6 +2724,13 @@ void gap_property_changed(struct l_dbus_proxy *proxy, const char *name,
> */
> if (!prop)
> btp_gap_device_connection_ev(proxy, prop);
> + } else if (!strcmp(name, "Paired")) {
> + bool prop;
> +
> + if (!l_dbus_message_get_arguments(msg, "b", &prop))
> + return;
> +
> + btp_security_changed_ev(proxy, prop);
> } else if (!strcmp(name, "AddressType")) {
> /* Address property change came first along with address
> * type.
> diff --git a/src/shared/btp.h b/src/shared/btp.h
> index b99ad3a28..4d3c4ec6f 100644
> --- a/src/shared/btp.h
> +++ b/src/shared/btp.h
> @@ -286,6 +286,17 @@ struct btp_gap_identity_resolved_ev {
> bdaddr_t identity_address;
> } __packed;
>
> +#define BTP_GAP_SEC_LEVEL_UNAUTH_ENC 0x01
> +#define BTP_GAP_SEC_LEVEL_AUTH_ENC 0x02
> +#define BTP_GAP_SEC_LEVEL_AUTH_SC 0x03
> +
> +#define BTP_EV_GAP_SEC_LEVEL_CHANGED 0x89
> +struct btp_gap_sec_level_changed_ev {
> + uint8_t address_type;
> + bdaddr_t address;
> + uint8_t sec_level;
> +} __packed;
> +
> struct btp_gatt_service {
> uint16_t start_handle;
> uint16_t end_handle;
> --
> 2.43.0
>
>
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [BlueZ] client/btpclient: Add BTP_EV_GAP_SEC_LEVEL_CHANGED support
2026-05-07 16:16 [PATCH BlueZ] client/btpclient: Add BTP_EV_GAP_SEC_LEVEL_CHANGED support Frédéric Danis
2026-05-07 16:56 ` Luiz Augusto von Dentz
@ 2026-05-07 17:50 ` bluez.test.bot
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-05-07 17:50 UTC (permalink / raw)
To: linux-bluetooth, frederic.danis
[-- Attachment #1: Type: text/plain, Size: 826 bytes --]
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=1091167
---Test result---
Test Summary:
CheckPatch PASS 0.44 seconds
GitLint PASS 0.29 seconds
BuildEll PASS 20.26 seconds
BluezMake PASS 652.26 seconds
CheckSmatch PASS 351.90 seconds
bluezmakeextell PASS 183.13 seconds
IncrementalBuild PASS 657.53 seconds
ScanBuild PASS 1021.35 seconds
https://github.com/bluez/bluez/pull/2106
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-07 17:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-07 16:16 [PATCH BlueZ] client/btpclient: Add BTP_EV_GAP_SEC_LEVEL_CHANGED support Frédéric Danis
2026-05-07 16:56 ` Luiz Augusto von Dentz
2026-05-07 17:50 ` [BlueZ] " bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox