not workan yet jfc ihate this language bitch ass interpreted lang, auto memory management, MEANINGFUL WHITESPACE, A PACKAGE MANAGER?? i am literally in hell

This commit is contained in:
2026-04-26 19:58:07 -06:00
parent d2d56c3f1b
commit 93d12cdc45
2 changed files with 23 additions and 22 deletions
+23
View File
@@ -0,0 +1,23 @@
import asyncio
from bleak import BleakScanner, BleakError
# C0:1C:6A is the prefix for my personal mobile, so not for use in real world
VENDOR_PREFIXES = ['00:25:DF', '00:58:28', '00:C0:D4', '84:70:03', 'C0:1C:6A']
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.")
if __name__ == "__main__":
asyncio.run(main())