summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qlowenergycontroller_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Mark classes derived from QLowEnergyControllerPrivate as finalAlex Blasche2018-07-241-2/+2
| | | | | | | Fixes missing overrides for the dtor in the process. Change-Id: Iea3d010c1cebddaf8ea6ea392a7f13e4d87f67da Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Merge all QLEConrollerPrivate::addServiceHelper() implementationAlex Blasche2017-11-031-3/+0
| | | | | Change-Id: Id346f2f98e63c5c7ea9e2cd3fb7e68e4573ac1e5 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Reorder the qlowenergycontroller_p.h includesAlex Blasche2017-11-031-20/+0
| | | | | | | | | | | | | | qlowenergycontroller_p.cpp and qlowenergycontroller_p.h are no longer universally included by all builds. The project includes the universal qlowenergycontroller* files across all platforms. To accomplish this the macOS/iOS specific QLowEnergyControllerPrivate interface moved to the common qlownergycontrollerbase_p.h. From this point onwards qlowenergycontroller_p.[cpp|h] contains the dummy backend only. Change-Id: If2893a32adfb14f47cf85622e943d5f683ad38da Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Various cleanups following the recent QLEControllerPrivate header splitsAlex Blasche2017-11-031-23/+0
| | | | | Change-Id: Ia98a7a16c3e1e478d1c6e30d9e70dc703c1fe091 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Provide UWP specific header for QLEControllerPrivateAlex Blasche2017-11-031-38/+0
| | | | | Change-Id: Ic2ee2a76e2da4c236415f1eb3b98ab642ee3d1fc Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Provide own header for QLEControllerPrivate on AndroidAlex Blasche2017-11-031-42/+2
| | | | | Change-Id: I63d107092e3e404f6b2c38f28d5d9b286711db77 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Provide own header for QLowEnergyControllerPrivate instance on BluezAlex Blasche2017-11-031-227/+3
| | | | | | | | | | | This utilizes the new QLowEnergyController interface and separates the existing Bluez implementation more clearly from other platforms. The existing addServiceHelper() class is moved out into the individual backends to avoid compiling the class into the new dbus backend. Change-Id: I1eea99e493958c61cb1fae830c08a3eb26bda9c3 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Rename various QLEControllerPrivate classesAlex Blasche2017-11-031-4/+4
| | | | | | | | | | | | | | | | | The base class is renamed to QLEControllerPrivate and the existing QLEControllerPrivate becomes QLEControllerPrivateCommon. This is necessary to re-enable Q_DECLARE_PRIVATE. The macro uses by convention the "Private" class prefix which is currently broken because not every implementation uses QLEControllerPrivate as d-pointer type. This also avoids a SC/BC break in qlowenergycontroller.h as the d-pointer remains the same and the functions declared via Q_DECLARE_PRIVATE still return the same type. Change-Id: I84890b06280b2c473a4d370606d3bbc58a258eea Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Move common helper function from QLECPrivate to QLECPrivateBaseAlex Blasche2017-11-031-16/+0
| | | | | Change-Id: I5f126fabebf36b61a25e23ddc12c4dae21156cbc Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Introduce Base class for QLowEnergyControllerPrivateAlex Blasche2017-11-031-43/+17
| | | | | | | | This permits alternative implementations selectable at runtime. Currently this is only used by Bluez. Change-Id: I3ddeb7f888f3b09bdc62f10d5b9a36320500f329 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Merge remote-tracking branch 'gerrit/5.9' into devAlex Blasche2017-07-261-2/+2
|\ | | | | | | Change-Id: Ida3681a873698f22c28bc60230ca0c49d2a9d25f
| * Windows: Fix namespaced buildOliver Wolff2017-07-261-2/+2
| | | | | | | | | | Change-Id: I9f6a7c3884c2d7c9b0856a0e9a689ad88cca59fe Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-07-061-0/+3
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I7a55929aefa1f7a4dc96f841317b78b248899f67
| * Provide a way to define GAP/GATT services for central rolesAlex Blasche2017-06-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some devices require the Generic Access (GAP) and Generic Attribute (GATT) services to be defined. Otherwise they refuse a proper interaction. This is done implicitly by Android and BlueZ. The reason why BlueZ does not do this for QtBluetooth is because QtBluetooth sets up its own GATT infrastructure. Normally a QLEController in central role cannot do that via public API as the QLEController::addService() function blocks on peripheral use cases. This patch sets the profiles up. In the future the feature really requires a better form of API (beyond the above env variable) or should be enabled by default but since we need this earlier than Qt 5.10 a more subtle approach was chosen. For now the feature can only be enabled if the QT_DEFAULT_CENTRAL_SERVICES was set. Another limitation is that the characteristics of the added services are completely static. Task-number: QTBUG-61554 Change-Id: Id03bddb2e54cc4f0869838e13ddf281311ad3a26 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-071-0/+4
|\| | | | | | | Change-Id: I6f1a42c6e27b262c82f87b9c90e7f346ef9ab1c7
| * Avoid bluetoothd and QtBluetooth collision when connecting to BTLE devAlex Blasche2017-05-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BlueZ's improving support for BTLE creates a new collision when attenpting to connect to remote BTLE devices. There can only ever be one connection. This patch ensures that when QtBluetooth attempts to connect we do not have a pending BTLE connection. This could have been caused via other QtBLuetooth based processes or applications such as bluetoothctl or bluetoothd in general. If a connection is pending we close the connection external to the current QtBLuetooth instance. This is not an ideal situation as several processes can potentially fight over btle access. The long term solution is a port of QtBluetooth to BlueZ's new DBus API. Task-number: QTBUG-55150 Change-Id: I96b30ae180d1348027e8f9f09c997f44409dfc48 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-04-211-3/+3
|\| | | | | | | Change-Id: I97e00dacff4ec6b01937383efa6a6e6254fb8f87
| * Replace custom QT_BLUEZ_BLUETOOTH against the related feature defineAlex Blasche2017-04-061-3/+3
| | | | | | | | | | Change-Id: I4fbb948841a610640acaf87364e2157e31782836 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Register additional meta typesLars Schmertmann2017-03-301-5/+0
|/ | | | | | | | | | | | | | | 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>
* Android: Implement QLEService::descriptorWritten() signals for peripheralAlex Blasche2017-01-241-0/+1
| | | | | Change-Id: I60e5bdce4256804754909c2538aebe581897e1e9 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Android: Implement QLEService::characteristicChanged() for peripheral modeAlex Blasche2017-01-241-0/+1
| | | | | | | | | Emits the above signal when the remote client successfully updates a characteristic. Change-Id: I236b1f92b682028bc10be798192f46bffc981101 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Android: Keep track of peripheral advertisement errorsAlex Blasche2017-01-231-0/+1
| | | | | | | | | | If advertisement fails then we drop back into the unconnected state and provide a more detailed error message for individual advertisement errors. Change-Id: Ic9de02b456409cd1a2dec11e53c884fe368ae267 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Android: Implement QLEC::stateChanged() notificationAlex Blasche2017-01-231-0/+7
| | | | | | Change-Id: Id2cabd9df7b5387fe5e6f1c898fe02e40f7c0a3d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add ability to export basic service data and advertiseAlex Blasche2017-01-231-1/+2
| | | | | | | | | | | | Advertisement data and Advertisement parameter in Qt are now connected to the Android/Java side. In addition the basic service structure is supported. Descriptors and char detail export are still missing. Change-Id: I941cba5e832d76ff7beca811d08a2148367c6bf5 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Prevent stalling of Linux central BTLE implementationAlex Blasche2016-12-151-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | Some peripheral implementations do not respond with a response upon reception of GATT requests. Since the Linux implementation does not progress until a response is received, it stalls forever. A new timeout was introduced to counter this. If the response is not received within the timeout period an artificial GATT error response is injected into the queue. In addition, a very large warning is printed to highlight the fact and force the user to deal with it. In extreme cases this could create strange ordering problems for extremely delayed responses. Hence the implementation continues under reservation. A disconnect as response to the missing response from the peripheral was briefly considered too. However user reports indicate that not every user is able to change the peripheral implementation. This would block further usage of QtBluetooth (especially if one characteristic is non-conformant but the other characteristics of the same service are OK). Task-number: QTBUG-52692 Change-Id: I49ad7b75215101b3132ba97794e71021ee25a30e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* winrt: qRegisterMetaType for QLowEnergyCharacteristic/QLowEnergyDescriptorOliver Wolff2016-12-071-0/+5
| | | | | | | | | | As the signals about read/written characteristics and descriptors are emitted from a different thread (XAML thread) the types have to be registered in order to make the queued connection work. Task-number: QTBUG-57385 Change-Id: I4542c8d1be03d2d3fe1b0a69b94ef0a2ff916026 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* winrt: BTLE: Handle characteristic changesOliver Wolff2016-11-011-14/+19
| | | | | | Task-number: QTBUG-37779 Change-Id: Ie368e85286a3d132c633ef759a2bdb0fb206172d Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* WinRT: getNativeService/getNativeCharacteristic helper functionsOliver Wolff2016-07-261-0/+4
| | | | | Change-Id: I5094eb7252049e55617a2883d0f917700c42b451 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* WinRT: BTLE: Discover list of available servicesOliver Wolff2016-05-311-0/+6
| | | | | | Task-number: QTBUG-37779 Change-Id: Ia92facf9f3f1c6aae8fac7a205d3f9ad4921787e Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* winrt: BTLE: Device (dis-)connectionOliver Wolff2016-05-261-0/+18
| | | | | | Task-number: QTBUG-37779 Change-Id: I0f83e706a10d6c42543bd41aa012fde746f1a334 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Bluetooth LE: Add support for Signed Write command in the central role.Christian Kandeler2016-02-171-7/+10
| | | | | | Task-number: QTBUG-41175 Change-Id: I62d74236faf9161681306d952e409e23e0cea24d Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-161-0/+2
|\ | | | | | | | | | | | | | | Conflicts: .qmake.conf src/bluetooth/qlowenergycontroller_bluez.cpp Change-Id: I00f45a2a22a045e7836f2caeb76cc5599ced6279
| * Bluetooth LE: Fix premature initialization of HCI manager.Christian Kandeler2016-01-151-0/+2
| | | | | | | | | | | | | | | | The private class used a member in its constructor that was only set afterwards. Change-Id: I19b7ca2a5048771a447d63a56ad10ad56c311e91 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Bluetooth LE: Add support for Signed Write command.Christian Kandeler2016-02-031-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - This is how we get at the signature resolving key: 1) On connection from a client, we read the key from the respective BlueZ settings file (BlueZ 5 only, as I did not manage to find out where BlueZ 4 keeps this information). 2) Also monitor the HCI traffic for key updates (due to re-pairing). - While there is an autotest for the actual hashing procedure, the overall feature cannot be easily tested for various reasons (there is no signed write support in our client API, for one). However, to help with manual testing, the server part of our autotest now exposes a characteristic that supports signed writes. - This feature requires a Linux kernel >= 3.7. Change-Id: I7ede9b430de167fe1f4519eedf8670d88d79aa25 Reviewed-by: Alex Blasche <alexander.blasche@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/+3
| | | | | | | | | | | | | | Implemented for BlueZ only. Change-Id: I358a98bbc7499d5ce5437fb0d4672fde46c3b831 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Bluetooth LE: Implement GATT server write support.Christian Kandeler2015-12-151-0/+63
| | | | | | | | | | | | | | | | | | | | 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>
* | Bluetooth LE: Implement ATT access permissions.Christian Kandeler2015-12-041-1/+2
| | | | | | | | | | Change-Id: I456d083d45569ea8d61f0a659f72646d653143d1 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Merge remote-tracking branch 'gerrit/dev' into neardAlex Blasche2015-12-031-0/+2
|\| | | | | | | Change-Id: I1fc766d26aadb7cc01d33c4c8a2260411d7bb138
| * Merge remote-tracking branch 'gerrit/5.5' into 5.6Alex Blasche2015-12-011-0/+2
| |\ | | | | | | | | | Change-Id: I4404df69bfdac335e9c1eb63e4ada3ba89b48b6c
| | * Don't register meta types during static init time5.5Alex Blasche2015-11-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QMetaType register my not be up and running by the time we attempt these meta type registration. Change-Id: I1a857a936a24b4b00a49574fac311c08c09b3d5a Task-number: QTBUG-49455 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | Bluetooth: Partial implementation of GATT server functionality.Christian Kandeler2015-11-301-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Available so far are all "read" and "find" requests (BlueZ only). Things left to do: - Access checks regarding authentication, authorization and encryption requirements. - Handling write requests. - Notifications and Indications. Change-Id: Idfcb863b1b375cd0414580b5ce1cba67c23a6bf8 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | QLowEnergyController: Rename "sendCommand" function.Christian Kandeler2015-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | With the upcoming implementation of GATT server functionality, the name will not fit anymore. Change-Id: I1a4f3bd5a21c7b13429d120d12831ff3f80d7f7f Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | Bluetooth: Add API to set up GATT services.Christian Kandeler2015-11-201-0/+24
| | | | | | | | | | | | | | | | | | | | | 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/+5
| | | | | | | | | | | | | | | | | | | | | 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-0/+9
|/ / | | | | | | | | | | | | And provide an implementation for BlueZ. Change-Id: I302aee7c43b77016d9e1e7a0d5bcbf00096abf76 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* / Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-091-0/+11
|/ | | | | Change-Id: I4e78a2b263fb779253556201fd20fe47a2afc58e Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Do not cut 32bit value down to 16bitAlex Blasche2015-07-131-1/+1
| | | | | | | | | | | | | | handledata contains a 16bit char handle in the lower bits and may contains a 16bit descriptor handle in its upper 16 bits. When doing blob read requests for descriptors the upper 16 bit may be cut off and the descriptor read turns into a characteristic read. In turn this switches the internal state of the service discovery state machine causing an endless loop between descriptor and characteristic reads. Change-Id: Ia66f230e8fb018da51c3ce32db936d02a0b195b8 Task-number: QTBUG-47028 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>