summaryrefslogtreecommitdiffstats
path: root/core/qt-ble.cpp
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2017-07-03 20:27:57 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-04 23:46:07 +0900
commitf6768cedf3f0e05e125bca11ff31c2361d2e880c (patch)
treea4d4e18e0eafc5384e325bd745d66e15c9db437e /core/qt-ble.cpp
parent6fe0388b966fe3a6d811f63a299896279864d8e7 (diff)
downloadsubsurface-f6768cedf3f0e05e125bca11ff31c2361d2e880c.tar.gz
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>
Diffstat (limited to 'core/qt-ble.cpp')
-rw-r--r--core/qt-ble.cpp9
1 files changed, 9 insertions, 0 deletions
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;