summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/heartlistener/heartrate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/bluetooth/heartlistener/heartrate.cpp')
-rw-r--r--examples/bluetooth/heartlistener/heartrate.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/examples/bluetooth/heartlistener/heartrate.cpp b/examples/bluetooth/heartlistener/heartrate.cpp
index 91fe41c1..b4496925 100644
--- a/examples/bluetooth/heartlistener/heartrate.cpp
+++ b/examples/bluetooth/heartlistener/heartrate.cpp
@@ -1,8 +1,8 @@
/***************************************************************************
**
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the examples of the QtBluetooth module of the Qt Toolkit.
**
@@ -18,8 +18,8 @@
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
@@ -152,8 +152,15 @@ 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
connect(m_control, SIGNAL(serviceDiscovered(QBluetoothUuid)),
this, SLOT(serviceDiscovered(QBluetoothUuid)));
connect(m_control, SIGNAL(discoveryFinished()),