Skip to content

Commit

Permalink
device: set authenticated and sc state on AES encryption change
Browse files Browse the repository at this point in the history
  • Loading branch information
uael authored Nov 22, 2023
1 parent e08c84d commit 93e8c7b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bumble/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 93e8c7b

Please sign in to comment.