summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/btdiscovery.cpp10
-rw-r--r--core/btdiscovery.h3
2 files changed, 12 insertions, 1 deletions
diff --git a/core/btdiscovery.cpp b/core/btdiscovery.cpp
index 51cf61b20..88d1cd588 100644
--- a/core/btdiscovery.cpp
+++ b/core/btdiscovery.cpp
@@ -91,6 +91,7 @@ bool matchesKnownDiveComputerNames(QString btName)
}
BTDiscovery::BTDiscovery(QObject*) : m_btValid(false),
+ m_showNonDiveComputers(false),
discoveryAgent(nullptr)
{
if (m_instance) {
@@ -104,6 +105,11 @@ BTDiscovery::BTDiscovery(QObject*) : m_btValid(false),
#endif
}
+void BTDiscovery::showNonDiveComputers(bool show)
+{
+ m_showNonDiveComputers = show;
+}
+
void BTDiscovery::BTDiscoveryReDiscover()
{
#if !defined(Q_OS_IOS)
@@ -232,7 +238,9 @@ void BTDiscovery::btDeviceDiscoveredMain(const btPairedDevice &device)
connectionListModel.addAddress(newDevice + " " + device.address);
return;
}
- connectionListModel.addAddress(device.address);
+ // Do we want only devices we recognize as dive computers?
+ if (m_showNonDiveComputers)
+ connectionListModel.addAddress(device.address);
qDebug() << "Not recognized as dive computer";
}
diff --git a/core/btdiscovery.h b/core/btdiscovery.h
index 060f2c705..d6c25d8b0 100644
--- a/core/btdiscovery.h
+++ b/core/btdiscovery.h
@@ -46,6 +46,8 @@ public:
void btDeviceDiscovered(const QBluetoothDeviceInfo &device);
void btDeviceDiscoveredMain(const btPairedDevice &device);
bool btAvailable() const;
+ void showNonDiveComputers(bool show);
+
#if defined(Q_OS_ANDROID)
void getBluetoothDevices();
#endif
@@ -57,6 +59,7 @@ public:
private:
static BTDiscovery *m_instance;
bool m_btValid;
+ bool m_showNonDiveComputers;
QList<struct btVendorProduct> btDCs; // recognized DCs
QList<struct btVendorProduct> btAllDevices; // all paired BT stuff