From f6768cedf3f0e05e125bca11ff31c2361d2e880c Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Mon, 3 Jul 2017 20:27:57 +0200 Subject: 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 --- core/qt-ble.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/qt-ble.cpp b/core/qt-ble.cpp index 197c2ddca..6ea59cded 100644 --- a/core/qt-ble.cpp +++ b/core/qt-ble.cpp @@ -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; -- cgit v1.2.3-70-g09d2