QML UI: detect BT dive computers
If we find something that looks like a known BT dive computer, set things up so that we can use it later. If multiple dive computers are found, simply use the first. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#if BT_SUPPORT
|
||||
#include <QBluetoothLocalDevice>
|
||||
#include <QBluetoothDeviceDiscoveryAgent>
|
||||
#include <QBluetoothUuid>
|
||||
#endif
|
||||
|
||||
#include "core/gpslocation.h"
|
||||
@@ -118,6 +119,8 @@ public:
|
||||
bool showPin() const;
|
||||
void setShowPin(bool enable);
|
||||
Q_INVOKABLE QStringList getDCListFromVendor(const QString& vendor);
|
||||
Q_INVOKABLE int getVendorIndex();
|
||||
Q_INVOKABLE int getProductIndex();
|
||||
#if BT_SUPPORT
|
||||
void btDeviceDiscovered(const QBluetoothDeviceInfo &device);
|
||||
#endif
|
||||
@@ -206,6 +209,12 @@ private:
|
||||
#if BT_SUPPORT
|
||||
QBluetoothLocalDevice localBtDevice;
|
||||
QBluetoothDeviceDiscoveryAgent *discoveryAgent;
|
||||
struct btVendorProduct {
|
||||
QBluetoothDeviceInfo btdi;
|
||||
int vendorIdx;
|
||||
int productIdx;
|
||||
};
|
||||
QList<struct btVendorProduct> btDCs;
|
||||
#endif
|
||||
|
||||
signals:
|
||||
|
||||
Reference in New Issue
Block a user