diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-07-18 14:49:42 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-19 06:21:23 -0700 |
commit | a38d440d5ea525c0b93d58668da0f8e65f0e76ea (patch) | |
tree | f77761f6c55f3ce74441b9fef1d5455ddd8b980a /core | |
parent | 526da269cc59f55a96f8819cb71265649727f0e0 (diff) | |
download | subsurface-a38d440d5ea525c0b93d58668da0f8e65f0e76ea.tar.gz |
BLE discovery: give the agent some time
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core')
-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 { |