mirror of
https://github.com/google/bumble.git
synced 2026-05-09 04:08:02 +00:00
only instantiate keystore if not already set
This commit is contained in:
@@ -339,8 +339,7 @@ async def run(
|
|||||||
|
|
||||||
# Create a UDP to TX bridge (receive from TX, send to UDP)
|
# Create a UDP to TX bridge (receive from TX, send to UDP)
|
||||||
bridge.tx_socket, _ = await loop.create_datagram_endpoint(
|
bridge.tx_socket, _ = await loop.create_datagram_endpoint(
|
||||||
# pylint: disable-next=unnecessary-lambda
|
asyncio.DatagramProtocol,
|
||||||
lambda: asyncio.DatagramProtocol(),
|
|
||||||
remote_addr=(send_host, send_port),
|
remote_addr=(send_host, send_port),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1179,7 +1179,8 @@ class Device(CompositeEventEmitter):
|
|||||||
|
|
||||||
# Instantiate the Key Store (we do this here rather than at __init__ time
|
# Instantiate the Key Store (we do this here rather than at __init__ time
|
||||||
# because some Key Store implementations use the public address as a namespace)
|
# because some Key Store implementations use the public address as a namespace)
|
||||||
self.keystore = KeyStore.create_for_device(self)
|
if self.keystore is None:
|
||||||
|
self.keystore = KeyStore.create_for_device(self)
|
||||||
|
|
||||||
if self.host.supports_command(HCI_WRITE_LE_HOST_SUPPORT_COMMAND):
|
if self.host.supports_command(HCI_WRITE_LE_HOST_SUPPORT_COMMAND):
|
||||||
await self.send_command(
|
await self.send_command(
|
||||||
|
|||||||
Reference in New Issue
Block a user