Skip to content

Commit d45ec90

Browse files
authored
Android: fix 'Descriptor None was not found!' (#1580)
The keys in the descriptor dict are the normalized 128-bit UUID string, so we need to use this to correctly find the descriptor. Fixes #823
1 parent 75cd779 commit d45ec90

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.rst

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Fixed
1919
-----
2020
* Fixed ``discovered_devices_and_advertisement_data`` returning devices that should
2121
be filtered out by service UUIDs. Fixes #1576.
22+
* Fixed a ``Descriptor None was not found!`` exception occurring in ``start_notify()`` on Android. Fixes #823.
2223

2324
`0.22.1`_ (2024-05-07)
2425
======================

bleak/backends/p4android/defs.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from jnius import autoclass, cast
66

77
import bleak.exc
8+
from bleak.uuids import normalize_uuid_16
89

910
# caching constants avoids unnecessary extra use of the jni-python interface, which can be slow
1011

@@ -87,4 +88,4 @@ class ScanFailed(enum.IntEnum):
8788
BluetoothGattCharacteristic.PROPERTY_WRITE_NO_RESPONSE: "write-without-response",
8889
}
8990

90-
CLIENT_CHARACTERISTIC_CONFIGURATION_UUID = "2902"
91+
CLIENT_CHARACTERISTIC_CONFIGURATION_UUID = normalize_uuid_16(0x2902)

0 commit comments

Comments
 (0)