summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
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)