From 93e8c7b8709604d0790f8e065c4dcab09d622871 Mon Sep 17 00:00:00 2001 From: Lucas Abel <22837557+uael@users.noreply.github.com> Date: Tue, 21 Nov 2023 23:49:16 -0800 Subject: [PATCH] device: set `authenticated` and `sc` state on AES encryption change --- bumble/device.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bumble/device.py b/bumble/device.py index 45e919de..744ceb51 100644 --- a/bumble/device.py +++ b/bumble/device.py @@ -3138,10 +3138,18 @@ def on_connection_encryption_change(self, connection, encryption): connection.encryption = encryption if ( not connection.authenticated + and connection.transport == BT_BR_EDR_TRANSPORT and encryption == HCI_Encryption_Change_Event.AES_CCM ): connection.authenticated = True connection.sc = True + if ( + not connection.authenticated + and connection.transport == BT_LE_TRANSPORT + and encryption == HCI_Encryption_Change_Event.E0_OR_AES_CCM + ): + connection.authenticated = True + connection.sc = True connection.emit('connection_encryption_change') @host_event_handler