mirror of
https://github.com/RfidResearchGroup/ChameleonUltra.git
synced 2026-09-11 18:30:14 -07:00
enter_dfu_over_ble.py: support ChameleonLite as well
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user