mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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:
parent
6fe0388b96
commit
f6768cedf3
1 changed files with 9 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue