From 9bf2e0335435746a9e5781b6a044eb6d068f5790 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 f343a4b5..216da09f 100644 --- a/bumble/device.py +++ b/bumble/device.py @@ -3158,10 +3158,18 @@ class Device(CompositeEventEmitter): 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