Skip to content

Commit

Permalink
Add Europa service UUID
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe Bonnaz <[email protected]>
  • Loading branch information
PhilippeBonnaz committed Feb 28, 2024
1 parent 921d84c commit b424418
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ledgerblue/BleComm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from bleak.backends.scanner import AdvertisementData
from typing import List

LEDGER_SERVICE_UUID_EUROPA = "13d63400-2c97-3004-0000-4c6564676572"
LEDGER_SERVICE_UUID_STAX = "13d63400-2c97-6004-0000-4c6564676572"
LEDGER_SERVICE_UUID_NANOX = "13d63400-2c97-0004-0000-4c6564676572"

Expand All @@ -25,7 +26,7 @@ def __init__(self):
self.devices = []

def __scan_callback(self, device: BLEDevice, advertisement_data: AdvertisementData):
if LEDGER_SERVICE_UUID_STAX in advertisement_data.service_uuids or LEDGER_SERVICE_UUID_NANOX in advertisement_data.service_uuids:
if LEDGER_SERVICE_UUID_STAX in advertisement_data.service_uuids or LEDGER_SERVICE_UUID_NANOX in advertisement_data.service_uuids or LEDGER_SERVICE_UUID_EUROPA in advertisement_data.service_uuids:
device_is_in_list = False
for dev in self.devices:
if device.address == dev[0]:
Expand All @@ -39,7 +40,7 @@ async def scan(self):
)
await scanner.start()
counter = 0
while counter < 50:
while counter < 5000:
await asyncio.sleep(0.01)
counter += 1
await scanner.stop()
Expand All @@ -59,7 +60,7 @@ async def _get_client(address: str) -> BleakClient:
characteristic_write_with_rsp = None
characteristic_write_cmd = None
for service in client.services:
if service.uuid in [LEDGER_SERVICE_UUID_NANOX, LEDGER_SERVICE_UUID_STAX]:
if service.uuid in [LEDGER_SERVICE_UUID_NANOX, LEDGER_SERVICE_UUID_STAX, LEDGER_SERVICE_UUID_EUROPA]:
for char in service.characteristics:
if "0001" in char.uuid:
characteristic_notify = char
Expand Down

0 comments on commit b424418

Please sign in to comment.