diff options
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 12 | ||||
-rw-r--r-- | mobile-widgets/qmlmanager.h | 1 |
2 files changed, 13 insertions, 0 deletions
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 |