summaryrefslogtreecommitdiffstats
path: root/src/nfc/qnearfieldtarget_android_p.h
Commit message (Collapse)AuthorAgeFilesLines
* QNearfieldTarget: Introduce (set)keepConnection() and disconnect()Lars Schmertmann2017-01-181-0/+8
| | | | | | | | | | | | | | | | | | | 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>
* Android: QNearfieldTarget: Introduce maxCommandLength()Lars Schmertmann2017-01-031-0/+1
| | | | | | | | | | | | For the communication with a German ID card its required to execute commands with a length up to 500 byte. With this change it is possible to check if the required length is supported. [ChangeLog][QNearfieldTarget] Introduce maxCommandLength() to make it possible to check the maximum supported length for commands. Change-Id: I7e655f419765d8ad728f6d6005a85a01d5aa03e9 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-061-1/+1
|\ | | | | | | | | | | | | Conflicts: examples/nfc/corkboard/corkboard.pro Change-Id: I5d1ea0a8e21a1b55dbf744c2f4b469bc51f05c7a
| * Android: Suppress failed connect/close attempts due to targetLost detectionAlex Blasche2016-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Android does not provide an API to detect when an NFC tag is removed from the vincinity. To detect such a case the Android implementation uses active polling. During each polling cycle the implementation connects and disconnects from the tag. If it failed, the tag is assumed to have been removed from the vincinity. Such failed attempts cause an IOException which are printed to stderr. This is confusing as the developer might mistake them for some other serious problem. This change suppresses all related warnings. Change-Id: I95cf57076139e7d0a5ad31d4cc770a81ced12242 Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Peter Rustler <peter.rustler@basyskom.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Updated license headersAntti Kokko2016-01-201-14/+20
|/ | | | | | | | | | 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>
* Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-091-0/+11
| | | | | Change-Id: I4e78a2b263fb779253556201fd20fe47a2afc58e Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Android Nfc: Use of StringLiteral instead of static const QStringPeter Rustler2015-03-191-8/+0
| | | | | | | Qt do not like non POD types for static const data Change-Id: Id6ef07dfeb53d80a3180c9067ff7fdf14661b3f5 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Use AndroidExtras for all functions in qnearfieldtarget_androidPeter Rustler2015-03-191-3/+3
| | | | | | | | Now, all code for Nfc for Android is using AndroidExtras instead JNI. Change-Id: I5fed5fd55caf23ee9c323034e909d1d13b008367 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Using QtAndroidExtras instead of Andoid JNI for NFCPeter Rustler2015-03-191-3/+5
| | | | | | | | | Some functions in QNearfieldtarget_android are missing. They will be ported to QtAndroidExtras in a later commit. Change-Id: Ib68f91f394f28c8b19ccea4335c8f0292929f003 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>
* Added support for nfc message handlersPeter Rustler2015-02-021-0/+1
| | | | | | | | This patch adds support for registering nfc ndef message handlers. Change-Id: I2e09f107c477132f28d370349eba04a459d559ee Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Squashed code contribtion for QtNfc on AndroidJuhana Jauhiainen2015-01-081-0/+110
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>