From 2c2f512180786bf9e10202335d51edaa165460fd Mon Sep 17 00:00:00 2001 From: Gilles Boccon-Gibod Date: Fri, 7 Apr 2023 12:19:28 -0700 Subject: [PATCH] add comment to explain the initial role choice --- bumble/device.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bumble/device.py b/bumble/device.py index 697484e..6fc4a05 100644 --- a/bumble/device.py +++ b/bumble/device.py @@ -1950,7 +1950,10 @@ class Device(CompositeEventEmitter): self.on('connection', on_connection) self.on('connection_failure', on_connection_failure) - # Save pending connection + # Save pending connection, with the Peripheral role. + # Even if we requested a role switch in the HCI_Accept_Connection_Request + # command, this connection is still considered Peripheral until an eventual + # role change event. self.pending_connections[peer_address] = Connection.incomplete( self, peer_address, BT_PERIPHERAL_ROLE )