diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2018-12-21 14:52:02 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-12-21 14:52:02 -0800 |
commit | ef8656998a5c68d4e6806e83da42ea0f3e3ee484 (patch) | |
tree | 86befca5d6fef59bd9ca12245fa29a12fee23011 /mobile-widgets/qmlmanager.cpp | |
parent | 6ba1cf8cf78bc52cac45f3588801e916f7753fb2 (diff) | |
download | subsurface-ef8656998a5c68d4e6806e83da42ea0f3e3ee484.tar.gz |
Mobile: add helper function to fill in the BT name
For some devices the BT device name is different from the product name.
Make sure that name is available to the mobile UI. This helper fills it
in from the scan data (based on the device address).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 8cc2ca940..232b50cfa 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -1757,6 +1757,17 @@ void QMLManager::setStatusbarColor(QColor) #endif +void QMLManager::retrieveBluetoothName() +{ + QString name = DC_devName(); + QList<BTDiscovery::btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs(); + foreach (BTDiscovery::btVendorProduct btDC, btDCs) { + qDebug() << "compare" <<name << btDC.btpdi.address; + if (name.contains(btDC.btpdi.address)) + DC_setDevBluetoothName(btDC.btpdi.name); + } +} + QString QMLManager::DC_vendor() const { return DCDeviceData::instance()->vendor(); |