summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qlowenergyservice_osx.mm
Commit message (Collapse)AuthorAgeFilesLines
* Add peripheral role (iOS/OS X).Timur Pocheptsov2016-03-131-1/+5
| | | | | | | | | 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>
* Bluetooth LE: Add support for Signed Write command in the central role.Christian Kandeler2016-02-171-7/+1
| | | | | | Task-number: QTBUG-41175 Change-Id: I62d74236faf9161681306d952e409e23e0cea24d Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Updated license headersAntti Kokko2016-01-201-15/+21
| | | | | | | | | | 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>
* [Bluetooth] Optimize loopsKonstantin Ritt2015-09-161-3/+7
| | | | | | | | | | | | Decrease complexity from O(N+N*logN) to just O(N) for cases like foreach (Key key, map.keys()) Value value = map.value(key); , by rewriting with use of iterators. Change-Id: I81f1334797f16b624293fcebdee885b2be3c89f1 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* A nano optimization to QLowEnergyServiceKonstantin Ritt2015-09-161-5/+4
| | | | | | | Rearrange condition to fail earlier for an invalid service object. Change-Id: I3ee0c611bab5610352ea4a058edd4af810212aaf Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Bluetooth LE - add readCharacteristic/readDescriptor (OS X/iOS)Timur Pocheptsov2015-04-201-2/+7
| | | | | | | Add read descriptor/characteristic support for iOS and OS X. Change-Id: If7547f3756dc37930052c9cefd243d6063bcab1c Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Always read/write the GATT hardware even if meta data reports otherwiseAlex Blasche2015-04-151-2/+2
| | | | | | | | | | | | | | | | It is possible that a ATT attribute is not readable or writable. Usually this is reported via descriptors or other types of meta data. However it is possible that the meta data is reporting the wrong information. Therefore we always ensure that every read and write request is forwarded to the hardware. It is up to the hardware to respond to such requests. This change keeps the device usable in cases of buggy device meta data. This only affected writeCharacteristic() calls. Change-Id: Ieb2b95f47aa51c86a8ae7c4bebed4043d7478874 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Emit OperationError if char or desc is not part of current serviceAlex Blasche2015-04-151-18/+4
| | | | | | | | So far, the OperationError was not set. This improves the error feedback to the user. Change-Id: I37eccb2419d6ede3b9bd4e94b9e0538182d1db7e Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Make new read(Descriptor/Characteristic)() API compile on OSX and iOSAlex Blasche2015-04-101-0/+30
| | | | | Change-Id: I19a1fd15a5cdc13b28f77fff02949a7895ddb0cb Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Update copyright headersJani Heikkinen2015-02-161-7/+7
| | | | | | | | | 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>
* Convert qRegisterMetaType<T>(const char*) to qRegisterMetaType<T>()Alex Blasche2015-01-281-2/+2
| | | | | | | | | | | | | | | This is much safer and cleaner. [ChangeLog][QtBluetooth][Important Behavior Changes] Q_DECLARE_METATYPE added for QBluetoothServiceDiscoveryAgent::Error, QBluetoothSocket::SocketState, QBluetoothSocket::SocketError and QBluetoothDeviceInfo. This breaks source compatibility if application code has defined the above metatypes already. The applications Q_DECLARE_METATYPE must be removed to fix the compile error. Change-Id: I1c7cb1ee25832b7e5337c9aca6f36b21e8caf22e Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* QLowEnergyController - bug fixes (OS X, iOS)Timur Pocheptsov2014-12-081-9/+4
| | | | | | | | | | | | | | | | | | | | | | 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>
* QLowEnergyService - ClientCharacteristicConfigurationTimur Pocheptsov2014-12-031-1/+3
| | | | | | | | | 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-011-1/+3
| | | | | | | | | | 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-011-2/+24
| | | | | | | Core Bluetooth - based implementation. Change-Id: Ie642a13ae9a4d75401dd10648fac6eeee4123a3b Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* QLowEnergyService::writeCharacteristic - implementation for OS X and iOSTimur Pocheptsov2014-11-261-15/+118
| | | | | | | writeCharacteristic - implemented with Core Bluetooth for OS X and iOS. Change-Id: Ia228ff451e1e6d7b6fb7de6cad29198aa9257602 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* QLowEnergyController - version for OS X and iOSTimur Pocheptsov2014-11-121-0/+125
QLowEnergyController/Private for OS X and iOS. This patch contains dummy empty classes required. While LE controller is not fully implemented, I have to disable (marking as insignificant) auto test on this class, otherwise changing the (empty) class to pass the test adds more problem. Change-Id: I54f764f7f6468b1acf58e80555ae454922de9f3b Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>