summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | winrt: maxPendingConnections must be lower than currently pending connectionsOliver Wolff2017-02-031-0/+6
| | | | | | | | | | Change-Id: Ie14506c0ad648413019c511d4d39dc8bd43d7405 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Document that BT servers on Android and WinRT only support RFCOMMOliver Wolff2017-01-311-0/+1
| | | | | | | | | | Change-Id: Ic93d086cc6b6549e8de90f01a0bba5913207d7e5 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Add bluetooth server supportOliver Wolff2017-01-317-8/+682
| | | | | | | | | | | | Task-numer: QTBUG-37779 Change-Id: Ieb3ed5dfea7d60b3875cbe97bb26f8060bebcc17 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | winrt: Fix wrong function name in invokeMethod in bluetooth socketOliver Wolff2017-01-301-1/+1
| | | | | | | | | | Change-Id: I9fd9131c031328afa936a52e42371409e3fbac48 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | Remove wrong attribute assignment from btchat exampleOliver Wolff2017-01-301-1/+0
| | | | | | | | | | Change-Id: If6695194644fa0eceec80808115fd09af895a220 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | winrt: Fixed reading of string attributes in sequencesOliver Wolff2017-01-301-1/+4
| | | | | | | | | | Change-Id: I063668f9b95b95aa15a736b80e11d81c15cd1730 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | Allow using nfc when running as a serviceLars Schmertmann2017-01-271-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | With this change it will be possible to use a tag injected from outside when running as a service. Intent newIntent = new Intent(); newIntent.putExtra(NfcAdapter.EXTRA_TAG, tag); QtNative.onNewIntent(newIntent); Task-number: QTBUG-57646 Change-Id: I628d4357f023a0926e7d61914b39278342ac7161 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Implement QLEService::writeCharacteristic() for Android peripheralAlex Blasche2017-01-272-25/+230
| | | | | | | | | | | | | | | | | | | | | | This includes the correct handling of client characteristic notifications (CCNs). As per Bluetooth spec this descriptor is unique for each device. If a characteristic was changed all chars with enabled CCNs are notified. CCN settings are even retained while the remote device is not connected. Change-Id: Iec612e6a5e70206a6be0263e10e615c26def7559 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Avoid app crash on android when using nfc within a serviceLars Schmertmann2017-01-261-0/+2
| | | | | | | | | | Change-Id: I28a165c7b7503b1c8159dd0c46f3f7450e599c74 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Fix a lot of minor issues in the new Android peripheral backendAlex Blasche2017-01-244-13/+13
| | | | | | | | | | | | Change-Id: I3aa89926c5237ee8da18b73f66f0c7a321a83c91 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Android: Implement QLEService::descriptorWritten() signals for peripheralAlex Blasche2017-01-246-0/+99
| | | | | | | | | | Change-Id: I60e5bdce4256804754909c2538aebe581897e1e9 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Android: Implement QLEService::characteristicChanged() for peripheral modeAlex Blasche2017-01-246-3/+87
| | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-242-4/+37
|\| | | | | | | Change-Id: I9684e4cc76336250b235a261fdc8924a2ca70086
| * Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2017-01-181-2/+2
| |\ | | | | | | | | | Change-Id: I6b8a6bdcc849b76a596d17d3b15e8e1efa58a28c
| | * Fix reference to macOS in the 5.7.1 changelog5.7Jake Petroules2016-12-081-2/+2
| | | | | | | | | | | | | | | | | | | | | This amends d884d20c5530b67fbd2fba35cdb71a9f969196be Change-Id: I6f600ed7739f698405076fb567bc71174e205125 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | [REG] LE/Android: report ServiceDiscovered for an empty services as wellKonstantin Ritt2017-01-161-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | a regression has been introduced by the service discoverer refactoring, causing an empty service to stuck in DiscoveringServices state for ever Change-Id: I1d339279e77f5409231d5fbd3677f9e2eb98a0a8 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * | Improve likelyhood that BluetoothGatt.connectGatt succeedsAlex Blasche2017-01-131-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dreaded GATT_ERROR 133 (0x85) is a long standing issue in Android. There have been continued efforts to reduce it up until Android N: https://code.google.com/p/android/issues/detail?id=192561 Tests have shown that the new BluetoothGatt.connectGatt() overload is much more reliable. Android v23+ gets some relief and Android v21+ gets unofficial/hidden relief. Reports indicate that error 133 is timeing related. While the new connectGatt() call seems to resolve this problem it is throwing the timeing related error 22 more proactively. Very quick connect()/disconnect()/connect() calls can cause the error. The patch adds a more specific error code handling for error 22 to provide some hints on what the user can do to prevent it. Task-number: QTBUG-56078 Change-Id: Ib14d503701cee7ea766247b712106302cba896f3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Android: Implement descriptor and char read/write for peripheralAlex Blasche2017-01-231-5/+85
| | | | | | | | | | | | | | | | | | Change-Id: I0fed368384fbfd4e9e8be74b7a586cbf2ed10218 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-236-0/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-234-4/+92
| | | | | | | | | | | | | | | | | | Change-Id: Id2cabd9df7b5387fe5e6f1c898fe02e40f7c0a3d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Setup descriptor permissions for Android peripheralAlex Blasche2017-01-231-6/+85
| | | | | | | | | | | | | | | | | | Change-Id: Id40033b0745a720466a8466ad3c82ad804cadd9c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Setup characteristic permissions for Android peripheralAlex Blasche2017-01-231-4/+66
| | | | | | | | | | | | | | | | | | Change-Id: I32a3c4c711ac62ee89570534ae8c658a681bbdb8 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Android: Add access to BTLE connection parametersAlex Blasche2017-01-234-9/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, Android only provides access to a very generic connection priority. The patch uses the minimalInterval() to determine the desired priority. Everything below 30ms is high priority and everything above 100ms is low priority. Every other value is balanced priority. QLowEnergyController::requestConnectionUpdate() was modified to permit access when the controller is connected, discovered or in the process of being discovered. The limiting factor is an existing physical connection. The documentation was updated to reflect Android's API limitations. [ChangeLog][QtBluetooth][Android] Added access to BTLE connection parameter settings. Task-number: QTBUG-53476 Change-Id: I3e22c65bd9598296a9219463dd05f0d9fc73599d 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-236-11/+233
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Connect QtBluetoothLEServer class to Qt's QLowEnergyController APIAlex Blasche2017-01-232-18/+37
| | | | | | | | | | | | | | | | | | Change-Id: I4403a9d5c79fae2c6bbe9c478660ead01dc16fe4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Protect Android Gatt code behind version checksAlex Blasche2017-01-231-13/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Android Bluetooth LE Client support requires API v18 and Server support requires API v21. In fact earlier releases of Qt did not actually catch the v18 border at all. It excisted since Qt 5.5 already. Change-Id: I9baabf5138b2b0d48f8d09670c4feeef688681fd Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Android: Beginnings of Android Bluetooth Peripheral supportAlex Blasche2017-01-235-9/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Focus is on the Java side of things. The Gatt server & LE advertiser can be started and stopped. This patch builds the foundation for future changes. The C++ side is only very rudimentary and a lot of debugging helper are left inside the new code sections. Change-Id: Ic56da3ec6471ccb438fc2088fbf5eeb3053d5cf1 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | winrt: Add bluetooth socket supportOliver Wolff2017-01-204-4/+711
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-37779 Change-Id: I7fb49a6870768da956793b0d0681c371da939df9 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | winrt: Add service discoveryOliver Wolff2017-01-204-1/+635
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Windows 10 SDK versions < 14393 full service discovery is not supported. While GetRfcommServicesWithCacheModeAsync enables us to specify the lookup mode get_RfcommServices only returns cached services. To be able to offer some functionality for older version we use its results but give a warning about the limited abilites of this API in case of full service discovery. Task-number: QTBUG-37779 Change-Id: I21a15f8bb1d058780c8322ece2c3d9a285ecab25 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | | winrt: Minor adjustments to QBluetoothLocalDeviceOliver Wolff2017-01-192-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The WinRT API does not provide functionality to obtain the state of the devices host mode. In order to make the examples (for example btscanner) work in winrt, the hostMode defaults to HostConnectable and the local device is always valid on this platform. Additionally the API only enables us to discover paired devices, so every device that is found, has to be in "Paired" state. Change-Id: I32359d0defdb9f8e1cc1a629d32da1214a669aff Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | | winrt: Fixed null ptr access in LE device discoveryOliver Wolff2017-01-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some devices DeviceInformation is null. These cases should not lead to a crash so we just ignore these devices. Change-Id: I9f55b6931c9790b4bdfe217fd506229d2125b78b Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | | QNearfieldTarget: Introduce (set)keepConnection() and disconnect()Lars Schmertmann2017-01-188-101/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the communication with a German ID card its required to execute several commands in a row, whereby a state is generated. Every command works on the state created by the command before. Depending on the Android version the state gets lost when the connection is closed. With this change it is possible to keep the connection as long as needed and close it manually. Because of backward compatibility the connection is created and closed automatically by default. With the use of setKeepConnection(true) the communication with the target is also a lot of faster. [ChangeLog][QNearfieldTarget] Introduce (set)keepConnection() and disconnect() to keep the state of a target and speed up communication. Change-Id: I5778c9bdaf04cfeae78b3222bef4475f4cd7c436 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Avoid code duplication by using checksum calculation from qtbaseLars Schmertmann2017-01-144-35/+20
| | | | | | | | | | | | | | | | | | | | | | | | Since qtbase supports checksum calculation defined in ITU-V.41 an own implementation is not longer needed. Change-Id: I0f62c872b4fb517493ba43a9bb7a6d35481fa40d Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | BTLE - prefer advertised name (CoreBluetooth)Timur Pocheptsov2017-01-131-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Invert CoreBluetooth's naming priorities: CoreBluetooth prefers the device's GAP name over advertised name; we instead give the higher priority to advertisement data (CBAdvertisementDataLocalNameKey). [ChangeLog][QtBluetooth] Prefer advertised name if set Task-number: QTBUG-58080 Change-Id: If40687c9c1de50986f61d5e6134001621bc5030b Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Merge remote-tracking branch 'gerrit/5.8' into devAlex Blasche2017-01-1318-303/+699
|\| | | | | | | | | | | Change-Id: Ia02a13525cadcb02d99c546ed84cfb34e69523c9
| * | Add characteristic even if the read failsChristian Wassmuth2017-01-121-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If during discovery the read of a characteristic fails, then this characteristic was not added to the service. This happens in a special case and not always, when we try to read from a notify only characteristic. Now the characteristic will be added even if the read fails. Task-number: QTBUG-58056 Change-Id: Ib802eeb66aeae92da690c296faf57331123353e6 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * | Prevents a nil exception, if a descriptor read fails during discoveryChristian Wassmuth2017-01-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | During discovery, if a descriptor read fails the current implementation tries to read from a nil bytearray. Now the bytearray is checked before access. Change-Id: Ic04809fa81c25c7abdd8a82a1ccefe43de7f5605 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * | Android: Fix incorrect device search type bit flag testAlex Blasche2017-01-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are testing bit flags and don't require a logical AND. [ChangeLog][QtBluetooth][Android] Fixed incorrect bit flag test. This caused QBluetoothDeviceDiscoveryAgent to always request Location permissions even when only a classic device search is needed. Change-Id: I6d6bd63da9a002bcec430e1ce90d0f13d153fe9c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | Do not request an unnessessary dangerous rightLars Schmertmann2017-01-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bluetooth LE discovery needs ACCESS_COARSE_LOCATION permission since android 6.0. In the manifest file it is possible use it by "<uses-permission-sdk-23 android:name="ACCESS_COARSE_LOCATION" />" in general. But the bluetooth LE discovery requests it for every android version. This change enables the request for android > 6.0 only (API-Level >=23). Task-number: QTBUG-58085 Change-Id: I78ad2fe83eb16eaf45813137335f85c7b3930992 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
| * | disconnectFromDevice now stops advertisement in peripheral roleTimur Pocheptsov2017-01-051-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only thing we can do on macOS/iOS - call stopAdvertising (we have nothing to disconnect from with CoreBluetooth). Also, remove a really weird warning. Change-Id: I589bdb819468fc659a9ed3e68170dc498ffc8cd9 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * | Bluez: Stop advertisement once Bluez Peripheral disconnectFromDevice()Alex Blasche2017-01-042-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although this was not explicitly documented this is the behavior that the associated heartrate example exhibits. This change ensures that it is documented and enforced. [ChangeLog][QtBluetooth][BlueZ] Fixed continued advertisement of peripheral data once QLowEnergyController::disconnectFromDevice() was called. Public documentation was added to publically state the behavior. Change-Id: I3678c92fbb0d12cca17cd65ef7566a3ae4b55dc2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * | Bump versionOswald Buddenhagen2017-01-031-1/+1
| | | | | | | | | | | | Change-Id: I96679cba0d6ac0e02036dc587289c4037c3cf32b
| * | Android/LE: handle GATT status 8 (link loss)Konstantin Ritt2017-01-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | May occur relatively too often to remain unhandled Change-Id: I89b1255605a29d959635e8d1965e9596b591b305 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * | LE/Android: Fix crash due to references leakKonstantin Ritt2016-12-301-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in f945ffc90f8f11d73dc87f2d82bb2d246d446e71, a very basic scanRecord parser has been added, which calls GetByteArrayElements without releasing the elemnts, causing JNI core exception > E/dalvikvm: Failed adding to JNI pinned array ref table (1023 entries) Change-Id: I272593c232f0c87c1983f1f568aa6c3599d44253 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | Prevent stalling of Linux central BTLE implementationAlex Blasche2016-12-152-3/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Merge branch '5.8.0' into 5.8Alex Blasche2016-12-1413-294/+528
| |\ \ | | | | | | | | | | | | Change-Id: Ic04b8dc00f754fb85f50209c822c2f3734fbf99e
| | * | Android: Workaround buggy BT implementationv5.8.0-rc1v5.8.0BogDan Vatra2016-12-081-38/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some devices (e.g. HTC 10) calling BluetoothAdapter.getDefaultAdapter() always fails first time. Task-number: QTBUG-57489 Change-Id: I3a22a831f9a13d880756b598c408ab21a0f52126 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | * | Android: Fixed crashBogDan Vatra2016-12-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getDefaultAdapter might fail and it will throw an exception if the bt is not turned on, we must clear all pending exceptions otherwise next java call will crash the application. Task-number: QTBUG-57489 Change-Id: I191247528065acb3cdc4f6c0d36371ebf9f2e2c8 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | * | Don't use "socketChannel" if the "getServiceChannel" call failedBogDan Vatra2016-12-081-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getServiceChannel() does not exist on more recent Android platforms. The JNI call returns an exception and socketChannel is either 0 on debug or undefined in release builds. The previous code did not reliably recognize the case "0" (debug) or "random int" (release) as an error state and hence channel variable was overridden with wrong value. Change-Id: Ia81219376661be3fbbe0c9122f707bb82defa946 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | * | winrt: qRegisterMetaType for QLowEnergyCharacteristic/QLowEnergyDescriptorOliver Wolff2016-12-072-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>