mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	BLE discovery: give the agent some time
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									526da269cc
								
							
						
					
					
						commit
						a38d440d5e
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		|  | @ -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 { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue