diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2017-06-01 20:07:19 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-06-01 16:53:29 -0700 |
commit | ed392694db0a878e14790073f73690384cdf1467 (patch) | |
tree | 651dd8fd58f13bb9da40367cbbd11b1cb3e66e65 /mobile-widgets/qmlmanager.h | |
parent | ec34ebfb040edbd5c4f36982e610100d005cfe06 (diff) | |
download | subsurface-ed392694db0a878e14790073f73690384cdf1467.tar.gz |
Android BT: pull the pairing data from a device
As Qt is not able to pull the pairing data from a device, a lengthy
discovery process is needed to see what devices are paired. On
https://forum.qt.io/topic/46075/solved-bluetooth-list-paired-devices
user s.frings74 does, however, present a solution to this using JNI.
Currently, this code is taken "as is".
Currently, only for Android (so not mobile-on-desktop, or even desktop).
And only generating logging data in the logcat.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'mobile-widgets/qmlmanager.h')
-rw-r--r-- | mobile-widgets/qmlmanager.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index e21b93d07..bc2cc1fbf 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -12,6 +12,9 @@ #include <QBluetoothDeviceDiscoveryAgent> #include <QBluetoothUuid> #endif +#if defined(Q_OS_ANDROID) +#include <QAndroidJniObject> +#endif #include "core/gpslocation.h" #include "qt-models/divelistmodel.h" @@ -125,6 +128,7 @@ public: #if defined(BT_SUPPORT) void btDeviceDiscovered(const QBluetoothDeviceInfo &device); #endif + QStringList getBluetoothDevices(); public slots: void applicationStateChanged(Qt::ApplicationState state); @@ -207,6 +211,11 @@ private: bool checkDepth(DiveObjectHelper *myDive, struct dive *d, QString depth); bool currentGitLocalOnly; bool m_showPin; + +#if defined(Q_OS_ANDROID) + bool checkException(const char* method, const QAndroidJniObject* obj); +#endif + #if defined(BT_SUPPORT) QBluetoothLocalDevice localBtDevice; QBluetoothDeviceDiscoveryAgent *discoveryAgent; |