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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-05-30 17:48:58 -07:00
parent e0771e50f1
commit be271e7d48
2 changed files with 13 additions and 0 deletions

View file

@ -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.

View file

@ -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