summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/heartlistener/deviceinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/bluetooth/heartlistener/deviceinfo.cpp')
-rw-r--r--examples/bluetooth/heartlistener/deviceinfo.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/examples/bluetooth/heartlistener/deviceinfo.cpp b/examples/bluetooth/heartlistener/deviceinfo.cpp
index 5be9fcfe..cfddf56d 100644
--- a/examples/bluetooth/heartlistener/deviceinfo.cpp
+++ b/examples/bluetooth/heartlistener/deviceinfo.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.
**
**
@@ -39,6 +39,8 @@
**
****************************************************************************/
+#include <qbluetoothuuid.h>
+
#include "deviceinfo.h"
DeviceInfo::DeviceInfo(const QBluetoothDeviceInfo &info):
@@ -51,6 +53,16 @@ QBluetoothDeviceInfo DeviceInfo::getDevice() const
return m_device;
}
+QString DeviceInfo::getAddress() const
+{
+#ifdef Q_OS_MAC
+ // workaround for Core Bluetooth:
+ return m_device.deviceUuid().toString();
+#else
+ return m_device.address().toString();
+#endif
+}
+
void DeviceInfo::setDevice(const QBluetoothDeviceInfo &device)
{
m_device = device;