summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qlowenergycontroller.h
Commit message (Collapse)AuthorAgeFilesLines
* QLowEnergyController: introduce ConnectionClosedErrorKonstantin Ritt2017-07-101-0/+1
| | | | | | | | | | Unlike ConnectionError, this shall be used to mention errors occurred due to the remote device's intent (term, power loss, etc) Change-Id: I6918879e3918a5131841f012b2824c30b99e472d Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* LE controller - add a getter for a remote device UUIDTimur Pocheptsov2016-11-231-0/+1
| | | | | | | | | | | | A device UUID is valid/works on iOS/macOS only: platforms where CoreBluetooth hides addresses and generates 128-bit uuids instead. We connect to a LE device using such a UUID. This patch adds a getter to access a UUID of a remote device our controller works with (similar to 'remoteAddress' method on other platforms). Task-number: QTBUG-52690 Change-Id: I000e17bbea90c508922ac47ce5291e28d938de7c Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QLowEnergyController: fix new uses of 0 as null pointer constantMarc Mutz2016-05-121-4/+4
| | | | | | Change-Id: Ie5088c2c3a9b4c44696ac84cff7ac0c8b03c735b Task-number: QTBUG-45291 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-211-6/+5
|\ | | | | | | | | | | | | Conflicts: src/bluetooth/qlowenergycontroller.h Change-Id: I15571e47fbf06545d46d1b9a9b2b47bf815ae293
| * Add explicit and make public headers compile with ↵Marc Mutz2016-03-151-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -Wzero-as-null-pointer-constant ... or equivalent. QtBase 5.6 headers already compile that way, so let the other modules follow suit. Added explicit where it was missing. This is not a source- incompatible change, because code that breaks by this is a bug. Let's not have this sitting around in an LTS. Task-number: QTBUG-45291 Change-Id: I375361699615d0fc874e0b96a84543e233eff5f0 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* | Merge remote-tracking branch 'gerrit/dev' into neardAlex Blasche2016-01-261-14/+20
|\ \ | | | | | | | | | Change-Id: If9cf6718cbd619dd7ce38db2da274fe9d0a41fb7
| * | Updated license headersAntti Kokko2016-01-201-14/+20
| |/ | | | | | | | | | | | | | | | | | | 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 LE: Add connection update functionality.Christian Kandeler2016-01-181-0/+4
| | | | | | | | | | | | | | Implemented for BlueZ only. Change-Id: I358a98bbc7499d5ce5437fb0d4672fde46c3b831 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Bluetooth: Add API to set up GATT services.Christian Kandeler2015-11-201-0/+3
| | | | | | | | | | | | | | This is the next step in implementing LE peripheral support. Change-Id: I5e8cb186d556e7bfb9ae8a5e60e051ff7398b77d Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | QLowEnergyController: Listen for and accept GATT connection requests.Christian Kandeler2015-11-191-0/+2
| | | | | | | | | | | | | | BlueZ only. No requests are handled yet. Change-Id: I25058989beb5b3ae02a4f43eeaec09c8225198dc Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Bluetooth: Introduce API for LE advertising.Christian Kandeler2015-11-171-2/+25
|/ | | | | | | And provide an implementation for BlueZ. Change-Id: I302aee7c43b77016d9e1e7a0d5bcbf00096abf76 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Add missing metatype registration related functions for Q_ENUMsOliver Wolff2015-07-101-0/+4
| | | | | Change-Id: Iedd83bb8f9d31268fb5a17879feaaf97a82f86cc Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Port from Q_ENUMS to new macro Q_ENUMKonstantin Ritt2015-06-231-3/+3
| | | | | | | | | | | Remove Q_ENUMS in favor of the new Q_ENUM macro which provides registration as meta enum and a debug stream operator. Register some enums via Q_ENUM to improve debug output and types auto-registration. Change-Id: I31c9535a2de7da1783b4ec967612c02a57cb62ff Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Reduce platform specific code linesAlex Blasche2015-05-121-2/+2
| | | | | | | | | | | | QLEController(QBluetoothAddress) ctor is not usable on iOS and OSX. On those platforms we have to use QLECOntroller(QBluetoothDeviceInfo). We mark the QBluetoothAddress based ctors of QLEController obsolete and remove most uses of them. This cleans up some ifdefs throughout the QtBluetooth code base. Change-Id: Ibe1e3fa271a29461e39fc3c0eeba7a910a250077 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* add remoteName() method to QLowEnergyControllerKevron Rees2015-05-121-0/+2
| | | | | | Task-number: QTBUG-45435 Change-Id: I3ded6bf88d3980481e386073ce160d5d54520034 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Fix trailing commas in enumsAlex Blasche2015-04-201-1/+1
| | | | | | | This was caused by the new headersclean enforcing warnings as errors Change-Id: Idd595fc4cf78411a80ff3dbb46477d5130a04c3e Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
* Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/devFrederik Gladhorn2015-02-161-1/+1
|\
| * Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-161-1/+1
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/bluetooth/qbluetoothdeviceinfo.h Change-Id: I2ad566b9ca8fb001fa91a74501e83e8a2121ef3a
| | * Add the QtCore/ library prefix in public headersSergio Ahumada2015-02-121-1/+1
| | | | | | | | | | | | | | | Change-Id: I01f01575a03d95f558b1f1994e0c76b22b3c19e0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.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>
* | Add enum for failure to connect to remote BTLE device.Alex Blasche2014-11-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | In addition we restrict the emission of disconnected() signal on Android to those cases when we had an established connection. [ChangeLog][QtBluetooth][QLowEnergyController] QLowEnergyController::ConnectionError enum value added. Change-Id: I3602e303e61a872855925a26e695f2bc880cf540 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | Android: Add ability to (dis)connect to BTLE devices on AndroidAlex Blasche2014-11-041-0/+3
| | | | | | | | | | | | | | | | and keep tracking the connection state Change-Id: If4d05fa18c78802ae06096884fba78eed123e77f Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | Add QLeController ctor that takes QBluetoothDeviceInfoAlex Blasche2014-10-171-0/+3
|/ | | | | | | | | | This ctor is required for OSX as the remote device address cannot be retrieved. On other platforms this ctor is syntactic sugar to be able to directly feed the device search results into the controller. Change-Id: I4839a48861ebc625740e37aee5a779deeb32f96d Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Add a way to detect that the QLEController is performing a discoveryAlex Blasche2014-09-021-1/+2
| | | | | Change-Id: Ie3146c136461ad4ecde4169f3b30dda0c814ca7b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add support for random vs public remote address connectionsAlex Blasche2014-09-021-0/+8
| | | | | | | | | | | | | | | | This is required to be able to connect to devices which use random device addresses. Some platforms can determine this flag based on their last device scan. The flag is likely to be provided as part of QBluetoothDeviceInfo once the information is available. Unfortunately non-le scan on BLuez doesn't inform about the flag. The LE device scan is currently not implemented and, even worse, requires root privileges on Linux. The new API element permits the selection of the correct type when the scan doesn't detect the type properly. Change-Id: I8e7118658a7c927e0ea07b0d639d57f9483cb33c Reviewed-by: Lars Knoll <lars.knoll@digia.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>
* Rename QLowEnergyControllerNew -> QLowEnergyControllerAlex Blasche2014-07-231-0/+112
| | | | | | | | Moves the new API into its place and completes the removal of the old API. Change-Id: I10a285e24e288aeb747cb1606574e27a4bf57308 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* Remove old GATT APIAlex Blasche2014-07-231-104/+0
| | | | | | | | | The subsequent patches will rename QLowEnergyControllerNew to QLowEnergyController and fix up the documentation fragments which still point to the old API. Change-Id: I084e6b1a85a17f424702018f3ad7047bda35d46a Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* Provide guarding against non-BTLE enabled versions of BluezAlex Blasche2014-06-161-1/+1
| | | | | | | | | | This disables the gatttool based controller as well. While it might compile on older systems they are likely to not have a gatttool and why would a Bluez version without BTLE symbols ever work anyway. Change-Id: I761e482d3dd1e99008c5d170053e19a1a3a51e6c Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* Added and improved error handling in controller classNedim Hadzic2014-03-251-3/+10
| | | | | | | Error enums added and implemented together with examples. Change-Id: I912c396080ee9a6b87f41104eb7e41f8c62abf8b Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Cleanup headers files for BtLE classesAlex Blasche2014-03-241-5/+10
| | | | | | | | | Some spacing and reordering for readability and remove unnecessary friend relationships. Change-Id: I9d2c9eb78713b94999829bc0a58824d476a2dbd4 Reviewed-by: Nedim Hadzic <nhadzic@blackberry.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Bind QLowEnergyController to a particular local adapter.Alex Blasche2014-03-151-0/+1
| | | | | | | | | This simplifies the internal LEServiceInfo logic and let's us later deal with multiple adapters. Change-Id: I7d3e991207cd6571b5d644ae99c6bf1a2c99ec68 Reviewed-by: Nedim Hadzic <nhadzic@blackberry.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* QNX BLE communication moved to controller classNedim Hadzic2014-03-141-6/+0
| | | | | | | Moving communication with device to QLowEnergyController class. Change-Id: Id783d3aac81c215fbda7c1390bb2abf8ecd2fb2a Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Bluez BLE write characteristic and descriptor value moved to controllerNedim Hadzic2014-03-131-0/+3
| | | | | | | | In the QLowEnergyController class write options for characteristic and descriptors are added. Change-Id: I5cc5dab1d3d2ef75d99eae045959f70524e65c91 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* BLE communication moved to controller classNedim Hadzic2014-03-111-0/+4
| | | | | | | | | BLE communication code was implemented in QLowEnergyServiceInfo class. It is moved now to the QLowEnergyController class. Needed adjustments are done in order to make this work. Change-Id: I9206d2324ad59f79f4e035509e23f5c7f7cfb328 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Renaming QLowEnergyServiceInfo methodsNedim Hadzic2014-02-211-0/+1
| | | | | | | | | Ensures that QLowEnergyServiceInfo and QBluetoothServiceInfo are more alike. Tests and examples updated as well. Change-Id: I0f6a97900891a9673f99578bdc8d156a8c403513 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Use proper include syntax for public headersAlex Blasche2014-02-201-6/+5
| | | | | | | | This fixes all qmake warnings. Change-Id: Ib103f0513ad0285ed55b45f7067742aaddd9cd58 Reviewed-by: Nedim Hadzic <nedimhadzija@gmail.com> Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* Implemented the characteristic error handling.Nedim Hadzic2013-11-281-0/+2
| | | | | | | In case of enabling notifications and writing values to the LE device, some errors can occur and which are reported now. Change-Id: I02c6deab925d06916c5b56705c9423386400f713 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Additional constructors to QLowEnergyDescriptorInfo class and method ↵Nedim Hadzic2013-11-111-1/+1
| | | | | | | | | modification in QLowEnergyCharacteristicInfo class. Characteristic notification change and solving the warnings were implemented. Change-Id: I8abec8b580e477578b4bc1dfd1e92e838ef7a372 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Implemented Bluetooth Low Energy gatt service and characteristics discoveryNedim Hadzic2013-11-041-0/+88
Bluez v4.x does not have total support for LE devices, a new approach, using gatttool command was implemented. Auto-tests and documentation will be in other commits. Change-Id: Iee711cc111199e15956052eebb7593bd3a5e27c8 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>