Details
-
Type:
Bug
-
Status: Reported
-
Priority:
P2: Important
-
Resolution: Unresolved
-
Affects Version/s: 5.9, 5.12.0
-
Fix Version/s: None
-
Component/s: Connectivity: Bluetooth
-
Labels:None
-
Platform/s:
Description
Qt's Bluetooth library does not forward notifications on unknown handles on economic AT-09/HM-10 modules (https://medium.com/@yostane/using-the-at-09-ble-module-with-the-arduino-3bc7d5cb0ac2) equipped with a somewhat broken firmware.
The problem has been raised in various forum posts: https://www.qtcentre.org/printthread.php?t=65959&pp=20&page=1, https://forum.qt.io/topic/75559/ble-notification
Basically these modules expose the read, write and notification feature on a single BLE characteristic with handle 35 (0x23) but in the end they send it over a "virtual not-announced" characteristic with handle 53 (0x35).
Considering the source code (qlowenergycontroller_bluez.cpp, https://github.com/RSATom/Qt/blob/master/qtconnectivity/src/bluetooth/qlowenergycontroller_bluez.cpp#L1832) line 1845 would yield the announced characteristic with the lower handle (since the check is actual handle >= characteristics handle).
But in line 1846 we have if (ch.isValid() && ch.handle() == changedHandle) { where the check is done stricter (handle == characteristics handle) and the notification gets bailed out.
So I would suggest to drop this second if clause to make also these broken modules work, since they are very common and obtaining a firmware upgrade is mostly improbable.