summaryrefslogtreecommitdiffstats
path: root/src/android
Commit message (Collapse)AuthorAgeFilesLines
* Android: Use default API version (16)BogDan Vatra2016-03-171-1/+0
| | | | | Change-Id: I4d125bbe7f18cb77dffc3747f33bba2b63b1a87d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Bluetooth LE: Add support for Signed Write command in the central role.Christian Kandeler2016-02-171-1/+3
| | | | | | Task-number: QTBUG-41175 Change-Id: I62d74236faf9161681306d952e409e23e0cea24d Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Updated license headersAntti Kokko2016-01-205-71/+101
| | | | | | | | | | 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>
* Merge QtNfc on Android into dev/Qt 5.6Alex Blasche2015-06-097-0/+195
|\ | | | | | | Change-Id: I18f2d2d75064dffc4f21c2a7034bb63fcc5008e6
| * Merge remote-tracking branch 'gerrit/5.5' into neardAlex Blasche2015-05-111-139/+276
| |\ | | | | | | | | | Change-Id: I066a9aca0120e7002c2506959bd80a08f96f4e65
| * | Add the feature to get the nfc intent that startet the appPeter Rustler2015-03-181-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To support this one have to add a AndroidManifest.xml file to the project. In that file an intent filter should be added to get nfc intents while in backround.. The corkboard example was extended to have an example for this new feature. Change-Id: I108afd88f9e5a548d62245591ebef11de8eb0d81 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | Catch the exception for disableForegroundDispatch for AndroidPeter Rustler2015-03-181-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Android Nfc disableForegroundDispatch must be called while the activity is still in foreground. We catch the thrown exception if we do call disableForegroundDispatch while we are in background. Change-Id: I396ee3fcb7c7ea835d7d5ed2cb31bf0a8cabb0a8 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | Adapt to the new "onResumePause" APIPeter Rustler2015-03-181-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Anroid the foreground activity get an onResume/onPause by implemmenting callbacks. This callback will be called from android when your activity go into foreground or background. In Nfc we need to know if we are the activity in foreground for calling enableForegroundDispatch. In Android this is mandatory. To support this callback an API was added in qtbase. This patch implement an listener of this API to get that events and use some logic to enable and disable foreground dispatch of nfc tags. Change-Id: Ibceed51c5d5905a28f01081027fdf5e0e8b4ef12 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | Remove the throwing code in Nfc enableForegroundDispatch for AndroidPeter Rustler2015-03-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Android Nfc enableForegroundDispatch must not be called while the activity is not in foreground. We have no API in current Qt to know if we are in foreground. For that we would need to be informed when a onPause/onResume in the activity was called. Then we should enable the dispatch when in foreground and disable while we are not. This Patch removes the code that throw if we do it anyway. Change-Id: I3bff7ba3f23b5ef2665f4c7f164a0bacd3e1c2d2 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | Update Digia headers to QtCompany headersAlex Blasche2015-03-021-22/+14
| | | | | | | | | | | | | | | Change-Id: Iacb162fd7254b8dee28a01dcb8fbdad257289ad3 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
| * | Merge branch 'dev' into neardAlex Blasche2015-02-264-28/+28
| |\ \ | | | | | | | | | | | | Change-Id: I2db4e121d3d6b3d44a5772262f685d99118c45eb
| * \ \ Merge branch 'dev' into neardAlex Blasche2015-02-024-15/+58
| |\ \ \ | | | | | | | | | | | | | | | Change-Id: I047b281e74f31ffec0c9f2ef29a0e73b94199c25
| * | | | Removed the listening for other tags than ndefPeter Rustler2015-02-021-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation of nfc for Android does not support other nfc tags than ndef. This patch removes the listening for other tag technologies. Change-Id: Id8303e50bd52d641b6de8d382e485ba7417e8c09 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | | | Add exception handling to enableForegroundDispatchPeter Rustler2015-02-021-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the activity is not in foreground the call to enableForegroundDispatch can throw an exception. Exception handling is added in this patch. Change-Id: Id9adbf25de4840679f0c4754c136f6195527c0f3 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | | | Adapt to the new "onNewIntent" APIPeter Rustler2015-02-021-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Anroid the foreground activity get an intent by implemmenting onNewIntent callback. This callback will be called from android when a nfc tag is in range. To support this callback an API was added in qtbase. This patch implement an listener of this API to get nfc events. Change-Id: I9ecadf6db53fe1269cb9e66f0062e9ce1ec5a95e Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | | | Cleanup of directory structure and pro files for NFC for AndroidPeter Rustler2015-02-028-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After squashing the nfc related build files were in folder jar. This should be named nfc. Additionally the files in that folder became a cleanup and missing values in pro/pri/xml files were added. Change-Id: I2da12c516b3cce6c4f7a7c35b37316ed343a5782 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * | | | Squashed code contribtion for QtNfc on AndroidJuhana Jauhiainen2015-01-087-0/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code was contributed by Juhana Jauhiainen <juhana.jauhiainen@gmail.com> osaukko <osaukko@gmail.com> waz <markus.liuska@gmail.fi> List of squashed commits: Preliminary Android support to QtNFC. Only receiving Ndef messages to QNearFieldManager. QNearFieldTarget and LLCP classes need to be implemented for Android ------------------ Added Android buildsettings to nfc.pro Including Android implementation in QNearFieldManager.h ------------------ QtNfc namespace removed. ------------------ Added Android support to QNearFieldManager::isAvailable() method ------------------ Improved isAvailable method ------------------ Fix QtNfc java module Added checking for NfcAdapter object so that calling QNearFieldManager::startTargetDetection() and QNearFieldManager::stopTargetDetection() methods will not crash application. ------------------ Added support for tag types. NFC tag type is now included in onNdefDiscovered() method call. Only showing information in debug messages for now. ------------------ Fixing missing return values and releasing acquired resources. ------------------ First proof of concept version of target creation for android. ------------------ Fix for include guards. ------------------ Added QHash container for NearFieldmanager Added QHash container for NearFieldManager which holds each discovered targets. Also added setters for NearFieldTarget. ------------------ Using signals and slots to move target information to main thread. Fixes problem when creating new targets as child of manager. ------------------ Fix for tag detection for tags without NDEF messages Tag type checking is not working if there is no NDEF messages currently. Need to find way to check tag type without Ndef object. ------------------ Added error reporting for QNearFieldTarget::readNdefMessages (Android) ------------------ Registering type name for QNearFieltTarget. Small refactoring for QNearFieldTarget android implementation. ------------------ Sending UID as bytearray. Also debug messages to show tech list added into QtNfc.java. ------------------ Trying different approach for android version of QtNfc module. In this approach we pass through intent object(Java) to NearFieldTarget object(c++). ------------------ Fixed nfc.pro so QtNfc.jar is built. ------------------ Added tech list into android version of QNearFieldTarget Could be used to detect availability of NDEF messages and also to detect tag type. ------------------ Fixed build files so both the C++ and Java libraries are built correctly. ------------------ Support for writing Ndef messages. ------------------ Implementation for NearFieldTarget::hasNdefMessage(). Also nice debug messages to show available technologies for current tag. ------------------ Support for NdefFormatable tags. ------------------ Support for writing NdefFormatable tags. ------------------ Removed debug messages. ------------------ Implemented type() method to Android's QNearFieldTarget. Conflicts: src/nfc/qnearfieldtarget_android.cpp src/nfc/qnearfieldtarget_android_p.h ------------------ Small fixes to remove some of the warnings. Conflicts: src/nfc/qnearfieldtarget_android.cpp src/nfc/qnearfieldtarget_android_p.h ------------------ Committing test code for targetLost signal (Because of Merge) Conflicts: src/nfc/qnearfieldtarget_android.cpp src/nfc/qnearfieldtarget_android_p.h ------------------ Added support for target lost signal ------------------ Using QString::fromUtf8 instead of QString() Conflicts: src/nfc/qnearfieldtarget_android.cpp ------------------ Fixed bug with targetLost not emitting when reading or writing Ndef messages. Added some untested code for sendCommand. ------------------ Refactoring. Conflicts: src/nfc/qnearfieldtarget_android_p.h ------------------ Refactoring and fixes. ------------------ Less debug messages. ------------------ Refactoring and cleaning. Conflicts: src/android/android.pro src/nfc/neard/neard_helper_p.h src/nfc/nfc.pro src/nfc/qdeclarativendefrecord.cpp src/nfc/qdeclarativendefrecord.h src/nfc/qllcpserver_p.h src/nfc/qllcpsocket.h src/nfc/qndefmessage.h src/nfc/qndefnfcsmartposterrecord_p.h src/nfc/qnearfieldmanager.cpp src/nfc/qnearfieldmanager_neard_p.h src/nfc/qnearfieldtarget.h src/nfc/qnfcglobal.h src/src.pro tests/nfctestserver/socketcontroller.h Change-Id: Ideb4c8c8064f46b431532ea4870207691bc49c99 Reviewed-by: Peter Rustler <peter.rustler@basyskom.com> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | | | Bugfix: Bluetooth Le for Android need to close BluetoothGattPeter Rustler2015-05-111-0/+2
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Android can only handle a defined count of simultaneously connections to bluetooth le devices. Every Android device have a different defined amount of possible simultaneously connections. If we do not close the connection and reconnect to the device or another device, the count of used connections get up. If we exceed the maximum connection count we can not connect to bluetooth le devices anymore. The only way to recover is to restart the application to reset the open connection count. This patch closes the connection after it has been disconnected. Change-Id: Id96a69ef07eb973216495a0ba8e46fd639338165 Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | | Android: Avoid code duplication and don't break readWriteQueueAlex Blasche2015-04-151-82/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | handleFor(Characteristic|Descriptor)() find a handle for a given char and desc. We should reuse it inside the read notifier for chars and descs. In addition, under certain circumstances the read/write queue operation was finished although the queue was not empty yet. This happened when the last read operation failed with a certain type of error. Now we always finish with a call to performNextIO(). Change-Id: Ifdb66c0b03d25ae19db7c49bcbe70eeec2665b6e Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* | | | Android: Fix read/write error reports when failure during initial callAlex Blasche2015-04-151-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BluetoothGatt.[read|write][Characteristic|Descriptor]() functions may immediately return under certain circumstances such as writing a read-only characteristic. So far, this "synchronous" form of error reporting was not handled. Any read error during the initial service dioscovery and its related cache population continues to surpress any read errors. Change-Id: I4987f67f4a0d2afe58cd144a577a19e0f0d43b33 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* | | | Android: Implement error reporting for char & desc readingAlex Blasche2015-04-151-17/+47
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I5652075b4fde4d4927e86f5394baf176f263104f Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | | Android: Implement QLEService:readCharacateristic & readDescriptorAlex Blasche2015-04-151-70/+192
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In general we extend the concept of the write queue. Not only do we queue up write requests but also read requests. The handling of read errors is still missing. Right now the QLEService::error() signal is not emitted when a readCharacteristic() and readDescriptor() call fails. Change-Id: I4b4f086c351c4a29d6e48e8ee9079e9f33f36539 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | Update copyright headersJani Heikkinen2015-02-164-28/+28
| |/ |/| | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I3822a6484e8f7a420330de1cb1aeb0c3d1cf41b7 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* | Cleanup Bluetooth Java codeAlex Blasche2014-12-054-13/+21
| | | | | | | | | | | | | | | | These points were raised by Android-studio's Code analyzer Change-Id: I5481b7ca74ec902b289a71096879e32301ee6494 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Don't update cached char value when property is not readableAlex Blasche2014-12-041-1/+1
| | | | | | | | | | | | | | | | | | In addition we update the documentation to reflect the slightly changed API behavior. Change-Id: Ieddee750aa35a32d3c01213dfbf678ee2a1d88d7 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Android: enable writing of characteristics without response modeAlex Blasche2014-12-041-1/+18
| | | | | | | | | | | | Change-Id: I9c26aaa11857db8dc33a99d42347a9b7f6281ad7 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Android: Fix automatic notification sending when device demands itAlex Blasche2014-12-031-0/+18
|/ | | | | | | | | | | | | Some BTLE devices enable notifications be default. However since Android's BTLE API requires a call to BluetoothGatt.setCharacteristicNotification(..) to forward them, we have to peek at the ClientCharacteristicConfigurations during the service detail discovery and tell Android to forward the notification when required. Change-Id: Ief419404694d70a1373218c1b8275ef868a49ddb Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Android: Add characteristic indication supportAlex Blasche2014-12-011-4/+15
| | | | | | | | | | | | | | | | | At this point in time characteristic indication is very much under- documented. We have to make some guesses along the way notifications work. Also, it turns out the code already supported indications but was not very future proof. If the ClientCharacteristicConfiguration is expanded by future Bluetooth specifications the notifications could have been enabled despite the two relevant bits not being set. All that was required was to write {0xFC FF} and the notifications would have been enabled. This was due to assumption that only the byte array {0x00 0xFF} being the disabling data set. Change-Id: I6c54d557f51977418f91baf658b62e1121785029 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Android: Implements QLEService::includedServices() and type()Alex Blasche2014-12-011-0/+31
| | | | | | | | | | Unfortunately it is not possible to say whether a service is primary or secondary on Android. The platform doesn't expose this information. Change-Id: I9b0aad191308120d2d1992a5e7736b985a375e30 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Android: characteristic changed notification supportAlex Blasche2014-11-241-4/+35
| | | | | | Change-Id: I4c50df7d758390989c2e2127f7646e5d2dc34712 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Ensure that Android can deal with concurrent write requests.Alex Blasche2014-11-171-13/+101
| | | | | | Change-Id: Ib4f8381a1975e17b5b142f49e0f3f32398a46bfb Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Apply fixes pointed out by Java code analyzerAlex Blasche2014-11-141-28/+27
| | | | | | | | This covers code optimizations and one minor corner case bug. Change-Id: I9c4df9462e8610ea37a6e43e20840e537c295684 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Support for QLEService::writeDescriptor() on AndroidAlex Blasche2014-11-141-3/+50
| | | | | | Change-Id: I1c7f0491506c6f0512d097a419660c5f5e7fb144 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Support for QLEService::writeCharacteristic() on AndroidAlex Blasche2014-11-121-1/+119
| | | | | | | | Currently only the WriteWithResponse mode works and has been tested. Change-Id: I7947b67f737f5878a01704c09d3a9a532a41b820 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Improve reliability of QLEController connect()/disconnect()/connect()Alex Blasche2014-11-121-6/+49
| | | | | | | | | | | | | | | | | | | | | | | | Quick disconnecting and reconnecting caused some bugs and revealed some unreliabe API behavior on Android. The internal data structures were never cleaned up when disconnecting from the remote device. If multiple QLEService objects of the same QLEController instance requested a service discovery, every request but the first failed. This was fixed by queueing up the service discovery requests. Last but not least, reusing the same BluetoothGatt instance for the reconnect is very error prone. It may well be caused by Android API bugs. The reconnect would sometimes fail or toggle the connect/disconnect flag a couple of times which is not a problem for the Qt API itself but the stability of the related unit test (see tst_QLowEnergyController::tst_concurrentDiscovery()). Therefore we won't reuse the same BluetoothGatt instance but rather request a new one. Change-Id: I314f2a30960284b9bcd4926f4944c415a6d75788 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Don't print the Java stacktrace when reaching last entry of last serviceAlex Blasche2014-11-111-1/+1
| | | | | | | | We jump out and that's it. We expect the exception in those cases. Change-Id: I0fa1b42a0eb5893dec6f68a5353dfb5da3caa137 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* The service->characteristic->descriptor tree becomes available in QtAlex Blasche2014-11-111-22/+160
| | | | | | | | | | | | | | | | At the same time this fixes bugs the following bugs: 1.) Non-readable characteristics were not visible 2.) Crashes when descriptor/characteristic values were empty 3.) QLEService::discoverServiceDetails always finished with an UnknownError Missing/incorrect are still service details such as included services and the service type (which currently always defaults to primary service). Change-Id: Id73013a3784cd3c3f632102f13f5459ab37e95a6 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Propagate Charactereristic data to Qt layerAlex Blasche2014-11-101-0/+11
| | | | | | | | | Although this makes the lowenergyscanner example functionally complete, descriptor data and service meta data are still not accessable via the Qt API. Change-Id: Ifb84010b4fea054357c07424ac30116d1e4f9de0 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Majority of service detail discovery code on AndroidAlex Blasche2014-11-101-2/+252
| | | | | | | | | | Primarily the change adds the required data structures and interfaces on the Java side. What is missing is the reporting of the discovery details back to Qt. Change-Id: I37f2e17bb0f87b4c526f1b43a933b9b09b22be72 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Discover BTLE services on remote device on AndroidAlex Blasche2014-11-041-2/+33
| | | | | | Change-Id: Ia39e2ad21b0e84cb16a355337370ba82a11b75d0 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Android: Add ability to (dis)connect to BTLE devices on AndroidAlex Blasche2014-11-041-1/+72
| | | | | | | | and keep tracking the connection state Change-Id: If4d05fa18c78802ae06096884fba78eed123e77f Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Android: Add BluetoothLE device scanAlex Blasche2014-10-282-2/+86
| | | | | | Change-Id: Ibbb1e9f141d494327082aebaf9e34ffe44039115 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-243-54/+30
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I7a8b8b787fcae9a178794364efdefe1021d10b1b Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Android: Improve QBluetoothLocalDevice::connectedDevices()Alex Blasche2014-03-241-0/+52
| | | | | | | | | | | | | | | There is no API to get the list of connected Bluetooth devices on Android. However there are service API's which return a list of their current clients. In this particular case we find the GATT related service connections. We use that info to complement the internal list of connected devices. Note that although this is using Bluetooth Low Energy related API's the Qt API does not support this feature at this point in time. Task-number: QTBUG-36764 Change-Id: Ia8266f3a9d24fd16afdd636ca2d3d0a0c6b2b499 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Android: Fix crashes due to concurrency issuesAlex Blasche2014-03-111-1/+14
| | | | | | | | | | | | | | | BroadcastReceiver.onReceive() is executed in the main thread whereas the Qt classes are in a different thread. This created issues whereby Java's qtObject pointer was reset by the Qt classes/thread but onReceive still trying to access the same object later on. In most cases the Qt classes using BroadcastReceiver were half way through their object tear down. This patch fixes the problem by guarding qtObject against concurrent thread access and ensures that the qtObject pointer is reset before the object tear down starts. Change-Id: Iab97b0af8e10686d97419ac8504f2fe69e9536f3 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Fix crash when interrupting QBluetoothSocket's input stream threadAlex Blasche2014-02-272-1/+105
| | | | | | | | | | | | The previous QThread did not always properly resume when InputStream.read() was interrupted by BluetoothSocket.close(). This patch converts the QThread to a Java thread which works as the Android API docs suggested. Task-number: QTBUG-37061 Change-Id: Id6ac9b57a28f3b532cbe49ff1dfdc9d1e6432aaa Reviewed-by: Nedim Hadzic <nedimhadzija@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Android: Fix crash in QBluetoothServer::close()Alex Blasche2014-02-272-1/+156
| | | | | | | | | | | | | | Java's BluetoothSocketServer.accept() is meant to be interrupted via BluetoothSocketServer.close(). Unfortunately if the surrounding thread is a QThread the returning accept call crashes the thread. This does not happen if it is a Java Thread. This commit changes the server's private backend to a Java thread. Task-number: QTBUG-36754 Change-Id: I5aacc5444bbcd1275a11743b6aa04d2b11a5b22b Reviewed-by: Nedim Hadzic <nedimhadzija@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Port QtBluetooth to AndroidAlex Blasche2014-02-137-0/+144
This is a feature merge to dev targeting Qt 5.3. Known issues: -QTBUG-36754: QBluetoothServer::close() crashes -QTBUG-36763: QBluetothTransferManager port to Android not possible -QTBUG-36764: Improve QBluetoothLocalDevice::connectedDevices() -QTBUG-36810: Remove direct use of Android action strings The above issues and some other minor TODO's will be addressed until final release time. Task-number: QTBUG-33792 [ChangeLog][QtBluetooth][Android] QtBluetooth has been ported to Android. Change-Id: I31ba83e3b7d6aa68e7258b7e43235de7d1a6e68a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>