From be271e7d4860a360081162edeafb76c3fd40d3da Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 30 May 2017 17:48:58 -0700 Subject: QML UI: add getBtAddress function This allows us to get the BT address of the first dive computer that we found. Signed-off-by: Dirk Hohndel --- mobile-widgets/qmlmanager.cpp | 12 ++++++++++++ mobile-widgets/qmlmanager.h | 1 + 2 files changed, 13 insertions(+) (limited to 'mobile-widgets') diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index d9ec7c1c8..491c16825 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -249,6 +249,18 @@ int QMLManager::getProductIndex() return -1; } +QString QMLManager::getBtAddress() +{ +#if BT_SUPPORT + if (!btDCs.isEmpty()) { + QString btAddr = btDCs.first().btdi.address().toString(); + qDebug() << "getBtAddress" << btAddr; + return btAddr; + } + return QString(); +#endif +} + void QMLManager::finishSetup() { // Initialize cloud credentials. diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index 0d7f2aaa0..7e1c3b78b 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -121,6 +121,7 @@ public: Q_INVOKABLE QStringList getDCListFromVendor(const QString& vendor); Q_INVOKABLE int getVendorIndex(); Q_INVOKABLE int getProductIndex(); + Q_INVOKABLE QString getBtAddress(); #if BT_SUPPORT void btDeviceDiscovered(const QBluetoothDeviceInfo &device); #endif -- cgit v1.2.3-70-g09d2