Skip to content

Commit b424418

Browse files
Add Europa service UUID
Signed-off-by: Philippe Bonnaz <philippe@ledger.fr>
1 parent 921d84c commit b424418

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ledgerblue/BleComm.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from bleak.backends.scanner import AdvertisementData
77
from typing import List
88

9+
LEDGER_SERVICE_UUID_EUROPA = "13d63400-2c97-3004-0000-4c6564676572"
910
LEDGER_SERVICE_UUID_STAX = "13d63400-2c97-6004-0000-4c6564676572"
1011
LEDGER_SERVICE_UUID_NANOX = "13d63400-2c97-0004-0000-4c6564676572"
1112

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

2728
def __scan_callback(self, device: BLEDevice, advertisement_data: AdvertisementData):
28-
if LEDGER_SERVICE_UUID_STAX in advertisement_data.service_uuids or LEDGER_SERVICE_UUID_NANOX in advertisement_data.service_uuids:
29+
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:
2930
device_is_in_list = False
3031
for dev in self.devices:
3132
if device.address == dev[0]:
@@ -39,7 +40,7 @@ async def scan(self):
3940
)
4041
await scanner.start()
4142
counter = 0
42-
while counter < 50:
43+
while counter < 5000:
4344
await asyncio.sleep(0.01)
4445
counter += 1
4546
await scanner.stop()
@@ -59,7 +60,7 @@ async def _get_client(address: str) -> BleakClient:
5960
characteristic_write_with_rsp = None
6061
characteristic_write_cmd = None
6162
for service in client.services:
62-
if service.uuid in [LEDGER_SERVICE_UUID_NANOX, LEDGER_SERVICE_UUID_STAX]:
63+
if service.uuid in [LEDGER_SERVICE_UUID_NANOX, LEDGER_SERVICE_UUID_STAX, LEDGER_SERVICE_UUID_EUROPA]:
6364
for char in service.characteristics:
6465
if "0001" in char.uuid:
6566
characteristic_notify = char

0 commit comments

Comments
 (0)