forked from auracaster/bumble_mirror
fix classic connection event filtering
This commit is contained in:
@@ -1217,6 +1217,11 @@ class Device(CompositeEventEmitter):
|
|||||||
logger.debug('looking for peer by name')
|
logger.debug('looking for peer by name')
|
||||||
peer_address = await self.find_peer_by_name(peer_address, transport) # TODO: timeout
|
peer_address = await self.find_peer_by_name(peer_address, transport) # TODO: timeout
|
||||||
|
|
||||||
|
# All BR/EDR addresses should be public addresses
|
||||||
|
if transport == BT_BR_EDR_TRANSPORT and peer_address.address_type != Address.PUBLIC_DEVICE_ADDRESS:
|
||||||
|
peer_address = peer_address.clone()
|
||||||
|
peer_address.address_type = Address.PUBLIC_DEVICE_ADDRESS
|
||||||
|
|
||||||
def on_connection(connection):
|
def on_connection(connection):
|
||||||
if transport == BT_LE_TRANSPORT or (
|
if transport == BT_LE_TRANSPORT or (
|
||||||
# match BR/EDR connection event against peer address
|
# match BR/EDR connection event against peer address
|
||||||
|
|||||||
@@ -1706,6 +1706,9 @@ class Address:
|
|||||||
|
|
||||||
self.address_type = address_type
|
self.address_type = address_type
|
||||||
|
|
||||||
|
def clone(self):
|
||||||
|
return Address(self.address_bytes, self.address_type)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_public(self):
|
def is_public(self):
|
||||||
return self.address_type == self.PUBLIC_DEVICE_ADDRESS or self.address_type == self.PUBLIC_IDENTITY_ADDRESS
|
return self.address_type == self.PUBLIC_DEVICE_ADDRESS or self.address_type == self.PUBLIC_IDENTITY_ADDRESS
|
||||||
|
|||||||
Reference in New Issue
Block a user