summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/osx
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | QtBluetooth: remove outdate code (OS X/iOS)Timur Pocheptsov2016-06-023-158/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we now have OS X 10.9 and iOS 7.0 as the minimal required (SDK and deployment target) - get rid of outdated code-branches in _SDK_EQUAL_OR_ABOVE etc. Change-Id: I5f546e8bb746f6b94f26a40460b3caa0af6a531c Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | | Merge remote-tracking branch 'gerrit/dev' into btleAlex Blasche2016-05-271-4/+8
|\| | | | | | | | | | | | | | | Change-Id: I533ed177193b4c7a9a1b6110612103e40a24a597
| * | | QtBluetooth (BTLE) - fix build on tvOSTimur Pocheptsov2016-05-231-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CoreBluetooth for tvOS does not support peripheral role. Change-Id: I82e7a61abfd907ea53faf33264951727f3cbe5a2 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | | Merge branch 'dev' into btleAlex Blasche2016-05-1334-843/+2291
|\| | | | | | | | | | | | | | | Change-Id: I073f6c45696fe28b83335fb65cca6270c458851d
| * | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-04-081-1/+1
| |\| | | | | | | | | | | | | | Change-Id: I858ee0b39b7a488f08fc045635d2a39053f32d99
| | * | Merge remote-tracking branch 'origin/5.6' into 5.7v5.7.0-beta1Liang Qi2016-04-081-1/+1
| | |\| | | | | | | | | | | | | Change-Id: I77d7b5877ce36057c3882a0b397ff27d5c35ad53
| | | * OSXBTCentralManager - fix details discovery (iOS/OS X)Timur Pocheptsov2016-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -serviceForUUID: fails to find included service and returns a nil for a valid service previously discovered. Task-number: QTBUG-52324 Change-Id: I9f4f8b1f3d3a78879344ace0170e23c03921d648 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | | Add peripheral role (iOS/OS X).Timur Pocheptsov2016-03-138-39/+977
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | CoreBluetooth has CBPeripheralManager/CBMutableService both on iOS (since 6.0) and OS X (>= 10.9). This lets me implement the Qt's BTLE 'advertisement' API and peripheral role for both iOS and OS X. Change-Id: I3e69a5870535a45bc16bbd9862ca84300b01daca Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
| * | Updated license headersAntti Kokko2016-01-2030-420/+600
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I856c13e2a6d4d12c46e1286b0ca1c092ee4608f8 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * | Merge remote-tracking branch 'gerrit/5.6' into devAlex Blasche2016-01-052-3/+1
| |\| | | | | | | | | | Change-Id: I97b51eb3fe2040711c00da67bbb1954fc2e65c1f
| | * Remove yet another implementation of AutoreleasePool's RAIITimur Pocheptsov2016-01-051-2/+1
| | | | | | | | | | | | | | | | | | | | | Now we have this class in QtCore, no need in my "home-made" version anymore. Change-Id: Id26944dd6970cc2a8ac9d02675f8af9adecc3d44 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| | * Fix namespaced build on OSX.Erik Verbruggen2015-12-231-2/+2
| | | | | | | | | | | | | | | Change-Id: I0baa4bbbc5d398f388a1e0aff9ba88f82a23c1cc Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * | tvOS supportMike Krus2016-01-051-2/+2
| |/ | | | | | | | | | | | | | | | | | | Builds but not tested Moved Q_DECLARE_METATYPE outside of namespace to fix namespaced builds Change-Id: I19c1dba904da8fad155f0f612b863e8f5e0c422e Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Add "we mean it header statement" to osx private headerAlex Blasche2015-12-151-0/+11
| | | | | | | | | | Change-Id: I4005833edebd10b778ac06ded49a88e633e5f435 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
| * qlowenergycontroller_osx - move delegate to the qt_LE_queueTimur Pocheptsov2015-12-105-245/+344
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ATM CBCentralManager's delegate does its work on the main queue. With CoreFoundation event dispatcher it's now possible to use QtBluetooth from non-gui thread (more generally - from a thread other than main). This makes main queue useless - and we have to move to a dedicated dispatch queue. Also, we have to make sure we do not have race conditioins/dead-locks. This patch: 1. decouples OSXBTLECentralManager and QLowEnergyController so that these two objects working (potentially) on different threads do not share any data and do not have to use locks, removes the explicit 'delegate' interface/inheritance and replaces them with LECentralNotifier class - to be able to use Qt's signal/slot mechanics for inter-thread communication. 2. all OSXBTLECentralManager's are now executed on qt_LE_queue queue to avoid any race-conditions (since they potentially update manager's internal state). 3. Results/errors are now reported using LECentralNotifier's object (QLowEnergyController has corresponding slots connected to the notifier) Task-number: QTBUG-49476 Change-Id: Ie07cdc13ad559c96a7d2ff010843fb7bcce07c99 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Bluetooth LE scan - move to its own dispatch queue (iOS/OS X)Timur Pocheptsov2015-11-274-219/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | Move CBCentralManager's delegate to its own dispatch queue, not the main one, so that even if somebody _blocks_ the main thread somehow, waiting for discovery to finish, the discovery can, indeed, finish. Also, make DDA aware of the fact that now actual scan and 'this' are working on different threads, thus we must be thread-safe. Task-number: QTBUG-49476 Change-Id: I9bcc74131f51389c8a014577c65e0943bbc8da42 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * CoreBluetooth - simplify osxbledeviceinquiry's code.Timur Pocheptsov2015-10-292-42/+43
| | | | | | | | | | | | | | | | Replace pendingStart and isActive + all places they have to be modified with scanPhase and enum {startingScan, activeScan, noActivity}. Change-Id: I29edff3b99fc877d0d52a5974aa64c9ff2faa584 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Core Bluetooth - give a user the second chance to enable BluetoothTimur Pocheptsov2015-10-291-11/+52
| | | | | | | | | | | | | | | | | | | | | | On iOS when we receive centralManagerDidUpdateState with the state == PoweredOff, iOS also shows an alert on screen, asking to enable Bluetooth via the "Settings" app. If we do not report an error and a user indeed enables BT, we can continue to work. Change-Id: Ic1f63f205b56fc356bc7fa645359b583c00195a6 Task-number: QTBUG-48713 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-0914-0/+154
| | | | | | | | | | Change-Id: I4e78a2b263fb779253556201fd20fe47a2afc58e Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * CoreBluetooth - update for iOS 9.0Timur Pocheptsov2015-10-082-10/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | New SDK removed deprecated properties/methods and we have a compilation error as a result. Use performSelector instead of direct calls to make sure: 1. it compiles 2. it calls an existing method. Task-number:QTBUG-48518 Change-Id: I10a2d062f9e71229a1e218d9d167a4132b97b6ab Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Merge remote-tracking branch 'gerrit/dev' into btleAlex Blasche2015-06-0132-979/+2823
|\| | | | | | | | | | | | | | | Conflicts: src/bluetooth/osx/osxbtdeviceinquiry.mm src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm Change-Id: Iaba26c6affe194eafbb666c7474b566d4980298b
| * Bluetooth LE - add readCharacteristic/readDescriptor (OS X/iOS)Timur Pocheptsov2015-04-202-64/+219
| | | | | | | | | | | | | | Add read descriptor/characteristic support for iOS and OS X. Change-Id: If7547f3756dc37930052c9cefd243d6063bcab1c Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Bluetooth device discovery agent - minor cleanup (OS X)Timur Pocheptsov2015-03-241-1/+0
| | | | | | | | | | | | | | Use d_ptr; test inquiryLE in 'isValid' also (just to be consistent). Change-Id: If5a8977cfc7adfb06150a2bf8a2e14d0613e26c7 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Bluetooth - LE device discovery agent, timer bug (OS X)Timur Pocheptsov2015-03-243-13/+26
| | | | | | | | | | | | | | | | | | | | | | | | CBCentralManager does not have a timeout while scanning and we had to use a delayed selector (via performSelector) to interrupt the scan. This is a bug in the case we're in NSModalPanelRunLoopMode mode (for example) - selector never gets performed (it waits for the default mode) or performed too late. Found in our btchat example. Now we use external QTimer instead to check if it's time to stop a scan. Change-Id: I159bf5821398f3aa76f03a52a8334dea97cbf688 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Shift all OSX & iOS translations into C++ filev5.5.0-alpha1Alex Blasche2015-03-063-0/+176
| | | | | | | | | | | | | | | | | | | | | | lupdate cannot parse .mm files. Therefore tr markup must be inside of C++ files. Some error strings where slightly modified to make use of already existing translations for other backends such as Bluez and QNX. Change-Id: I97fe6cfe2227e32fdbc61edd253080a1cd68edc9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| * Update copyright headersJani Heikkinen2015-02-1627-567/+367
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I3822a6484e8f7a420330de1cb1aeb0c3d1cf41b7 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
| * Bluetooth - check OS X version in runtimeTimur Pocheptsov2015-02-061-2/+6
| | | | | | | | | | | | | | | | Add OS X version check, compile time check is not enough if Qt is built for older versions. Change-Id: Ieebd3f05f0fd9942516ea1d9b40ee929905cb799 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Bluetooth - runtime OS X/iOS version checkTimur Pocheptsov2015-02-061-15/+14
| | | | | | | | | | | | | | Add runtime checks, compile time is not enough. Change-Id: I1821c9718d4e4af1e2d7989bd1ee7a1f11d5c051 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Qt Bluetooth - add runtime OS version check (OS X, iOS)Timur Pocheptsov2015-02-062-25/+41
| | | | | | | | | | | | | | | | Compile time check of SDK version is not sufficient if Qt is build for older device. Change-Id: I0e4d0baf903c6291e67462890107b0e5cc30e7c4 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * QBluetoothTransferReply - cleanup (OS X)Timur Pocheptsov2014-12-182-54/+43
| | | | | | | | | | | | | | Q_FUNC_INFO in messages/(Q)asserts. Change-Id: I12285bf97ac766964b656090980858f3fd5de2da Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Bluetooth socket listener (OS X)Timur Pocheptsov2014-12-181-14/+6
| | | | | | | | | | | | | | Replace handwritten function names with Q_FUNC_INFO. Change-Id: Ia12728eb53dc63ac1ca0d2a76bbf2baa06db0ea0 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * QBluetoothSocket - cleanup (OS X)Timur Pocheptsov2014-12-184-73/+49
| | | | | | | | | | | | | | Use Q_FUNC_INFO instead of handwritten 'signatures' in asserts/messages. Change-Id: I639b4293b86120ddc260d3c9e85fd50340afbf60 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * QBluetoothServiceInfo - cleanup (OS X)Timur Pocheptsov2014-12-181-33/+17
| | | | | | | | | | | | | | Use Q_FUNC_INFO in asserts/messages. Change-Id: Ie766016a36c3cc47d4561a74ed8bf179357a19df Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * QBluetoothServiceDiscoveryAgent - cleanup (OS X)Timur Pocheptsov2014-12-183-26/+11
| | | | | | | | | | | | | | Use Q_FUNC_INFO in asserts/messages. Change-Id: I2d9429cff0b1cd5d28a04fe50328289a891d04f5 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * QBluetoothDeviceDiscoveryAgent - cleanup (OS X/iOS)Timur Pocheptsov2014-12-186-216/+41
| | | | | | | | | | | | | | | | Replace handwritten 'signatures' with Q_FUNC_INFO, remove spurious debug messages. Get rid of 'transient delegate' trick. Change-Id: I2c490271baba7247af11df128964b61d0255ef95 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * QBluetoothLocalDevice - cleanup (OS X)Timur Pocheptsov2014-12-182-24/+14
| | | | | | | | | | | | | | Replace hand-written 'function signatures' with Q_FUNC_INFO. Change-Id: I0c05d9fa76d120b5626420cadafb1a9fe1227b95 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * QLowEnergyController/CentralManager - cleanup (OS X/iOS)Timur Pocheptsov2014-12-092-202/+121
| | | | | | | | | | | | | | | | | | Get rid of all 'hand-written' function/method signatures in qCWarnings and Q_ASSERTS, use Q_FUNC_INFO instead. Fix error function for characteristic/descriptor write errors - remove unused parameter. Change-Id: I4f3f7c6c6a06802135f47a4b5cbb7c4313af4f34 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * QLowEnergyConttroller - char/descriptor values (OS X/iOS)Timur Pocheptsov2014-12-082-82/+108
| | | | | | | | | | | | | | | | | | | | | | | | While writing with response, Core Bluetooth does not update characteristic/descriptor values in write notifications. I have to 'cache' this values and report them back. Also this patch fixes minor bugs in '-performNextWriteRequest': while handling errors it's not enough just to call 'performNextWriteRequest:' again, it must be in return statement or followed by 'return'. Change-Id: I6e7ab7fe6f63ea84268bf6c7ea67e2939d524f91 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * QLowEnergyController - bug fixes (OS X, iOS)Timur Pocheptsov2014-12-081-12/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several problems found by qlowenergycontroller auto test: - Core Bluetooth in its didWriteCharacteristicValue callback does not have this new updated value, but the old one, to avoid additional characteristic read I have to cache this value in writeCharacteristic and report it later from the callback as it's already done for client characteristic configuration. - writeDescriptor with state != ServiceDiscovered (can happen after disconnectFromDevice) should set an error. - setNotifyValue did not check that value has the wrong length ( > 2 bytes) - this also should be an error. - Fix a key mismatch - in setNotifyValue remember descrptor's handle, not the characteristic's handle. - Remove annoying qCWarnings from didUpdateNotifyValue - it happens very often that we set this value in 'automatic' mode, without 'writeDescriptor' request. Change-Id: If3955f0e1364587b96403d23f2f8da28e6723e87 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * QLowEnergyController - remove debug messages (OS X, iOS)Timur Pocheptsov2014-12-051-3/+0
| | | | | | | | | | | | | | Remove debug messages from OSXBTCentralManager. Change-Id: I980ffac49453b670fa93d4ddfb0e621e29dff4f3 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * QBluetoothDeviceDiscoveryAgent - timeout on OS X/iOSTimur Pocheptsov2014-12-051-1/+1
| | | | | | | | | | | | | | | | On OS X we have to first make Classic device scan and then LE device scan. Shorten Classic discovery from 20s to 15s. Change-Id: I653b2d9f6c911bdf09c900735273bd6d1e95b078 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Client characteristic configuration (OS X and iOS)Timur Pocheptsov2014-12-051-0/+5
| | | | | | | | | | | | | | | | If client characteristic configuration descriptor has an indication/notification bit set - enable ("automatically" == no explicit user's request) notifications. Change-Id: I839aabd6f5513141f66c8e4467618b3edd523350 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Low energy descriptor - value on iOSTimur Pocheptsov2014-12-042-0/+59
| | | | | | | | | | | | | | | | On OS X CBDescriptor's value is always NSData, on iOS it can be NSData, NSString, NSNumber. Change-Id: I6ffa4b813238ec26759508a012fa6e236db04c63 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * QLowEnergyController/Service - enable for iOSTimur Pocheptsov2014-12-031-2/+4
| | | | | | | | | | | | | | Enable Core Bluetooth-based version for iOS. Change-Id: Ica13fdc6c01744713483771e7c8ad6153c9fccdf Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * QLowEnergyService - ClientCharacteristicConfigurationTimur Pocheptsov2014-12-032-19/+186
| | | | | | | | | | | | | | | | | | Core Bluetooth has a special method to enable/disable char update notifications and even more - Core Bluetooth does not allow to use writeValue:forDescriptor: with ClientCharacteristicConfiguration - that's why need this 'workaround'. Change-Id: I4a01690a76aabf62397321ca6ba22c4abb1c420c Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * QLowEnergyController - concurrent characteristic writesTimur Pocheptsov2014-12-012-11/+58
| | | | | | | | | | | | | | | | | | | | Qt's API assumes that several write operations must be serialized (this is not guaranteed with Core Bluetooth AFAIK). I can enqueu only write with response operations, otherwise I never know when to do the next write. Change-Id: Iaa83514748358437e2c39335ab142d084ff197e3 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * QLowEnergyController - writeDescriptor (OS X/iOS)Timur Pocheptsov2014-12-012-12/+132
| | | | | | | | | | | | | | Core Bluetooth - based implementation. Change-Id: Ie642a13ae9a4d75401dd10648fac6eeee4123a3b Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Bluetooth LE - handles/chars/descriptors/services (OS X and iOS)Timur Pocheptsov2014-12-012-60/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | In Qt we work with handles (real for Bluez, emulated for Android/iOS/OS X). Core Bluetooth has its own (quite primitive and inconvenient) data structures (arrays of objects, containing nested arrays). To make things not so ugly I'm adding several maps to be able to find a characteristic/descriptor/service using a handle from Qt's layer. Also modify writeCharacteristic to use this new 'addressing scheme'. Change-Id: Ic822c9aa82a4df1e9c4cf4c673451cac8006b9ba Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * QLowEnergyService::writeCharacteristic - implementation for OS X and iOSTimur Pocheptsov2014-11-264-0/+139
| | | | | | | | | | | | | | writeCharacteristic - implemented with Core Bluetooth for OS X and iOS. Change-Id: Ia228ff451e1e6d7b6fb7de6cad29198aa9257602 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * QLowEnergyController - service details discovery (OS X and iOS)Timur Pocheptsov2014-11-254-10/+483
| | | | | | | | | | | | | | | | | | | | Implement details discovery: characteristics, their values (if any), descriptors. We have to emulate handles (QLowEnergyHandle) - while Core Bluetooth internally has the notion of handles, it never exposes them as a public API. Change-Id: I09158433ce6835dd34fe8ad47d047212dab59e8e Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>