mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
e0771e50f1
commit
be271e7d48
2 changed files with 13 additions and 0 deletions
|
@ -249,6 +249,18 @@ int QMLManager::getProductIndex()
|
||||||
return -1;
|
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()
|
void QMLManager::finishSetup()
|
||||||
{
|
{
|
||||||
// Initialize cloud credentials.
|
// Initialize cloud credentials.
|
||||||
|
|
|
@ -121,6 +121,7 @@ public:
|
||||||
Q_INVOKABLE QStringList getDCListFromVendor(const QString& vendor);
|
Q_INVOKABLE QStringList getDCListFromVendor(const QString& vendor);
|
||||||
Q_INVOKABLE int getVendorIndex();
|
Q_INVOKABLE int getVendorIndex();
|
||||||
Q_INVOKABLE int getProductIndex();
|
Q_INVOKABLE int getProductIndex();
|
||||||
|
Q_INVOKABLE QString getBtAddress();
|
||||||
#if BT_SUPPORT
|
#if BT_SUPPORT
|
||||||
void btDeviceDiscovered(const QBluetoothDeviceInfo &device);
|
void btDeviceDiscovered(const QBluetoothDeviceInfo &device);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue