Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/mario.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

# BLE stuff
LEGO_CHARACTERISTIC_UUID = "00001624-1212-efde-1623-785feabcd123"
LEGO_SERVICE_UUID = "00001623-1212-efde-1623-785feabcd123"
SUBSCRIBE_IMU_COMMAND = bytearray([0x0A, 0x00, 0x41, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01])
SUBSCRIBE_RGB_COMMAND = bytearray([0x0A, 0x00, 0x41, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01])

Expand Down Expand Up @@ -148,7 +149,7 @@ async def run(self):
self.gui.accel_field.SetLabel("")
devices = await BleakScanner.discover()
for d in devices:
if d.name.lower().startswith("lego mario"):
if d.name.lower().startswith("lego mario") or LEGO_SERVICE_UUID in d.metadata['uuids']:
self.gui.status_field.SetLabel("Found Mario!")
try:
async with BleakClient(d.address) as client:
Expand Down