add comment to explain the initial role choice

This commit is contained in:
Gilles Boccon-Gibod
2023-04-07 12:19:28 -07:00
parent 859aea5a99
commit 2c2f512180

View File

@@ -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
)