mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: try to also detect OSTC BT dive computers
The naming scheme of OSTC dive computers doesn't match their product names, but they all behave the same from a download perspective, so we assume that any BT device that has a name starting with OSTC is an OSTC 3. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2a71559045
commit
b9760f1db0
1 changed files with 5 additions and 1 deletions
|
@ -210,6 +210,9 @@ extern void addBtUuid(QBluetoothUuid uuid);
|
||||||
void QMLManager::btDeviceDiscovered(const QBluetoothDeviceInfo &device)
|
void QMLManager::btDeviceDiscovered(const QBluetoothDeviceInfo &device)
|
||||||
{
|
{
|
||||||
QString newDevice = device.name();
|
QString newDevice = device.name();
|
||||||
|
// all the HW OSTC BT computers show up as "OSTC" + some other text, depending on model
|
||||||
|
if (newDevice.startsWith("OSTC"))
|
||||||
|
newDevice = "OSTC 3";
|
||||||
QList<QBluetoothUuid> serviceUuids = device.serviceUuids();
|
QList<QBluetoothUuid> serviceUuids = device.serviceUuids();
|
||||||
foreach (QBluetoothUuid id, serviceUuids) {
|
foreach (QBluetoothUuid id, serviceUuids) {
|
||||||
addBtUuid(id);
|
addBtUuid(id);
|
||||||
|
@ -219,7 +222,8 @@ void QMLManager::btDeviceDiscovered(const QBluetoothDeviceInfo &device)
|
||||||
QString vendor, product;
|
QString vendor, product;
|
||||||
foreach (vendor, productList.keys()) {
|
foreach (vendor, productList.keys()) {
|
||||||
if (productList[vendor].contains(newDevice)) {
|
if (productList[vendor].contains(newDevice)) {
|
||||||
appendTextToLog("this could be a " + vendor + " " + newDevice);
|
appendTextToLog("this could be a " + vendor + " " +
|
||||||
|
(newDevice == "OSTC 3" ? "OSTC family" : newDevice));
|
||||||
struct btVendorProduct btVP;
|
struct btVendorProduct btVP;
|
||||||
btVP.btdi = device;
|
btVP.btdi = device;
|
||||||
btVP.vendorIdx = vendorList.indexOf(vendor);
|
btVP.vendorIdx = vendorList.indexOf(vendor);
|
||||||
|
|
Loading…
Add table
Reference in a new issue