diff options
author | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-10-15 17:15:23 +0200 |
---|---|---|
committer | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-11-06 16:25:43 +0100 |
commit | f98a81839db4f3932038b4aded73782641958672 (patch) | |
tree | 886822f3216595b6f1b54cd91fbb35e1b3709cd8 /src/bluetooth/osx/osxbtutility_p.h | |
parent | c7a1622d1f76bc61f0d5bb524d3eb40501cab13b (diff) |
Bluetooth LE - device discovery for OS X.
- Unfortunately IOBluetoothDeviceInquiry does not scan for LE devices,
so I need a separate scan for OS X and iOS imeplemented with CoreBluetooth
framework.
- CoreBluetooth hides addresses - "think different" in action. So we'll
have to use 'identifiers' (NSUUID actually) provided by CoreBluetooth instead
and we'll have to ask CBCentralManager to retrieve peripheral with a given
NSUUID (or however we encode it).
- Inform a delegate about LE device discovered.
- Add the second scan/pass (Bluetooth LE) in QBluetoothDeviceDiscoveryAgent.
- Make it all more "protocol conformant"
- Do a proper cleanup + fix auto-test failure
- Make a device inquiry longer + remove totally useless (??) 'name update'.
- Use a plain bool instead of IOReturn (no this type(??) on iOS).
- CoreBluetooth provides enumerators to check if LE is supported or not,
no need to manipulate with StatePowerOn and other flags.
- Add a workaround for a broken SDK (10.9 + CoreBluetooth headers + c++11).
NSUUID is quite new - added in 10.8/6.0, works only on 10.9 and 7.0 (works ==
there is required interface).
- CBCentralManager: it looks like it's impossible to delete an object of this type
before centralDidUpdateStatus was called - this is not good, since a C++ object
(the owner) can be deleted at any point - some preliminary workaround is to
create a temporary delegate and pass the ownership from the dealloc. To be
investigated/tested.
- Move the TransientCentralManagerDelegate into the separate file - it'll
be reused in future by other users of CBCentralManager.
Change-Id: I4434c23366618061029be4022cfa0f7647df45b9
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.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/bluetooth/osx/osxbtutility_p.h b/src/bluetooth/osx/osxbtutility_p.h index cad84b7e..c2a48e5f 100644 --- a/src/bluetooth/osx/osxbtutility_p.h +++ b/src/bluetooth/osx/osxbtutility_p.h @@ -47,11 +47,20 @@ #include <QtCore/qglobal.h> #include <Foundation/Foundation.h> + +#ifndef QT_IOS_BLUETOOTH + #include <IOBluetooth/Bluetooth.h> #include <IOKit/IOReturn.h> @class IOBluetoothSDPUUID; +#else + +#include <CoreBluetooth/CoreBluetooth.h> + +#endif + QT_BEGIN_NAMESPACE class QBluetoothUuid; @@ -171,16 +180,21 @@ private: }; QString qt_address(NSString *address); + +#ifndef QT_IOS_BLUETOOTH + 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); - QString qt_error_string(IOReturn errorCode); +#endif + } // namespace OSXBluetooth +// Logging category for both OS X and iOS. Q_DECLARE_LOGGING_CATEGORY(QT_BT_OSX) QT_END_NAMESPACE |