Unsolved QBluetoothDeviceDiscoveryAgent on Low Energy devices
-
I have already posted a question on this one. It seem to me that QBluetoothDeviceDiscoveryAgent has a number of serious issues. Yet, all the following posts within the last couple of months are unresolved/unanswered:
https://forum.qt.io/topic/67632/slow-bluetooth-low-energy-device-discovery-and-other-ble-issues
https://forum.qt.io/topic/66114/how-do-i-scan-for-specific-ble-service-uuids
https://forum.qt.io/topic/65145/qbluetoothdevicediscoveryagent-ios
https://forum.qt.io/topic/65018/qbluetoothdevicediscoveryagent-unsupportedplatformerror-on-beaglebone-black-with-btle
https://forum.qt.io/topic/62023/qt-5-6-0-bluetooth-discovery-doesn-t-work/2
https://forum.qt.io/topic/64251/qtconnectivity-device-discovery-aborted-due-to-unexpected-adapter-changes
https://forum.qt.io/topic/64292/how-to-clear-qbluetoothdevicediscoveryagent-discovereddevicesMain problem:
- QBluetoothDeviceDiscoveryAgent does not allow specifying scan for Low Energy devices only, therefore it must use the android API call startDiscovery() which by the documentation is only meant/(supported?) for BT classic, although it normally also discovers LE devices. This is a two-pass fixed 12 second scan (which may be too short), where the second pass connects to each device found to get device name etc. The scan drains battery and is heavy on the BT adapter.
- Because of this, it cannot use android API calls startLeScan() or the newer startScan(), which are faster and more lightweight. They also allow to specify various filters which may speed up the search, like MAC addresses or device names. In addition the scan time can be set. startLeScan() has been around since Android 4.3 and startScan() since 5.0.