enter_dfu_over_ble.py: support ChameleonLite as well

This commit is contained in:
Philippe Teuwen
2023-07-22 22:45:49 +02:00
parent a48f6fc105
commit 0c15ccd7af
+5 -4
View File
@@ -9,12 +9,13 @@ UUID_NORDIC_RX = "6e400003-b5a3-f393-e0a9-e50e24dcca9e"
DFUCMD=b'\x11\xef\x03\xf2\x00\x00\x00\x00\x0b\x00'
async def main():
print("Searching ChameleonUltra...")
device = await BleakScanner.find_device_by_name("ChameleonUltra")
print("Searching ChameleonUltra or ChameleonLite...")
device = await BleakScanner.find_device_by_filter(lambda d, ad: d.name and
((d.name == "ChameleonUltra") or (d.name == "ChameleonLite")))
if device is None:
print("Could not find ChameleonUltra")
print("Could not find ChameleonUltra or ChameleonLite")
return
print("Found!")
print(f"Found {device.name} with address {device.address}")
print("Sending DFU command")
async with BleakClient(device) as client:
c=DFUCMD