From a38d440d5ea525c0b93d58668da0f8e65f0e76ea Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 18 Jul 2017 14:49:42 -0700 Subject: BLE discovery: give the agent some time Signed-off-by: Dirk Hohndel --- core/btdiscovery.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'core/btdiscovery.cpp') 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 #include extern QMap 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 { -- cgit v1.2.3-70-g09d2