Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ] monitor: Add support for HCI Event Encryption Change v2
@ 2026-05-22 11:15 Archie Pusaka
  2026-05-22 14:15 ` [BlueZ] " bluez.test.bot
  2026-05-26 15:40 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Archie Pusaka @ 2026-05-22 11:15 UTC (permalink / raw)
  To: linux-bluetooth, Luiz Augusto von Dentz; +Cc: CrosBT Upstreaming, Archie Pusaka

From: Archie Pusaka <apusaka@chromium.org>

> HCI Event: Encryption Change v2 (0x59) plen 5
        Status: Success (0x00)
        Handle: 256 (BR-ACL) Address: 00:11:22:34:56:78
        Encryption: Enabled with E0 (0x01)
        Key size: 16
---

 monitor/bt.h     |  8 ++++++++
 monitor/packet.c | 13 +++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/monitor/bt.h b/monitor/bt.h
index 147b76537..eac6b5ed7 100644
--- a/monitor/bt.h
+++ b/monitor/bt.h
@@ -3696,6 +3696,14 @@ struct bt_hci_evt_auth_payload_timeout_expired {
 	uint16_t handle;
 } __attribute__ ((packed));
 
+#define BT_HCI_EVT_ENCRYPT_CHANGE_V2		0x59
+struct bt_hci_evt_encrypt_change_v2 {
+	uint8_t  status;
+	uint16_t handle;
+	uint8_t  encr_mode;
+	uint8_t  encr_key_size;
+} __attribute__ ((packed));
+
 #define BT_HCI_EVT_LE_CONN_COMPLETE		0x01
 struct bt_hci_evt_le_conn_complete {
 	uint8_t  status;
diff --git a/monitor/packet.c b/monitor/packet.c
index ff0b1cac2..0de7e6f57 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -12008,6 +12008,17 @@ static void auth_payload_timeout_expired_evt(struct timeval *tv, uint16_t index,
 	print_handle(evt->handle);
 }
 
+static void encrypt_change_evt_v2(struct timeval *tv, uint16_t index,
+					const void *data, uint8_t size)
+{
+	const struct bt_hci_evt_encrypt_change_v2 *evt = data;
+
+	print_status(evt->status);
+	print_handle(evt->handle);
+	print_encr_mode_change(evt->encr_mode, evt->handle);
+	print_key_size(evt->encr_key_size);
+}
+
 static void le_conn_complete_evt(struct timeval *tv, uint16_t index,
 					const void *data, uint8_t size)
 {
@@ -13737,6 +13748,8 @@ static const struct event_data event_table[] = {
 	{ 0x57, "Authenticated Payload Timeout Expired",
 				auth_payload_timeout_expired_evt, 2, true },
 	{ 0x58, "SAM Status Change" },
+	{ 0x59, "Encryption Change v2",
+				encrypt_change_evt_v2, 5, true },
 	{ 0xfe, "Testing" },
 	{ 0xff, "Vendor", vendor_evt, 0, false },
 	{ }
-- 
2.54.0.746.g67dd491aae-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-26 15:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-22 11:15 [PATCH BlueZ] monitor: Add support for HCI Event Encryption Change v2 Archie Pusaka
2026-05-22 14:15 ` [BlueZ] " bluez.test.bot
2026-05-26 15:40 ` [PATCH BlueZ] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox