summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* CoreBluetooth - fix compilation errors for 10.13 SDKv5.10.0-beta2v5.10.0-beta1Timur Pocheptsov2017-10-041-0/+19
| | | | | | | | | | | | Apple broke source code compatibility by moving 'identifier' properties from CBPeripheral and CBCentral classes into the new CBPeer class and marking it as "since 10.13". As a result we have compilation errors in the code that was valid since 10.7. To workaround this issue, we introduce a category with 'identifier' property declarations for SDK >= 10.13 and target < 10.13. Change-Id: Id7c9d33a9c8ae7627a06b4c1930e70cede1e5b07 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Bail out early if Bluetooth is used on an unsupported Windows versionv5.10.0-alpha1Oliver Wolff2017-08-302-1/+39
| | | | | | Task-number: QTBUG-61566 Change-Id: Ie40762dbb07e9f29d862e75eba2bc05da088a34c Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* winrt: Use config feature when checking for winrt backend in auto testsOliver Wolff2017-08-307-18/+26
| | | | | | | | | | | | As the winrt backend may also be used on desktop Windows, checking for the operating system does no longer work. While touching these lines deprecated OS X checks were fixed as well. Task-number: QTBUG-61566 Change-Id: I247979aa63de6a71ac4908bda946d7db1e29b6c3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add missing qtnfcglobal_p.hOliver Wolff2017-08-302-0/+60
| | | | | | Change-Id: I749412d99ade54d3866ed988cf39d2b74b9489e6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add missing qtbluetoothglobal_p.hOliver Wolff2017-08-302-0/+60
| | | | | | Change-Id: I6d1d5b5e8084afdb0dd5082c344975dda5e66d1a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Rename qnfcglobal.h to qtnfcglobal.hOliver Wolff2017-08-3025-26/+24
| | | | | | | | | | | | | ... and deprecate the former. By doing so we get the header file in line with other modules - see qtnetworkglobal.h for example. The include is not used in the examples so it is removed there. Change-Id: If6d30e7a821b60f12768a963990937c46f21f4c7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Rename qbluetoothglobal.h to qtbluetoothglobal.hOliver Wolff2017-08-3029-27/+29
| | | | | | | | | | | | | ... and deprecate the former. By doing so we get the header file in line with other modules - see qtnetworkglobal.h for example. The include is not used in the examples so it is removed there. Change-Id: Ie6267738d4a45e45a0350d458a40654d8a952f4a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* windows: Make sure everything is properly CoInitialized on desktop useOliver Wolff2017-08-302-0/+15
| | | | | | | Task-number: QTBUG-61566 Change-Id: I5f8ff2c3e8a841ab8c5a3fb465d0be4b003d7a2b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add configure test to detect presence of winrt APIOliver Wolff2017-08-3011-6/+146
| | | | | | | | | | | | | Instead of checking for a certain Windows version, we should check whether the API is actually available [ChangeLog][QtBluetooth][Windows] Enabled UWP backend for desktop Windows versions that support the API Task-number: QTBUG-61566 Change-Id: I8384119c70cc2c4bdcdbe6b297cfcf5fb3e3f534 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Merge remote-tracking branch 'gerrit/5.9' into devAlex Blasche2017-08-078-3/+50
|\ | | | | | | Change-Id: I0ed4afd881f483a166a7e1400043f116c491f30c
| * Avoid recursion during QBluetoothDeviceDiscoveryAgent::stop()Alex Blasche2017-08-042-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QBluetoothDeviceDiscoveryAgent (DDA) is deleted by QBluetoothServiceDiscoveryAgent (SDA) once it receives an error or SDA is instructed to stop() the discovery process. Currently, this triggers at least two calls to the DDA's stop() function. In addition, if stop() generates an error the error call itself will call back to DDA:stop(). Therefore it create an endless loop back. This is at least true for the Android devices mentioned in the related bug report. This patch ensures that the main logic of Android's DDA::stop() is not called more than once. Further more SDA disconnects from DDA's signals to avoid a potential endless loop. Any error in DDA is not of relevance to the surrounding SDA instance anymore. Task-number: QTBUG-60131 Change-Id: I1df16f2b0896928833aa2ced75c43d4642b4fba3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * winrt: Fix crash in QBluetoothServer::nextPendingConnectionOliver Wolff2017-08-041-0/+2
| | | | | | | | | | | | | | | | If there are no pending connections, the call should not make the application crash but just return nullptr. Change-Id: I33c2ec9b47bbb72abc99ad22035f794724b295ef Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * winrt: "Fix" tst_qbluetoothlocaldeviceOliver Wolff2017-08-041-1/+14
| | | | | | | | | | | | | | | | | | | | Reflect the default values that are different on winrt in the auto test. Obtaining the pairing status for given devices is possible on winrt, so as soon as QTBUG-62294 is fixed, this change can be partly reverted. Task-number: QTBUG-62294 Change-Id: Iceed8086f29c0f0c4859f2d86a16c2b3a9eeaffa Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * winrt: Fix tst_QBluetoothServerOliver Wolff2017-08-041-0/+2
| | | | | | | | | | | | | | | | We cannot obtain information about local bluetooth devices on winrt. Change-Id: I7805b68bff38a2a2d049619742880db5bd8d3cef Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * winrt: Make tst_QLowEnergyController pass if no remote device was givenOliver Wolff2017-08-041-1/+5
| | | | | | | | | | | | | | | | Same as on other platforms initTestCase should return early if no remote device was passed via environment variable. Change-Id: I0b45b9be6247e55c890e6d151541ab034eefa467 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * winrt: Check for valid m_socketObject before accessing socket informationOliver Wolff2017-08-021-0/+15
| | | | | | | | | | | | | | | | | | | | If the socket was created without giving the socket type, ensureNativeSocket was not called and thus m_socketObject is 0. Calling localName and friends caused a crash because they accesses the object unconditionally. Change-Id: I442e3d1492458161fb8660f1b2f17d52b37a2935 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * Use QSharedPointer::create() moreMarc Mutz2017-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | This is the result of running the (experimental) clang-tidy check qt-modernize-qsharedpointer-create Discarded changes: none. Change-Id: I58a0f230516e836df62b40cf8ec38a6b3d7122db Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Ensure that QLowEnergyController::RemoteHostClosedError is emittedOliver Wolff2017-08-021-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | As there is no Windows API to disconnect from a BTLE device, we just set the internal state in QLowEnergyController::disconnectFromDevice. By removing the callback registration in disconnectFromDevice we can be sure, that every state change from connected to disconnected is caused by the remote host closing the connection and thus implement RemoteHostClosedError. Change-Id: I7dcacaffce68784cb297b02df2e9f9356bf14d9d Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | Merge remote-tracking branch 'gerrit/5.9' into devAlex Blasche2017-07-265-43/+142
|\| | | | | | | Change-Id: Ida3681a873698f22c28bc60230ca0c49d2a9d25f
| * Windows: Fix namespaced buildOliver Wolff2017-07-264-10/+12
| | | | | | | | | | Change-Id: I9f6a7c3884c2d7c9b0856a0e9a689ad88cca59fe Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| * Android: Avoid hanging in desc or char read during service discoveryAlex Blasche2017-07-181-4/+5
| | | | | | | | | | | | | | | | | | | | | | If the last entry of a service is a descriptor or characteristic and the read attempt fails early (the read could not even be initiated) ensure that the discovery state machine properly exists. So far the exit was only ever triggered by a successful read or if the async callback for the read returned with an error or timed out. Change-Id: I495982a82819aab985bc91a7e63c530b52355d9d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Add ability to negotiate the MTU on BTLE AndroidAlex Blasche2017-07-181-29/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are cases where peripherals use a larger MTU than the default MTU on Android. This forces the MTU negotiation to always been done once the service discovery has been done. This patch requires Android API v21 (or Android v5+). If the local Android version is below 5 this feature becomes a noop. The related bug cannot be addressed on Android version below 5.0. Task-number: QTBUG-61755 Change-Id: I6521b5dad05da5e3e533ef2af56ee649b1b79730 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * BTLE (CoreBluetooth) - prospective fixTimur Pocheptsov2017-07-162-8/+2
| | | | | | | | | | | | | | | | | | | | The type of manage.state has changed on macOS (like on iOS before), making an declataion invalid. (cherry-picked from qtconnectivity/0c3cc5374d2703fde6a99d301fcff974122d057d) Change-Id: I55caa32fa9f0a85090506cfbd788c1a80d41e8ce Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Use Bluez's SetDiscoveryFilter to control the device discovery methodAlex Blasche2017-07-243-6/+38
| | | | | | | | | | | | | | Task-number: QTBUG-57575 Change-Id: Ia289bcb1e0172e74bbda7f4b2dbc904ca1f5a856 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Provide means to select the Bluetooth discovery type on BlueZAlex Blasche2017-07-243-10/+21
| | | | | | | | | | | | | | | | | | This is an addition since BlueZ 5.30. Task-number: QTBUG-57575 Change-Id: Ib24702ac91ee55e5e0511d93cd9bd43937c0edb1 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Enable default services for all central use cases on BlueZAlex Blasche2017-07-201-3/+3
| | | | | | | | | | | | | | | | | | | | Qt 5.9 introduced this behavior change as part of a bug fix. Qt 5.10 will force the new behavior unless otherwise requested by the user. Task-number: QTBUG-61554 Change-Id: I75a2107c64e0eaaf03490658669c9a23ac7dcf63 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Make bluez compile test pass againAlex Blasche2017-07-192-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compiler error is: In file included from main.cpp:29:0: main.cpp: In function 'int main()' main.cpp:33:11: error: taking address of temporary [-fpermissive] bacmp(BDADDR_ANY, BDADDR_NONE); ^ main.cpp:33:23: error: 'BDADDR_NONE' was not declared in this scope bacmp(BDADDR_ANY, BDADDR_NONE); BDADDR_NONE only exists in Linux iBluetooth kernel headers but not in the Bluez project headers. Furthermore the usage of the BDADDR_* defines is known to trigger -fpermissive violations. For the prupose of this test fpermissive is not relevant as the test is never executed and the focus is in checking the existence of the very same defines. Change-Id: I56db5406ec91fdd5e7998cac4900ee9f9b628c00 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
* | iOS: Do not include qlowenergycontroller_p.cpp if not neededAlex Blasche2017-07-181-3/+1
| | | | | | | | | | Change-Id: Icdd0c9421f4894a7f84b69d31d4de440900f3d39 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Add support for QBluetoothSocket::RemoteHostClosedError on BlueZAlex Blasche2017-07-122-1/+7
| | | | | | | | | | | | Change-Id: I88ff16001280dea4967887ae711c463304c7ec7d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | BTLE (CoreBluetooth) - prospective fixTimur Pocheptsov2017-07-112-8/+2
| | | | | | | | | | | | | | | | The type of manage.state has changed on macOS (like on iOS before), making an declataion invalid. Change-Id: I55caa32fa9f0a85090506cfbd788c1a80d41e8ce Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | LE/Android: Handle "connection reset by remote device" errorsKonstantin Ritt2017-07-101-0/+6
| | | | | | | | | | Change-Id: Iaaa79b2f14e7abd5d849895301ed404efa079f07 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Add support for QBluetoothSocket::RemoteHostClosedError on Win UWPAlex Blasche2017-07-101-1/+4
| | | | | | | | | | Change-Id: I6503377cd99d403ff31a2eae8109476294cbebac Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Add debug output for QBluetoothSocket::UnsupportedProtocolErrorAlex Blasche2017-07-102-0/+6
| | | | | | | | | | | | | | Change-Id: Ia68da10c26ed0baff95a1f696b5a248595d23b1d Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Add error flag for use case when the remote peer closes the connectionAlex Blasche2017-07-105-0/+11
| | | | | | | | | | | | | | | | | | | | [ChangeLog][QtBluetooth][QBluetoothSocket] Added QBluetoothSocket::RemoteHostClosedError. Change-Id: Ic9d27f9188f66be0fad309e55f2904eaed2cf61a Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | QLowEnergyController: introduce ConnectionClosedErrorKonstantin Ritt2017-07-102-0/+6
| | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-07-0650-128/+10076
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I7a55929aefa1f7a4dc96f841317b78b248899f67
| * winrt: Do not emit canceled in timeout case in device discoveryOliver Wolff2017-07-042-17/+1
| | | | | | | | | | | | | | | | | | canceled should only be emitted if stop was used to abort a running device discovery. A timeout happening has to cause a normal finished. Change-Id: I1072c14a44b84da0cb93420cf7344b8bc56b523e Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * lowenergyscanner: Use new connect syntaxOliver Wolff2017-07-041-18/+18
| | | | | | | | | | | | Change-Id: I87047bbc8b777f597ac4843c0c5466489d764f46 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Merge remote-tracking branch 'origin/5.9.1' into 5.9Liang Qi2017-06-301-0/+67
| |\ | | | | | | | | | Change-Id: Ie41f06095d87c46bb4d64e38bdbeab7646fe2470
| | * Add changes file for 5.9.1v5.9.1Alex Blasche2017-06-231-0/+67
| | | | | | | | | | | | | | | Change-Id: I45ca861c02b6d0016441dee3407995ba7ed1c182 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
| * | Bump versionOswald Buddenhagen2017-06-301-1/+1
| | | | | | | | | | | | Change-Id: I4fdc8d221610589caa2d31b3ccc55ebc17f9fff8
| * | Update binary compatibility files for Qt 5.9.0 for QtConnectivityMilla Pohjanheimo2017-06-302-0/+9100
| | | | | | | | | | | | | | | Change-Id: I18c0cec1823cc827784c10e8e5bf3ab2ff754580 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
| * | Update doc for QBluetoothDeviceDiscoveryAgent::deviceDiscovered()Alex Blasche2017-06-291-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lowEnergyDiscoveryTimeout affects the emission behavior of deviceDiscovered(). This behavior change should be explicitly documented. Task-number: QTBUG-57847 Change-Id: I94bd7cb36935b376c34ba90f5de4e3084e87e883 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | Device discovery (CoreBluetooth): report duplicates in case LE scan has ↵Timur Pocheptsov2017-06-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | timeout 0 If we have a never-ending LE scan, we should report even complete duplicates. The original bug-report has a scenario with a long-running application, that records a data from BTLE scales once a day. Task-number: QTBUG-57847 Change-Id: If5e4828f119d5f4e4418cfe60fa518b583210a14 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * | Continuously emit deviceDiscovered() signal during never-ending dev discoveryAlex Blasche2017-06-292-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the user chooses to do a BTLE device discovery with QBluetoothDeviceDiscoveryAgent::setLowEnergyDiscoveryTimeout being set to 0, we should continuously emit the deviceDiscovered() signal and not only once per device. This patch checks the timeout value before triggering the duplication detection for deviceDiscovered() signals. Task-number: QTBUG-57847 Change-Id: I0e43b779a89b918640fe3d812d2500ed0a016cc3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | Android: Do not emit QBluetoothSocket::bytesWritten() if write() failedAlex Blasche2017-06-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QBluetoothSocket::write() emits the bytesWritten(int) signal when the write was successful. java.io.OutputStream.write() returns an exception when it fails. We should not emit bytesWritten() if such an exception occurred. Change-Id: I76e7a85188102e8227d586450c3e733c046e9957 Reviewed-by: Christian Stromme <christian.stromme@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * | Add indirection for QBluetoothSocket::bytesToWrite()Alex Blasche2017-06-296-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not all platforms use txbuffer for writes. Fortunately those platforms who do not use it do not use any buffering at all. Hence bytesToWrite() returned the correct value as txbuffer always had size zero. Therefore this patch is effectively a NOP. Nevertheless this patch encourages the right implementation across the platform. This does not affect macOS as it has a separate implementation for QBluetoothSocket::bytesToWrite(). Task-number: QTBUG-58190 Change-Id: Ic05f4358b079f612ee7e0e4dbb7fb9aa78fd6556 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * | Btchat example should be fullscreen on mobileAlex Blasche2017-06-291-0/+4
| | | | | | | | | | | | | | | Change-Id: Ib311037a4ccf147dcd083ff13c327e29e0dc08f4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | Fix concurrent access to QBluetoothSocket::canReadLine() on AndroidAlex Blasche2017-06-298-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Android, the socket's read buffer is managed in the Java thread. QBluetoothSocket::canReadLine() is public API (most likely) being called by in the main Qt thread though. The function directly called into the Java buffer instance without proper locking. This can create race conditions. Starting with this patch canReadLine() calls another QBluetoothSocketPrivate indirection to allow a platform specific implementation. This affects WinRT, BlueZ and the dummy backend too. This is not an issue on macOS as its implementation of QBluetoothSocket is separate and does not have to deal with multiple QBluetoothSocketPrivate implementations. Task-number: QTBUG-58190 Task-number: QTBUG-60830 Change-Id: Idae19f1aee6f809699d36519b01a3c68ad9c563d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * | Adjust btchat example to Android UUID SDP discovery bugAlex Blasche2017-06-282-0/+15
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-61392 Change-Id: Ia7d680a40b0fe359dfb5fe69ad9f3e83fe9ccb7d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>