summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/lowenergyscanner
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2016-12-07 08:58:09 +0100
committerAlex Blasche <alexander.blasche@qt.io>2016-12-07 08:03:48 +0000
commit1750983d3f053316c735d602c7f9a1b56dc4462b (patch)
tree535083208486ebde5d2e4e7ec317b5daa160f39d /examples/bluetooth/lowenergyscanner
parentd7eda19aaf1c346cfd60b52da26fea6001fc35bd (diff)
Restrict the BTLE examples to Low Energy use cases
This change vastely descreases the search time. There is no need to perform a traditional SDP scan too. Change-Id: I63d7e16dca77fb1b1db42bb330f91e917a9dd054 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'examples/bluetooth/lowenergyscanner')
-rw-r--r--examples/bluetooth/lowenergyscanner/device.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/bluetooth/lowenergyscanner/device.cpp b/examples/bluetooth/lowenergyscanner/device.cpp
index 5ef2cf76..28a051f5 100644
--- a/examples/bluetooth/lowenergyscanner/device.cpp
+++ b/examples/bluetooth/lowenergyscanner/device.cpp
@@ -54,6 +54,7 @@ Device::Device():
{
//! [les-devicediscovery-1]
discoveryAgent = new QBluetoothDeviceDiscoveryAgent();
+ discoveryAgent->setLowEnergyDiscoveryTimeout(5000);
connect(discoveryAgent, SIGNAL(deviceDiscovered(const QBluetoothDeviceInfo&)),
this, SLOT(addDevice(const QBluetoothDeviceInfo&)));
connect(discoveryAgent, SIGNAL(error(QBluetoothDeviceDiscoveryAgent::Error)),
@@ -84,7 +85,7 @@ void Device::startDeviceDiscovery()
setUpdate("Scanning for devices ...");
//! [les-devicediscovery-2]
- discoveryAgent->start();
+ discoveryAgent->start(QBluetoothDeviceDiscoveryAgent::LowEnergyMethod);
//! [les-devicediscovery-2]
if (discoveryAgent->isActive()) {