summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/lowenergyscanner/deviceinfo.cpp
diff options
context:
space:
mode:
authorTimur Pocheptsov <Timur.Pocheptsov@digia.com>2014-12-05 10:58:47 +0100
committerTimur Pocheptsov <Timur.Pocheptsov@digia.com>2014-12-05 14:20:32 +0100
commit228b54c723a2f05e493eab6b67dece29ab7de687 (patch)
tree9a00eaedc9994a4e41b55a1a1b9f346efdb75624 /examples/bluetooth/lowenergyscanner/deviceinfo.cpp
parent3ff29159e8ca3deb2705aea92f673e0ea51c2aaa (diff)
Bluetooth example - lowenergyscanner (OS X and iOS)
Core Bluetooth hides addresses and uses unique UUIDs instead. This patch updates/adjusts lowenergyscanner example to work with UUIDs on iOS and OS X instead of (empty on these platforms) device addresses. Change-Id: Iad0b35250f434b736616fe60e356f2088e6dc279 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'examples/bluetooth/lowenergyscanner/deviceinfo.cpp')
-rw-r--r--examples/bluetooth/lowenergyscanner/deviceinfo.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/bluetooth/lowenergyscanner/deviceinfo.cpp b/examples/bluetooth/lowenergyscanner/deviceinfo.cpp
index d6b7a734..d774cb22 100644
--- a/examples/bluetooth/lowenergyscanner/deviceinfo.cpp
+++ b/examples/bluetooth/lowenergyscanner/deviceinfo.cpp
@@ -39,6 +39,8 @@
**
****************************************************************************/
+#include <qbluetoothuuid.h>
+
#include "deviceinfo.h"
DeviceInfo::DeviceInfo()
@@ -52,7 +54,13 @@ DeviceInfo::DeviceInfo(const QBluetoothDeviceInfo &d)
QString DeviceInfo::getAddress() const
{
+#ifdef Q_OS_MAC
+ // On OS X and iOS we do not have addresses,
+ // only unique UUIDs generated by Core Bluetooth.
+ return device.deviceUuid().toString();
+#else
return device.address().toString();
+#endif
}
QString DeviceInfo::getName() const