Slow bluetooth low energy device discovery and other BLE issues



  • I'm creating a Qt Quick BLE mobile app for a customer, and I fear that I may need to abandon Qt/QML because of the seemingly poor and shallow implementation of Bluetooth LE functionality.

    1. The QBluetoothDeviceDiscoveryAgent seems to only be using the heavyweight 12-second android api startDiscovery() scan, as it may find both BT classic and LE devices, although that call is only meant for BT classic devices. The only option LimitedInquiry does not set BLE mode. For BLE, android api startLeScan() (api level 18) or startScan() (api level 21) should have been used. These calls are much faster and scanning time can be set.

    2. Compare the speed of the Qt bluetooth LE sample apps with nRF Master Control Panel found in the Google Play store to see the striking difference in discovery speed.

    3. Finally, when I subscribe for notifications (by writing 0x0100 to the characteristics descriptor - only documented through example code), the device was sending 10 data packages (20 bytes) every 100ms. More or less consistently, I only got the 3 first. After reducing the speed to 1 package per second, I reliably received all data. This is way too slow, and packages shouldn't just disappear without any error response?

    I may have missed something important here, so if anyone could help me I would be very thankful.

    PS: I have mainly been testing on an old Samsung Note 2 (android 4.3.2), but it seems to be the same problems on newer devices.



  • @operamint did you open a bug/feature request for it? I can second this, the discovery process (I'm only interested in LE devices) takes way too long...



  • @bearsh I checked Jira but didn't find anything, so I created https://bugreports.qt.io/browse/QTBUG-55970


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.