summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-06-03 10:58:32 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-06-03 10:58:32 +0200
commit720118ea73431a0808f0c60dfec10f16fd85af7f (patch)
tree5505c3286c6a7330fe19f144c74a9a77b19751f2 /examples
parent9e70578b18eb7246f5d11dd2afdbea8bb1150768 (diff)
parente86249d3d08b5592c6a3d3d86e3119dd1436e816 (diff)
Merge remote-tracking branch 'origin/5.5' into dev
Diffstat (limited to 'examples')
-rw-r--r--examples/bluetooth/heartlistener/heartrate.cpp10
-rw-r--r--examples/bluetooth/lowenergyscanner/device.cpp11
2 files changed, 3 insertions, 18 deletions
diff --git a/examples/bluetooth/heartlistener/heartrate.cpp b/examples/bluetooth/heartlistener/heartrate.cpp
index b4496925..fe53a740 100644
--- a/examples/bluetooth/heartlistener/heartrate.cpp
+++ b/examples/bluetooth/heartlistener/heartrate.cpp
@@ -152,15 +152,7 @@ void HeartRate::connectToService(const QString &address)
}
//! [Connect signals]
-#ifdef Q_OS_MAC
- // with CoreBluetooth controller requires QBluetoothDeviceInfo to connect:
- m_control = new QLowEnergyController(m_currentDevice.getDevice(),
- this);
-
-#else
- m_control = new QLowEnergyController(m_currentDevice.getDevice().address(),
- this);
-#endif
+ m_control = new QLowEnergyController(m_currentDevice.getDevice(), this);
connect(m_control, SIGNAL(serviceDiscovered(QBluetoothUuid)),
this, SLOT(serviceDiscovered(QBluetoothUuid)));
connect(m_control, SIGNAL(discoveryFinished()),
diff --git a/examples/bluetooth/lowenergyscanner/device.cpp b/examples/bluetooth/lowenergyscanner/device.cpp
index a95bc48b..5ef2cf76 100644
--- a/examples/bluetooth/lowenergyscanner/device.cpp
+++ b/examples/bluetooth/lowenergyscanner/device.cpp
@@ -158,12 +158,7 @@ void Device::scanServices(const QString &address)
setUpdate("Back\n(Connecting to device...)");
-#ifdef Q_OS_MAC
if (controller && m_previousAddress != currentDevice.getAddress()) {
- m_previousAddress = currentDevice.getAddress();
-#else
- if (controller && controller->remoteAddress() != currentDevice.getDevice().address()) {
-#endif
controller->disconnectFromDevice();
delete controller;
controller = 0;
@@ -172,11 +167,7 @@ void Device::scanServices(const QString &address)
//! [les-controller-1]
if (!controller) {
// Connecting signals and slots for connecting to LE services.
-#ifdef Q_OS_MAC
controller = new QLowEnergyController(currentDevice.getDevice());
-#else
- controller = new QLowEnergyController(currentDevice.getDevice().address());
-#endif
connect(controller, SIGNAL(connected()),
this, SLOT(deviceConnected()));
connect(controller, SIGNAL(error(QLowEnergyController::Error)),
@@ -195,6 +186,8 @@ void Device::scanServices(const QString &address)
controller->setRemoteAddressType(QLowEnergyController::PublicAddress);
controller->connectToDevice();
//! [les-controller-1]
+
+ m_previousAddress = currentDevice.getAddress();
}
void Device::addLowEnergyService(const QBluetoothUuid &serviceUuid)