summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Avoid wrong implicit cast leading to wrong connectToService() callAlex Blasche2018-01-253-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this change passing a QBluetoothUuid::ServiceClassUuid to connectToService() caused the port overload to be called rather than the QBluetoothUuid version. This patch introduces a ServiceClassUuid overload that avoids relying on implicit type conversion. There is a remote chance that this patch breaks existing code if the remote port was in the same range as the ServiceClassUuid range. In general the Bluetooth ports are below 100 though. Task-number: QTBUG-65831 Change-Id: I6574291ae6fee284466d84ecb91f21e3be89f6b2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-2013-25/+56
|\| | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I6e93fc7435a49b601a5c10519ed86d2a15125074
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-184-10/+31
| |\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I6d2140aa8692bc7ce56f4366275fd02d008900f0
| | * Disable compiler flag using proper qmake comment styleAlex Blasche2018-01-161-1/+1
| | | | | | | | | | | | | | | Change-Id: I041606473b333500da29c821d7dc089313856f65 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| | * BlueZ: Fix inconsistent QLEService error stateAlex Blasche2018-01-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Emitting just the signal does not change the error state. setError() ensures that the error state/member and the error signal are emitted. Change-Id: Idc044b8b97d4025b0f3a4d172c11c6b3a4e81ecb Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
| | * winrt: Do not crash when trying to an unreachable paired LE deviceOliver Wolff2017-12-121-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As device discovery returns every paired device on winrt, it is possible that we try to connect to a device, that is paired but not available. When doing so the application should not crash but state that there was an error connecting to the device. Task-number: QTBUG-64480 Change-Id: I8d79f6da1de2b0bda7a51a7cfd068bb4a6057257 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Miguel Costa <miguel.costa@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| | * winrt: Add bluetooth capabilities for msvc2017 as wellOliver Wolff2017-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As msvc2013 was dropped we can add the capabilities independent of the msvc version for winrt. Change-Id: I14aea0da9226a5de6ffa2cf7c69a4ae5a69e8256 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Miguel Costa <miguel.costa@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| | * BlueZ: Prevent hanging of QLEController job queue due to comm timeoutAlex Blasche2017-11-231-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an ATT READ_REQUEST times out the ATT stack stops spinning the event queue. This is particularly bad during the initial service discovery when a lot of read requests are scheduled in one go. The consequence was that the QLEService instance was stuck in the ServiceDiscovering state. Subsequently the service object is unusable. The patch ensures that the ATT event loop continues after the timeout happens. If multiple char or descriptor reads (on the same service) have this problem the service discovery can still take a very long time. The user can adjust this via the BLUETOOTH_GATT_TIMEOUT env variable. [ChangeLog][Platform Specific Behavior][BlueZ] Fixed hanging service discovery state when remote device does not respond to ATT read requests. Task-number: QTBUG-64669 Change-Id: I8d22c13b825a921b140213b8b67e59e2310c362c Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | * winrt: Early return instead of assert is case of errorMaurice Kalinowski2017-11-161-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some devices report access denied for various reasons (group policy, disabled, etc.). Hence, do return and stop the discovery instead of asserting. Change-Id: I22fe9cc375fd3b3580deaf72c614bf62600cbf32 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * | Improve documentation about missing iOS support in QtBluetoothAlex Blasche2018-01-045-0/+14
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-65547 Change-Id: I472b354621db89a921eec01b1459d46dbaa15ac0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | Update QML versions for QtBluetooth and QtNfc in step with Qt versionAlex Blasche2017-12-154-15/+11
| | | | | | | | | | | | | | | Change-Id: I00ac4bbb56bd809784f94812221130365f06218d Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | | Implement QLEService::discoverDetails for DBus BluezAlex Blasche2018-01-054-7/+405
| | | | | | | | | | | | | | | | | | | | | | | | This includes support for reading of characteristics and descriptors. Task-number: QTBUG-46819 Change-Id: I8ac1ef3bcd5bc475941f1a9f889d0742eb8def35 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Support service discovery for BlueZ DBus backendAlex Blasche2018-01-052-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | At the same time a typo in a comment is fixed. Task-number: QTBUG-46819 Change-Id: Ic017df4d2d52cf0d226b6e083a9ec5f28657dee0 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | BTLE DBus: Add ability to connect/disconnect to remote deviceAlex Blasche2018-01-052-4/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch uses the Device1 DBus API to connect and disconnect to a remote BTLE device. In addition, status and error condition tracking is added to adapt to various error cases. Task-number: QTBUG-46819 Change-Id: I0671df5596882c89aeead89c05ddcc855f8ba375 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Implement bluetoothd version testAlex Blasche2017-12-136-10/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the ability to detect the underlying version of bluetoothd. The bluetoothd version provides the means to decide whether the DBUS LE API is sufficient to fullfil the QLEController requirements. Bluez DBus LE API is usable since Bluez 5.42. Prior versions only had experimental DBus LE APIs. Task-number: QTBUG-46819 Change-Id: Ic047fba27c01ee40571abb0c4eb45828f4a64475 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-2122-33/+184
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/bluetooth/bluetooth.pro Change-Id: Ibccccc974b545696ae053f1fbffcc973d8be43cc
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-152-1/+30
| |\| | | | | | | | | | Change-Id: I549972a6521a33a1c52fcbf0506a6aff502b364c
| | * winrt: Do not assert when registering a service without a local BT adapterOliver Wolff2017-11-031-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If no bluetooth adapter is present in the system IRfCommServiceProvider::CreateAsync will result in "device not available". In this case we should not assert, but just handle that as a failed attempt to register the service. Task-number: QTBUG-64118 Change-Id: I73591a1f2dbedc798824e5afef53a9e2d793e73e Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | * winrt: Reflect unsupported state of peripheral role of lowenergycontrollerOliver Wolff2017-11-031-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There currently is no API for supporting the peripheral role on winrt, but there is no way to reflect that inside our API. If a user tries to set up a low energy peripheral device, the application should not crash though. The crash occurred, when the controller was set up in a perihperal role and the application tried to read or write a descriptor or characteristic. In this case the functions should just return early. Task-number: QTBUG-63709 Change-Id: I30b277788d822f869743e1f294ee1402abd36309 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * | Update to new QRandomGenerator APIv5.10.0-beta4Thiago Macieira2017-11-032-4/+4
| | | | | | | | | | | | | | | | | | Change-Id: I69f37f9304f24709a823fffd14e676c097712329 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * | CoreBluetooth - fix compilation errorsTimur Pocheptsov2017-11-023-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apple keeps breaking things, we keep fixing their usless diagnostic, until they fix their framework for good. https://openradar.appspot.com/33375728 https://openradar.appspot.com/33375690 etc. Change-Id: I0051b4636c6082ac4d0a7d76fc8aebb952394626 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * | Remove qlowenergycontroller_p.cpp from macOS buildAlex Blasche2017-10-301-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | This file is not needed by macOS and in fact was never added to the build. Hence there is no need to attempt to remove it. Change-Id: Ibb32c8f3d163022e88de36de6ae99d89043b4a63 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-3016-28/+135
| |\| | | | | | | | | | Change-Id: Iaa053dcb125490ee1e83d7e27cb75d4171297b9f
| | * winrt: Fix build using -no-pchOliver Wolff2017-10-255-0/+14
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-63210 Change-Id: I98637337d8a77c8847bd0f2c567fec5e6a4ace31 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | * Fix writing of NdefMessages on androidDaniel Engelke2017-10-241-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For writing messages another QAndroidJniObject was created, which however wasn't connected or validated in any way, so calling methods failed obviously. I removed said object and made use of the implemented class member m_tagTech, that is being validated and connected beforehand. Task-number: QTBUG-62858 Change-Id: I97c28f15cdaf5c0aa36423e7aba35408b49bde4e Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
| | * Fix outdated BSD license headerKai Koehne2017-10-178-23/+103
| | | | | | | | | | | | | | | Change-Id: I28f5936913a6127806325df34af4bf71a142e72e Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | * Fix crash due to inconsistent state in QLEController during JobDisconnectDeviceAlex Blasche2017-10-172-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug was caused by a problem in the patch for QTBUG-55150. While the termination of an ongoing BTLE connection is being processed, the QLEController instance is in Connecting state and the internal socket is still null. If the user triggers a call to QLEController::disconnectDevice() while the above state is pending, it crashes due to a call to the socket's close() function. The time window for this to happen is very small. It takes the duration of the bluez dbus call to disconnect a device. This patch addresses the above crash bug and adds a bit more debug output to catch similar cases later on. Task-number: QTBUG-63619 Change-Id: I893990a9ce8ccf55ddbf619fe177379f79dc9ee3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Convert most old-style QObject::connect() to pointer syntaxAlex Blasche2017-11-135-39/+60
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Use QStringLiteral where needed to avoid QString allocationsAlex Blasche2017-11-062-3/+3
| | | | | | | | | | | | | | | Change-Id: I9edc229e43f5e09ca45ede5032aacb4d54fa76af Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Do not return from void functions/expressionsAlex Blasche2017-11-062-2/+2
| | | | | | | | | | | | | | | | | | | | | This was pointed out by clazy. Change-Id: I6f888e2cd667c05d0f9747fd0b2ef2bcbfe95a28 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | | Normalize Q_ARG arguments (const modifier removed)Alex Blasche2017-11-032-18/+18
| | | | | | | | | | | | | | | Change-Id: Ia65a879221d565af9b89083c6145c097472567a5 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Merge all QLEConrollerPrivate::addServiceHelper() implementationAlex Blasche2017-11-0311-180/+60
| | | | | | | | | | | | | | | Change-Id: Id346f2f98e63c5c7ea9e2cd3fb7e68e4573ac1e5 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Consolidate the QLEControllerPrivate instanciationsAlex Blasche2017-11-031-49/+23
| | | | | | | | | | | | | | | | | | | | | This patch removes repeated code patterns. Change-Id: Ica931958b1d4072429ed197d5e44ad77670c3485 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Reorder the qlowenergycontroller_p.h includesAlex Blasche2017-11-035-35/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-036-45/+5
| | | | | | | | | | | | | | | Change-Id: Ia98a7a16c3e1e478d1c6e30d9e70dc703c1fe091 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Unify meta type registration for QLEDescriptor and QLECharacteristicAlex Blasche2017-11-034-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Provide UWP specific header for QLEControllerPrivateAlex Blasche2017-11-038-60/+210
| | | | | | | | | | | | | | | Change-Id: Ic2ee2a76e2da4c236415f1eb3b98ab642ee3d1fc Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Provide own header for QLEControllerPrivate on AndroidAlex Blasche2017-11-038-85/+236
| | | | | | | | | | | | | | | Change-Id: I63d107092e3e404f6b2c38f28d5d9b286711db77 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Provide own header for QLowEnergyControllerPrivate instance on BluezAlex Blasche2017-11-0312-379/+636
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0317-214/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-036-136/+128
| | | | | | | | | | | | | | | Change-Id: I5f126fabebf36b61a25e23ddc12c4dae21156cbc Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Introduce Base class for QLowEnergyControllerPrivateAlex Blasche2017-11-0316-157/+654
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Hook new gatt dbus classes into build systemAlex Blasche2017-11-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | In addition, we add exception rules for the missing "We mean it" header preamble. The headers are auto generated. Task-number: QTBUG-46819 Change-Id: Ia781e2b3af597518a345019d4e9e817471706652 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Run a general update of all dbus interface classesAlex Blasche2017-11-0232-186/+190
| | | | | | | | | | | | | | | | | | | | | | | | Mostly this permits the codebase to catchup with changes introduced by the qdbusxml2cpp tool. Change-Id: Ib16b70523b222c6babb3735f91b578e10c7542f3 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Setup GattService1, GattChar1 & GattDesc1 dbus interface classesAlex Blasche2017-11-027-0/+311
| | | | | | | | | | | | | | | | | | | | | | | | | | | The change adds the relevant xml raw description to the generation script and commits the generated dbus accessor classes. Task-number: QTBUG-46819 Change-Id: Ib5f7e15cef9e7225d33b7b4e43f085806a0fb1a4 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Add DBus XML descriptions for Gatt interfacesAlex Blasche2017-11-023-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | GattService1, GattCharacteristic1 and GattDescriptor1 are relevant for central role use cases. Task-number: QTBUG-46819 Change-Id: I5ab12710880ec91565c2e5c510eb55dc3410a7ee Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Convert Q_ARG params to normalized formAlex Blasche2017-10-202-4/+4
| | | | | | | | | | | | | | | | | | | | | This was identified by clazy. Change-Id: If45c1c1898ee2dc4dd6274aa441b1c980a00686f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Add default assignment operator for QBluetoothUuidAlex Blasche2017-10-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This was detected by clazy. Change-Id: I69c5a0921864b24dfdbf33fb54e8b85a7b600adb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Merge remote-tracking branch 'gerrit/5.10' into devAlex Blasche2017-10-1724-75/+130
|\| | | | | | | | | | | Change-Id: I3bf7130a204aebd6a52dfe68bfea57767ba1b70e
| * | Merge remote-tracking branch 'gerrit/5.9' into 5.10v5.10.0-beta3Alex Blasche2017-10-1724-75/+111
| |\| | | | | | | | | | Change-Id: I84bfe86751c27eabb4e75912ae3c0b4d3781faf1