mirror of
https://github.com/google/bumble.git
synced 2026-05-10 04:18:03 +00:00
don't set a random address when it is 00:00:00:00:00:00
This commit is contained in:
@@ -1113,10 +1113,13 @@ class Device(CompositeEventEmitter):
|
|||||||
|
|
||||||
if self.le_enabled:
|
if self.le_enabled:
|
||||||
# Set the controller address
|
# Set the controller address
|
||||||
await self.send_command(
|
if self.random_address != Address.ANY_RANDOM:
|
||||||
HCI_LE_Set_Random_Address_Command(random_address=self.random_address),
|
await self.send_command(
|
||||||
check_result=True,
|
HCI_LE_Set_Random_Address_Command(
|
||||||
)
|
random_address=self.random_address
|
||||||
|
),
|
||||||
|
check_result=True,
|
||||||
|
)
|
||||||
|
|
||||||
# Load the address resolving list
|
# Load the address resolving list
|
||||||
if self.keystore and self.host.supports_command(
|
if self.keystore and self.host.supports_command(
|
||||||
|
|||||||
@@ -1638,8 +1638,8 @@ class HCI_Object:
|
|||||||
# Map the value if needed
|
# Map the value if needed
|
||||||
if value_mappers:
|
if value_mappers:
|
||||||
value_mapper = value_mappers.get(key, value_mapper)
|
value_mapper = value_mappers.get(key, value_mapper)
|
||||||
if value_mapper is not None:
|
if value_mapper is not None:
|
||||||
value = value_mapper(value)
|
value = value_mapper(value)
|
||||||
|
|
||||||
# Get the string representation of the value
|
# Get the string representation of the value
|
||||||
value_str = HCI_Object.format_field_value(
|
value_str = HCI_Object.format_field_value(
|
||||||
@@ -1807,6 +1807,7 @@ class Address:
|
|||||||
# Predefined address values
|
# Predefined address values
|
||||||
Address.NIL = Address(b"\xff\xff\xff\xff\xff\xff", Address.PUBLIC_DEVICE_ADDRESS)
|
Address.NIL = Address(b"\xff\xff\xff\xff\xff\xff", Address.PUBLIC_DEVICE_ADDRESS)
|
||||||
Address.ANY = Address(b"\x00\x00\x00\x00\x00\x00", Address.PUBLIC_DEVICE_ADDRESS)
|
Address.ANY = Address(b"\x00\x00\x00\x00\x00\x00", Address.PUBLIC_DEVICE_ADDRESS)
|
||||||
|
Address.ANY_RANDOM = Address(b"\x00\x00\x00\x00\x00\x00", Address.RANDOM_DEVICE_ADDRESS)
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
class OwnAddressType:
|
class OwnAddressType:
|
||||||
|
|||||||
Reference in New Issue
Block a user