diff --git a/implementations/Python3/DREAMMAKER.py b/implementations/Python3/DREAMMAKER.py index f618e5a..9c159ae 100644 --- a/implementations/Python3/DREAMMAKER.py +++ b/implementations/Python3/DREAMMAKER.py @@ -1,5 +1,6 @@ import asyncio from bleak import BleakScanner, BleakError +from datetime import datetime # bunch of random prefixes for testing ## VENDOR_PREFIXES = ['00:25:DF', '00:58:28', '00:C0:D4', '84:70:03', 'C0:1C:6A', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0B', '77', '99', '0A', '0B', '0C', '0D', '0E', '0F', 'AB', 'C0'] @@ -8,18 +9,16 @@ VENDOR_PREFIXES = ['00:25:DF', '00:58:28', '00:C0:D4', '84:70:03'] async def main(): print("Scanning for BLE devices...") - try: - devices = await BleakScanner.discover() - print(f"Found {len(devices)} devices:") - filtered_devices = [device for device in devices if any(device.address.upper().startswith(prefix) for prefix in VENDOR_PREFIXES)] - if filtered_devices: - for device in filtered_devices: - print(f"MAC Address: {device.address}, Name: {device.name}") - else: - print("No devices found with the specified vendor prefixes.") - except BleakError as e: - print(f"Error: {e}") - print("Make sure Bluetooth is enabled and a Bluetooth adapter is present.") + while True: + try: + await devices = await BleakScanner.discover() + filtered_devices = [device for device in devices if any(device.address.upper().startswith(prefix) for prefix in VENDOR_PREFIXES)] + if filtered_devices: + now = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3] # includes miliseconds + print(f"VLAT HAS BEEN SPOTTED MAC: {filtered_devices[0].address} TIME: {now}") + except BleakError as e: + print(f"Error during scanning: {e}") + await asyncio.sleep(10) # wait before next scan + filtered_devices = [device for device in devices if any(device.address.upper().startswith(prefix) for prefix in VENDOR_PREFIXES)] -if __name__ == "__main__": - asyncio.run(main()) \ No newline at end of file +if __name__ == "__main__": asyncio.run(main()) \ No newline at end of file diff --git a/implementations/Python3/requirements.txt b/implementations/Python3/requirements.txt index fc9238a..60adab3 100644 --- a/implementations/Python3/requirements.txt +++ b/implementations/Python3/requirements.txt @@ -1,3 +1,2 @@ -scapy requests bleak \ No newline at end of file