diff --git a/apps/console.py b/apps/console.py index 5d04636..9dc173c 100644 --- a/apps/console.py +++ b/apps/console.py @@ -63,6 +63,7 @@ from bumble.transport import open_transport_or_link from bumble.gatt import Characteristic, Service, CharacteristicDeclaration, Descriptor from bumble.gatt_client import CharacteristicProxy from bumble.hci import ( + Address, HCI_Constant, HCI_LE_1M_PHY, HCI_LE_2M_PHY, @@ -289,11 +290,7 @@ class ConsoleApp: device_config, hci_source, hci_sink ) else: - random_address = ( - f"{random.randint(192,255):02X}" # address is static random - ) - for random_byte in random.sample(range(255), 5): - random_address += f":{random_byte:02X}" + random_address = Address.generate_static_address() self.append_to_log(f"Setting random address: {random_address}") self.device = Device.with_hci( 'Bumble', random_address, hci_source, hci_sink