diff options
Diffstat (limited to 'core/btdiscovery.cpp')
-rw-r--r-- | core/btdiscovery.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/btdiscovery.cpp b/core/btdiscovery.cpp index 914d71861..e1893713d 100644 --- a/core/btdiscovery.cpp +++ b/core/btdiscovery.cpp @@ -3,6 +3,7 @@ #include "btdiscovery.h" #include "downloadfromdcthread.h" #include "core/libdivecomputer.h" +#include <QTimer> #include <QDebug> extern QMap<QString, dc_descriptor_t *> descriptorLookup; @@ -128,8 +129,11 @@ BTDiscovery::BTDiscovery(QObject *parent) for (int i = 0; i < btPairedDevices.length(); i++) { qDebug() << "Paired =" << btPairedDevices[i].name << btPairedDevices[i].address; } -#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) - discoveryAgent->stop(); +#if defined(Q_OS_IOS) || (defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)) + QTimer timer; + timer.setSingleShot(true); + connect(&timer, &QTimer::timeout, discoveryAgent, &QBluetoothDeviceDiscoveryAgent::stop); + timer.start(3000); #endif #if !defined(Q_OS_IOS) } else { |