summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qlowenergyservice.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Replace foreach with for loop and set QT_NO_FOREACHOliver Wolff2018-08-151-1/+1
| | | | | | | | To avoid unnecessary copies, const is used wherever possible. Change-Id: Ic743716512751cfd24fad5bd37c244b115dd26fe Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix typosJarek Kobus2018-02-141-1/+1
| | | | | Change-Id: I0a35d5584c2c4364c6987d9add5e66f996647403 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Convert most old-style QObject::connect() to pointer syntaxAlex Blasche2017-11-131-14/+14
| | | | | | | | The remaining cases (e.g. in QBluetoothServiceDiscoveryAgent) are connected to Q_PRIVATE_SLOT usage which requires a redesign. Change-Id: I9227b5459b81228a7aa2660193d5b984c036b74f Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Various cleanups following the recent QLEControllerPrivate header splitsAlex Blasche2017-11-031-1/+1
| | | | | Change-Id: Ia98a7a16c3e1e478d1c6e30d9e70dc703c1fe091 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Unify meta type registration for QLEDescriptor and QLECharacteristicAlex Blasche2017-11-031-2/+0
| | | | | | | | | The QLEControllerPrivate objects use the same function (apart from Apple platforms) and unit tests do not have to register those types at all anymore. Change-Id: I06a4a035f5a8fba9a146a3c05d1157b47c22e056 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Replace Q_NULLPTR with nullptrKevin Funk2017-09-291-4/+4
| | | | | Change-Id: Ica194c2568465a94d851ddeaf62ca71b33fe4464 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Register additional meta typesLars Schmertmann2017-03-301-0/+2
| | | | | | | | | | | | | | | Register QLowEnergyCharacteristic and QLowEnergyDescriptor as meta types because they are used in signals. [ChangeLog][QtBluetooth] Register QLowEnergyCharacteristic and QLowEnergyDescriptor as meta types. It is therefore necessary to declare them as meta types in the header files. This commit will cause conflicts with existing meta type declarations in applications using Qt. These declarations need to be removed. Change-Id: I18f33b1b2f159cffd6efbacc37178286b86a06e0 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Update the QLowEnergyService documentationAlex Blasche2016-12-061-10/+11
| | | | | | | | | | | | | | Improves the statements around the various signal emissions. It was not always clear which signal is emitted in peripheral mode. Removes a section from the characteristicWritten() docs that was misleading at best or entirely wrong at worst. The underlying use case is too theoretical anyway. Task-number: QTBUG-57315 Change-Id: I06e54918b83322822098a50442821a15576afcab Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Add missing \since 5.7 markers to QLE classesAlex Blasche2016-05-191-0/+1
| | | | | Change-Id: I60f7c4751cb2b1a298a22d2b6d44c1c07967e47c Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* Bluetooth LE: Add support for Signed Write command in the central role.Christian Kandeler2016-02-171-12/+14
| | | | | | Task-number: QTBUG-41175 Change-Id: I62d74236faf9161681306d952e409e23e0cea24d Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Merge remote-tracking branch 'gerrit/dev' into neardAlex Blasche2016-01-261-15/+21
|\ | | | | | | Change-Id: If9cf6718cbd619dd7ce38db2da274fe9d0a41fb7
| * 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>
* | Merge remote-tracking branch 'gerrit/dev' into neardAlex Blasche2015-12-221-4/+4
|\| | | | | | | Change-Id: I48826b6a83d8876b97095387cd329165a534eec2
| * Bluetooth: Documentation fix.v5.6.0-beta1Christian Kandeler2015-12-141-4/+4
| | | | | | | | | | Change-Id: I095fbdfff6ba753c5c9bfbf204b3ac70d8108376 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Bluetooth LE: Implement GATT server write support.Christian Kandeler2015-12-151-13/+60
|/ | | | | | | | | | Write Request, Write Command and Execute Write Request are fully implemented now. Signed Write support is still missing. Notifications and Indications are sent. The server side gets informed via the respective signals when a client writes a characteristic or descriptor. Change-Id: Icba6a0270f6e1c4c3ed2ba61b55c1a5fbb69752b Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Doc: minor link issuesNico Vertriest2015-10-301-1/+1
| | | | | | Change-Id: Ibd0da6662aca93d9ddd9d0a71b6ec81d983e2900 Task-number: QTBUG-43810 Reviewed-by: Topi Reiniƶ <topi.reinio@digia.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-12/+4
| | | | | | | Rearrange condition to fail earlier for an invalid service object. Change-Id: I3ee0c611bab5610352ea4a058edd4af810212aaf Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Add missing metatype registration related functions for Q_ENUMsOliver Wolff2015-07-101-0/+2
| | | | | Change-Id: Iedd83bb8f9d31268fb5a17879feaaf97a82f86cc Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Remove some Tech preview remnants from Bluetooth documentationAlex Blasche2015-05-181-3/+0
| | | | | Change-Id: Ifcae07ef5e046f45848495f4d6af973cde713fdf Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Misc fixes based on code review commentsAlex Blasche2015-04-151-3/+3
| | | | | | | - doc fixes Change-Id: I4a5f413672d30c53be0cfcb022953e8ba3da6a83 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Further improve QLEService class docs with regards to recent changes.Alex Blasche2015-04-151-16/+43
| | | | | Change-Id: Iba3ec93eb4ad1e6bca30f5ddffde2c80fcd25063 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Always read/write the GATT hardware even if meta data reports otherwiseAlex Blasche2015-04-151-11/+19
| | | | | | | | | | | | | | | | 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-22/+20
| | | | | | | | 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>
* Bluez: Implement QLES::readCharacteristic()/readDescriptor()Alex Blasche2015-04-151-2/+9
| | | | | Change-Id: I418db6ea375b8e29def136b28b4fc25154d4ffe8 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Minor doc fixesAlex Blasche2015-04-101-2/+2
| | | | | Change-Id: I8bf5a48b96fe27d66cd33adb0926591b2302bf8c Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Prevent characteristic write if service is not discoveredAlex Blasche2015-04-101-3/+2
| | | | | | | | Previously it was possible to issue the characteristic write request while the service was not discovered. Change-Id: Id370a2ae0f15860e28d1aee0624bdf13517e1e32 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Add ability to read characteristics and descriptorsAlex Blasche2015-04-101-1/+98
| | | | | | | This patch introduces the new API elements without any implementation. Change-Id: Ia2a4d4c588f2f2f219288967ed9cc69b13b682c6 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>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-12-171-1/+14
|\ | | | | | | | | | | | | | | Conflicts: .qmake.conf src/bluetooth/qlowenergyservice.cpp Change-Id: I4b0f68d35ea898819b7c8078b24d55ae90ee529c
| * Improve documentation for undiscovered QLEServiceAlex Blasche2014-12-011-1/+14
| | | | | | | | | | | | | | | | | | The class' behavior strongly deponds on its state. This can be confusing. This patch reduces the behavior uncertainties. Change-Id: Ib5cd8e821f2bb9aca5b579abf4ae98918f951f24 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Don't update cached char value when property is not readableAlex Blasche2014-12-041-0/+9
| | | | | | | | | | | | | | | | | | In addition we update the documentation to reflect the slightly changed API behavior. Change-Id: Ieddee750aa35a32d3c01213dfbf678ee2a1d88d7 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Update QLEService::Type() documentation for Android specificsAlex Blasche2014-12-011-0/+4
| | | | | | | | | | | | | | | | | | | | Android doesn't expose the required API elements to set the correct service type. Therefore all services are by definition primary services too. Change-Id: Ifae4a1baa856382d481ab377b98f05b5b9974a85 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Document and test concurrent write requestsAlex Blasche2014-11-141-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | BTLE communication is serialised. However the Qt API provides the ability to issue multiple write requests while the first is still pending. The backend must enqueue the requests for later on. This behavior was already indirectly tests by a unit test but this patch adds an explicit test section for it and documents the behavior. Change-Id: I089b52940820bf0ba9c3ec872a6f1d5d6bd78a0e Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Majority of service detail discovery code on AndroidAlex Blasche2014-11-101-0/+2
|/ | | | | | | | | | Primarily the change adds the required data structures and interfaces on the Java side. What is missing is the reporting of the discovery details back to Qt. Change-Id: I37f2e17bb0f87b4c526f1b43a933b9b09b22be72 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Make it more obvious that QLowEnergy* classes are Tech previewAlex Blasche2014-09-261-0/+3
| | | | | | | | Although no larger changes are expected the QLowEnergy* classes only provide a limited API commitment. Change-Id: I244403b8818c2b34a97c8d6f2633e4b94646e49b Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
* Add limitations to the API documentationAlex Blasche2014-09-081-0/+5
| | | | | | | | | These limitations are not expected to be fixed during Qt 5.4 release. They are tracked by QTBUG-41174 & QTBUG-41175 Change-Id: Ibc102e35fe5d459f424a704572ec78436ca9d6d6 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* Add support for long descriptor value writesAlex Blasche2014-09-081-4/+0
| | | | | | | | | | | | | | | | | | Use the combination of prepare/execute commands to implement writing of descriptor values which are longer than ATT MTU size. Long characteristic writes are already implemented and the related code was adopted to cater for descriptor writes. At the same time we remove related TODO's from the code base. Last but not least ensure that writing of a descriptor with the same value as the pre-existing value is possible. This restriction is not helpful as some BTLE devices use writing of values as trigger for internal events and notifications. This was encountered on a test device when implementing the long write support. Change-Id: If765dc9393239dbbd1bb6a9bc942287b28d65cd6 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* Misc TODO and test fixesAlex Blasche2014-09-081-1/+0
| | | | | | | | | | | | | | 1.) Use updateValueOf*() where possible to channel all value changes through the same gate. 2.) BTLE connects have a much larger timeout when the remote device is not present. The device discovery could still turn up this device due to existing pairing information. 3.) Remove obsolete write long characteristic TODO Change-Id: I5b5815b0c3b99f8c4f87e0f1747ac6f1e274e592 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* Improve documentation on how to enable characteristic notificationsAlex Blasche2014-09-021-1/+19
| | | | | Change-Id: I87575fb7b5115a536e12c0a00374cc0e67428706 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add QLES::characteristicWritten() signalAlex Blasche2014-09-021-14/+27
| | | | | | | | | | | | The previous characteristicChanged() signal was emitted when the characteristic was updated due to a notification and when the value was changed using writeCharacteristic(). This meant that it was not possible to distinguish the two use cases. The new signal is only emitted in response to writeCharacteristic() whereas the old signal is only emitted when the peripheral indicates a change. Change-Id: Ie8797090f9463ae0e7fb053a42a79afa6829ca75 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Rename descriptorChanged() to descriptorWritten()Alex Blasche2014-09-021-5/+7
| | | | | | | | | | | | | | | | | This is the part of a change to be able to distinguish characteristic write confirmations from characteristic change notifications. Since descriptors cannot receive notifications they won't have a changed() signal and all existing descriptorChanged() signals become descriptorWritten() signals. The changed() signal is emitted when a value notification is received from the device. The written() signal is emitted when a write request from the API user was successful. Change-Id: Ief2491ead4723eaa1bca65a09a09c34458f33630 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add support for BTLE write command (BlueZ/Linux)Alex Blasche2014-09-021-13/+58
| | | | | | | | So far, we only supported write requests which reply with write responses. Change-Id: Ibdad36dcf18dec23260f003911b9361cc4ab1e3d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge the ServiceNotValidError and OperationError of QLEServiceAlex Blasche2014-08-251-4/+3
| | | | | | | | | | | | The invalid service error is essentially the same as the operation error. The OperationError remains and the ServiceNotValidError is removed. Remove an unrelated but obsolete TODO from the source code. We can read larger than MTU values already. That's what the Blob requests are for. Change-Id: I3ed496194d55cd05f8e9e09680e962a2b7638702 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* Update license headers and add new licensesJani Heikkinen2014-08-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I7a8b8b787fcae9a178794364efdefe1021d10b1b Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Update QLowEnergyCharacteristic class documentation.Alex Blasche2014-08-181-1/+2
| | | | | Change-Id: I9f8a2cc1b833e91f05434e68ad3b5b4757eac786 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
* Add class documentation for QLowEnergyServiceAlex Blasche2014-08-181-26/+220
| | | | | | | This class is part of the new Bluetooth Low Energy feature in Qt 5.4 Change-Id: If10cac1ac1312cb63137c854a4456bf2d646f630 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
* Implement support for QLowEnergyService include hierarchies.Alex Blasche2014-08-131-4/+16
| | | | | Change-Id: Id11d2dcb06bd04bc1d911d746002fbbc53326ffa Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* Detect secondary services and display service type in lowenergyscannerAlex Blasche2014-07-231-1/+13
| | | | | | | | QLowEnergyService::ServiceState was converted to a flag because a primary and secondary service can be included by other services. Change-Id: I425ce8e3f39ee07cccee2763b57a049a624f6178 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>