QML UI: start BT discovery

So far all this does is list all the BT devices that it finds
(and I worry if this will have negative battery implications
on a mobile device), but this should allow us to connect to
a standard BT dive computer (but that will of course require
more code to pick the right device).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-05-29 11:56:13 -07:00
parent 9bea9fcdb7
commit 1ab6b50a34
2 changed files with 31 additions and 0 deletions

View file

@ -7,6 +7,10 @@
#include <QNetworkAccessManager>
#include <QScreen>
#include <QElapsedTimer>
#if BT_SUPPORT
#include <QBluetoothLocalDevice>
#include <QBluetoothDeviceDiscoveryAgent>
#endif
#include "core/gpslocation.h"
#include "qt-models/divelistmodel.h"
@ -114,6 +118,9 @@ public:
bool showPin() const;
void setShowPin(bool enable);
Q_INVOKABLE QStringList getDCListFromVendor(const QString& vendor);
#if BT_SUPPORT
void btDeviceDiscovered(const QBluetoothDeviceInfo &device);
#endif
public slots:
void applicationStateChanged(Qt::ApplicationState state);
@ -196,6 +203,10 @@ private:
bool checkDepth(DiveObjectHelper *myDive, struct dive *d, QString depth);
bool currentGitLocalOnly;
bool m_showPin;
#if BT_SUPPORT
QBluetoothLocalDevice localBtDevice;
QBluetoothDeviceDiscoveryAgent *discoveryAgent;
#endif
signals:
void cloudUserNameChanged();