Details
-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.7.1, 5.8.0
Description
In Qt's current Bluetooth Low Energy implementation, it is needed to call QLowEnergyController::discoverServices() and QLowEnergyService::discoverDetails() before it is allowed to read or write a characteristic on a BLE device.
In our use case, the obligatory discover methods discover services and details of of services which exists, but we are never going to use. While gathering information we don't need, we have to wait a significantly amount of time before being able to read out data we are interested in. In our use case, calling the discoverings methods sums up to about 4-6 seconds (nearly all of this time is needed for QLowEnergyService::discoverDetails()) before we are able read out any if the really interesting data from characteristics of the connected peripheral.
What it makes even worse for us is the fact, that we connect only to ble devices produced by our company. This means we do exactly know what services and characteristics exists on the devices we want to connect, even the handles of the characteristics are exactly known. So even the details of services and characteristics we are going to use were known without doing any discovering.
We would appreciate it very much, if it would be possible to give us the possibility to speed up reading out the first data from our ble devices. After taking a deeper look into your source code, two approaches seem to be promising to me:
- In QLowEnergyService: Allow calling readCharacteristic() and writeCharacteristic() while the object is not in the ServiceDiscovered state. Discover needed details (i.e. handles of the characteristic?) "on-the-fly" and cache them afterwards.
- Implement (additional) more low-level methods readCharacteristic() and writeCharacteristic() which can be called with the handle instead of the uuid of the characteristic.