summaryrefslogtreecommitdiffstats
path: root/src/android
Commit message (Collapse)AuthorAgeFilesLines
* Android: Re-use `pendingJob` storage introduced by 962f282d21e62b8dKonstantin Ritt2020-03-241-16/+14
| | | | | | | | to make the code less error prone Change-Id: I429bf367c9d44f24356f4ee70c0f6045b0557604 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Android: Fix out-of-sync access introduced by 962f282d21e62b8dKonstantin Ritt2020-03-241-1/+2
| | | | | | Change-Id: Id45e5ed41bf97dc9940c5047e4e7a046e65d62bd Reviewed-by: Thiemo van Engelen <tvanengelen@victronenergy.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix a race condition between a write and an incoming changeThiemo van Engelen2020-03-031-36/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Android API that is available to write to a characteristic requires the user to first set the new value of the characteristic and then tell Android to write the value to the device. If the phone processes an incoming change for this same characteristic in between the setting of the value and the actual write, it could happen that the characteristic gets the incoming value and that incoming value is then sent to the connected device. Something similar could occur for the incoming change as the received value is not passed in the callback but it is set on the characteristic and the user is expected to read the received value from the characteristic. To prevent these problems, a new connectGatt function that takes a Handler as extra argument was added to SDK v26. The callbacks are then always executed via this handler and thus on the associated handler thread. If the user also performs all writes on this thread, the described race condition can no longer occur. This could have solved the problems, but Android 8.0 contained a race condition in the callback part because it set the value of the characteristic before passing the callback to the handler, still allowing the same race condition for incoming changed. This was fixed in Android 8.1. This commit causes the code to use a Handler and the new connectGatt function if it is running on SDK >= 27, which is associated with Android 8.1. For older SDK versions, a different solution is implemented. In this case, a temporary BluetoothGattCharacteristic is instantiated that can hold the value to be written. This way, the write can no longer interfere with changes that are being received. To instantiate the BluetoothGattCharacteristic, a private constructor is invoked using reflection. This private constructor is needed as only this constructor allows to create an instance that has the required information for Android to be able to write to the charatceristic (such as the associated service and instanceId). This is also the reason why this solution cannot be used on newer SDK's as this constructor is blacklisted and a warning box will be shown when reflection is used to get a reference to it. Because a temporary BluetoothGattCharacteristic is instantiated that holds the written value, it is necessary to store the value that was written and pass that in the callback. More information on these Android issues and solution direction can be found here: https://stackoverflow.com/questions/38922639/how-could-i-achieve-maximum-thread-safety-with-a-read-write-ble-gatt-characteris https://medium.com/@martijn.van.welie/making-android-ble-work-part-3-117d3a8aee23 Change-Id: I5a9eda501a20933e37f758a3114bf71ec3e7cfd4 Reviewed-by: Thiemo van Engelen <tvanengelen@victronenergy.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Catch turned off Bluetooth adapter when stopping LE discoveryAlex Blasche2020-02-201-1/+7
| | | | | | | | | | | Calling stopLeScan() causes a runtime exception. The patch prevents a crash due to the exception and progresses as if nothing has happened. An action that turned off the internal Bluetooth device has stopped a runnung discovery anyway. Fixes: QTBUG-67482 Change-Id: Iff377884c50cafa1f74dafe73e0acbb31b13e9bb Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Android: Fix failing re-addvertisement of BTLE service after disconnectAlex Blasche2019-12-101-1/+3
| | | | | | | | | | | | | | The BTLE server can disconnect by own choice and by remotely initiated disconnect. Often the app might want to readvertise the same service right after the disconnect. Such a readvertisement fails when the BluetoothGattServer instance is not recreated, before calling BluetoothGattServer.addService(). In the case of remote disconnects we never recreated the BluetoothGattServer instance therefore the readvertisement always failed. This patch fixes the issue by ensureing the previous instance is properly discarded. Change-Id: I39380ee6f1f39bd71a5b73ec82bb786b3e199665 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14v5.14.0-beta2Liang Qi2019-10-141-2/+9
|\ | | | | | | | | | | | | Conflicts: src/bluetooth/doc/src/bluetooth-index.qdoc Change-Id: If353b4ac63c72d6f94415e1349a206ade4ceb52e
| * Add descriptor even if the read fails during service discoveryAlex Blasche2019-09-271-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | leDescriptorRead() serves two pruposes. Firstly, it informs Qt of the value/result of the read operation. During service discovery it is also used to inform Qt that a descriptor was found. This info is used to build up the internal data structure representing the service, its characteristics and its descriptors. If we have a non-readable descriptor the read failed (as expected) and Qt was never informed about the existence of the descriptor. During service discovery the primary purpose is to inform about the existence of a descriptor though. This patch ensures the notification comes through and we accept the fact that the passed value is not known. Fixes: QTBUG-78201 Change-Id: Id73a27c90905cb769f1cd168b48299d580587594 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | LE/Android: better use of recently introduced AuthorizationErrorKonstantin Ritt2019-07-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | when Android receives GATT_INSUFFICIENT_AUTHORIZATION or GATT_INSUFFICIENT_ENCRYPTION, it breaks connection with fair reason GATT_CONN_TERMINATE_LOCAL_HOST, which shadows the original GATT_INSUFFICIENT_ENCRYPTION from the user. As we didn't see Android closing connection with GATT_CONN_TERMINATE_LOCAL_HOST in cases other than described above, naively treat it like AuthorizationError Change-Id: I43a19c9eaf793a595765850938d757a09324a545 Reviewed-by: Evgeniy Gagarin <eeiaao@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Remove use of deprecated btle device scan API on AndroidAlex Blasche2019-05-031-14/+40
|/ | | | | | | | | | | | The new API requires Android SDK v21 or higher and Qt 5.13 just raised the minimum API version to 21. The PendingIntent version of the same API cannot be used yet as it requires v24+. Fixes: QTBUG-67482 Change-Id: Ided02e36796ef66f0244934ef67262f1e6f69b8c Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Andrew Dolby <andrewdolby@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* LE/Android: add consistency check in method called from Qt APIKonstantin Ritt2019-03-191-0/+3
| | | | | | | | Call to includedServices() from Qt side after unexpected disconnection leads to NullPointerException due to unchecked member access. Fix that! Change-Id: Iae89801d7af86d5a3f34ebba9eb2ea12da252cd2 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* LE/Android: trivial typo fixesKonstantin Ritt2019-01-251-2/+2
| | | | | Change-Id: I2202fa305f4c50e97ae7701096b2f8e0bb9b3daf Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Check for system feature PackageManager.FEATURE_NFCAndré Klitzing2019-01-141-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Method enableForegroundDispatch and disableForegroundDispatch is not implemented on some WearOS devices and will throw an exception. Let's check if the NFC feature exists. java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at org.qtproject.qt5.android.bindings.QtApplication.invokeDelegateMethod(QtApplication.java:157) at org.qtproject.qt5.android.bindings.QtApplication.invokeDelegate(QtApplication.java:146) at org.qtproject.qt5.android.bindings.QtActivity.onResume(QtActivity.java:626) at com.governikus.ausweisapp2.MainActivity.onResume(MainActivity.java:139) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1355) at android.app.Activity.performResume(Activity.java:7117) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3556) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1638) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) Caused by: java.lang.UnsupportedOperationException at android.nfc.NfcAdapter.enableForegroundDispatch(NfcAdapter.java:1315) at org.qtproject.qt5.android.nfc.QtNfc$1.run(QtNfc.java:135) at android.app.Activity.runOnUiThread(Activity.java:6184) at org.qtproject.qt5.android.nfc.QtNfc.start(QtNfc.java:111) at org.qtproject.qt5.android.QtNative.updateApplicationState(Native Method) at org.qtproject.qt5.android.QtNative.setApplicationState(QtNative.java:260) at org.qtproject.qt5.android.QtActivityDelegate.onResume(QtActivityDelegate.java:1098) ... 16 more See: https://stackoverflow.com/questions/48437854/huawei-watch-2-nfc-feature-not-available-android-wear-2-0 Change-Id: I0e2cad3dce1c3c0a2ea2545fcc6731e2621cdc38 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix minimal Android version for NFC (needs v18)Alex Blasche2018-07-271-0/+1
| | | | | | | | c8e6dae2d9749179327df460755282cf5102e902 introduced this requirement. Change-Id: If0b20a666d6dad999db05dfe311b0ed75aa333ff Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Use Android broadcast ACTION_ADAPTER_STATE_CHANGEDLars Schmertmann2018-05-302-1/+74
| | | | | | | | To avoid polling of the NFC adapter state a signal is added to the QNearFieldManager. Change-Id: If9e1e8025cca2deb1338fa7db255ebe171cab823 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-05-011-12/+27
|\ | | | | | | Change-Id: Ia496130e0d71a85670af3ca1cadf81c71d3c2462
| * Fix crash when entries is empty (caused by disconnect somewhere else)Alex Blasche2018-04-301-12/+27
| | | | | | | | | | | | | | | | | | | | The patch fixes the obvious problem of the crash. The question is however what might have caused entries to be empty. The only theoretical explanation is the remote device being disconnected (which resets most internal data). Task-number: QTBUG-65826 Change-Id: I6b3509248f795d9cee5dcfe0c6e0caf06405b4e4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-241-6/+23
|\| | | | | | | Change-Id: I1cb008cda8abe9a4167f3f62f003583141d217c1
| * Android: Fix start/stop behavior of QLowEnergyController (peripheral)Alex Blasche2018-04-171-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch addresses two bugs. Firstly it ensures that the correct Java function is executed when disconectFromDevice() is called on Android peripheral. Secondly, it turned out that calling disconnectFromDevice() while a connection to a central exists and restarting the advertisement resulted in a non-functional QLEController instance because BluetoothGattServer was not properly restarted. As a side effects the controller's state tracking stopped as well. Change-Id: I98851fc974ceff2a1fcb03fe754dbda9c4aba271 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-171-0/+9
|\| | | | | | | Change-Id: Ib695b1c1e59904f65bf60f0fe9878483e608e737
| * Android: Fix QLEController's remoteName() and remoteAddress()Alex Blasche2018-04-161-0/+9
| | | | | | | | | | | | | | | | The values were never obtained on the Java side. Task-number: QTBUG-67651 Change-Id: Ifceb124b07cf505c4e96fe7ba9d58364b3923c3a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Add NFC API method isSupportedAndrew O'Doherty2018-03-151-0/+5
|/ | | | | | | | Add API method isSupported to allow to check if the device supports NFC Task-number: QTBUG-62169 Change-Id: I4ff7f06348ecc902e66ee79bdd8abde672578904 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Android: remove support for local/debug deploymentJake Petroules2017-09-068-43/+32
| | | | | | | | | | | | | | | This removes the pre-dexed JAR files activated by the absence of the bundled_jar_file CONFIG option, as versions of Android >= 5 no longer support this deployment mechanism. Now, the "bundled" JARs simply become normal JARs containing class files, and are neither activated by a bundled_jar_file CONFIG entry nor do they have a -bundled suffix in the file's base name. Task-number: QTBUG-62995 Change-Id: Ifc13542ff71844da7e80cefe9ff51e3d7cdfc830 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Merge remote-tracking branch 'gerrit/5.9' into devAlex Blasche2017-07-261-33/+130
|\ | | | | | | Change-Id: Ida3681a873698f22c28bc60230ca0c49d2a9d25f
| * 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>
* | 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>
* Handle Android's BluetoothGatt.GATT_FAILURE in QLowEnergyControllerAlex Blasche2017-06-161-0/+2
| | | | | | | | | The above error code is the equivalent of Android's Unknown error. Therefore we map the code to QLowEnergyController::UnknownError. Task-number: QTBUG-61321 Change-Id: I614c1557c453cd5426f5fa0af69011c4e768657b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Work around Android security permission bug when reading GATT fieldsAlex Blasche2017-04-251-2/+14
| | | | | | | | | | Android throws a security exception (BLUETOOTH_PRIVILEGED) when reading HID services. Since the permission is not available for 3rdparties this is never obtainable by apps. We need to skip over those cases. Task-number: QTBUG-59917 Change-Id: I09b55740287812b0697b857d7eb8a77190d36e44 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Merge remote-tracking branch 'origin/5.8' into 5.9v5.9.0-beta3Liang Qi2017-04-181-2/+2
|\ | | | | | | | | | | | | Conflicts: src/bluetooth/qbluetoothsocket_bluez.cpp Change-Id: I37e21b3c636a241a357bc81fc23da51303b94623
| * LE/Android: fix status code descriptions5.8Konstantin Ritt2017-04-101-2/+2
| | | | | | | | | | Change-Id: Iee2f8e02a926129dfdd1c82d0fa84dfbb45303d3 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Fix detecting simple NFC tagsOleg Evseev2017-03-311-6/+9
| | | | | | | | | | | | | | | | | | Before this patch Qt NFC detects only NDEF tags and signals targetDetected/targetLost are never fired for simple tags Task-number: QTBUG-59455 Change-Id: Ic868b6d66f35f790f6aba0ec30afc96fa32a5b6a Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Oleg Evseev <ev.mipt@gmail.com>
* | Provide support for QLEService::writeDescriptor() on Android PeripheralAlex Blasche2017-02-061-0/+38
| | | | | | | | | | | | | | | | This permits the server itself to change descriptors at runtime. Change-Id: I5d60cfb1838ba83737cd748671520c7072201bc4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@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-271-4/+195
| | | | | | | | | | | | | | | | | | | | | | 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-241-1/+1
| | | | | | | | | | | | 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-241-0/+4
| | | | | | | | | | Change-Id: I60e5bdce4256804754909c2538aebe581897e1e9 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Android: Implement QLEService::characteristicChanged() for peripheral modeAlex Blasche2017-01-241-1/+4
| | | | | | | | | | | | | | | | | | 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-241-2/+35
|\| | | | | | | Change-Id: I9684e4cc76336250b235a261fdc8924a2ca70086
| * [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-231-0/+24
| | | | | | | | | | | | | | | | | | | | 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/+27
| | | | | | | | | | | | Change-Id: Id2cabd9df7b5387fe5e6f1c898fe02e40f7c0a3d 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-231-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-231-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | 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-231-16/+16
| | | | | | | | | | | | Change-Id: I4403a9d5c79fae2c6bbe9c478660ead01dc16fe4 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-232-2/+210
|/ | | | | | | | | | | | | 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>
* 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>