summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/osx/osxbtutility_p.h
diff options
context:
space:
mode:
authorTimur Pocheptsov <Timur.Pocheptsov@digia.com>2014-09-04 10:23:05 +0200
committerTimur Pocheptsov <Timur.Pocheptsov@digia.com>2014-09-16 15:27:09 +0200
commitdc34c7aae7d4d641f4d06990141c7915542363ee (patch)
treec0245f807242b904ba44f5268d3551938cb4e5f8 /src/bluetooth/osx/osxbtutility_p.h
parent982eeb3547f85dc76e5864559ee56db74a7dd86f (diff)
Port QBluetoothServiceInfo and QBluetoothServiceDiscoveryAgent to OS X.
QBluetoothServiceInfo and QBluetoothServiceDiscoveryAgent - version for OS X (IOBluetooth-based). Update 0: initial dummy version + mods to enable this new classes to be built with qtconnectivity. Update 1: SDP query + initial implementation of a services discovery agent. Update 2: aux functions to "parse" a service records once I got it. Update 3: extract services UUIDs on a discovered device, if any. Update 4: refactor Update 5: "fix" asserts Update 6: more asserts fixed. Update 7: add the ability to stop SDP query (to be tested!!!) Update 8: mods as suggested in review. Update 9: no reason to check the size of discoveredDevices after 'clear' call. Update 10: set an error and error description only if it's a 'singleDevice'. Update 11: fix private header (_p suffix). Update 12: on 10.7 (with quite old clang) there is no 'subscript operator' syntax for NSDictionary. Change-Id: Ib3b07b49e3ed6381af75fb8b1e29cdf1e7a11237 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth/osx/osxbtutility_p.h')
-rw-r--r--src/bluetooth/osx/osxbtutility_p.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/bluetooth/osx/osxbtutility_p.h b/src/bluetooth/osx/osxbtutility_p.h
index cf267fc9..126b53d8 100644
--- a/src/bluetooth/osx/osxbtutility_p.h
+++ b/src/bluetooth/osx/osxbtutility_p.h
@@ -49,8 +49,12 @@
#include <Foundation/Foundation.h>
#include <IOBluetooth/Bluetooth.h>
+@class IOBluetoothSDPUUID;
+
QT_BEGIN_NAMESPACE
+class QBluetoothUuid;
+
namespace OSXBluetooth {
struct NSObjectDeleter {
@@ -67,7 +71,17 @@ public:
explicit ObjCScopedPointer(T *ptr = Q_NULLPTR) : QScopedPointer(ptr){}
operator T*() const
{
- return static_cast<T *>(this->data());
+ return data();
+ }
+
+ T *data()const
+ {
+ return static_cast<T *>(QScopedPointer::data());
+ }
+
+ T *take()
+ {
+ return static_cast<T *>(QScopedPointer::take());
}
};
@@ -135,10 +149,13 @@ private:
T *m_ptr;
};
-QString qt_bt_address(NSString *address);
-class QBluetoothAddress qt_bt_address(const BluetoothDeviceAddress *address);
+QString qt_address(NSString *address);
+class QBluetoothAddress qt_address(const BluetoothDeviceAddress *address);
BluetoothDeviceAddress iobluetooth_address(const QBluetoothAddress &address);
+ObjCStrongReference<IOBluetoothSDPUUID> iobluetooth_uuid(const QBluetoothUuid &uuid);
+QBluetoothUuid qt_uuid(IOBluetoothSDPUUID *uuid);
+
} // namespace OSXBluetooth
Q_DECLARE_LOGGING_CATEGORY(QT_BT_OSX)