Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Europa service UUID #129

Merged
merged 1 commit into from
Feb 28, 2024
Merged
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
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
Loading