OSTC over BLE: Select the right service

The current "select the correct BLE service to talk to" is flawed.
It assumes that the first found non-standard UUID is the right one
and apparently it is for some DCs. But not for the HW devices.
The HW devices use a "standard" ie. approved by the Bluetooth
SIG, controller, that comes with a UUID that our code currently
considers standard so not to be the right one.

This (simple) commit selects the right service for HW. The UUID
is hard coded, and this is ok, because it is tied to the hardware
used by HW. Futher, it does not change anything for other BLE
devices.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
Jan Mulder 2017-07-03 20:27:57 +02:00 committed by Dirk Hohndel
parent 6fe0388b96
commit f6768cedf3

View file

@ -76,6 +76,15 @@ void BLEObject::addService(const QBluetoothUuid &newService)
qDebug() << "Found service" << newService;
bool isStandardUuid = false;
newService.toUInt16(&isStandardUuid);
if (device_is_hw(device)) {
/* The HW BT/BLE piece or hardware uses, what we
* call here, "a Standard UUID. It is standard because the Telit/Stollmann
* manufacturer applied for an own UUID for its product, and this was granted
* by the Bluetooth SIG.
*/
if (newService != QUuid("{0000fefb-0000-1000-8000-00805f9b34fb}"))
return; // skip all services except the right one
} else
if (isStandardUuid) {
qDebug () << " .. ignoring standard service";
return;