diff options
Diffstat (limited to 'examples/bluetooth/heartlistener/deviceinfo.cpp')
-rw-r--r-- | examples/bluetooth/heartlistener/deviceinfo.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/bluetooth/heartlistener/deviceinfo.cpp b/examples/bluetooth/heartlistener/deviceinfo.cpp index 5be9fcfe..0e832dff 100644 --- a/examples/bluetooth/heartlistener/deviceinfo.cpp +++ b/examples/bluetooth/heartlistener/deviceinfo.cpp @@ -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; |