From 0cd93ca0c5427a804e1315d6f8ad8b6b939cdbf0 Mon Sep 17 00:00:00 2001 From: Abel Lucas Date: Tue, 29 Nov 2022 18:03:56 +0000 Subject: [PATCH] gatt: update `read_characteristics_by_uuid` to returns `[(handle, value)]` instead of `[value]` --- apps/pair.py | 6 +++--- bumble/gatt_client.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/pair.py b/apps/pair.py index 7f89629..78967b4 100644 --- a/apps/pair.py +++ b/apps/pair.py @@ -149,9 +149,9 @@ async def get_peer_name(peer, mode): if not services: return None - values = await peer.read_characteristics_by_uuid(GATT_DEVICE_NAME_CHARACTERISTIC, services[0]) - if values: - return values[0].decode('utf-8') + characteristics = await peer.read_characteristics_by_uuid(GATT_DEVICE_NAME_CHARACTERISTIC, services[0]) + if characteristics: + return characteristics[0][1].decode('utf-8') # ----------------------------------------------------------------------------- diff --git a/bumble/gatt_client.py b/bumble/gatt_client.py index 1ba1e2a..d61120b 100644 --- a/bumble/gatt_client.py +++ b/bumble/gatt_client.py @@ -712,7 +712,7 @@ class Client: logger.warning(f'bogus handle value: {attribute_handle}') return [] - characteristics_values.append(attribute_value) + characteristics_values.append((attribute_handle, attribute_value)) # Move on to the next characteristics starting_handle = response.attributes[-1][0] + 1