diff options
author | Lars Schmertmann <Lars.Schmertmann@governikus.de> | 2017-01-05 13:43:57 +0100 |
---|---|---|
committer | Lars Schmertmann <lars.schmertmann@governikus.de> | 2017-01-18 09:33:47 +0000 |
commit | d977db44ed57fd74562f049e70f336800ff9d585 (patch) | |
tree | 8115226741874730604ce3bc66c848643e689544 /src/nfc/qnearfieldtarget_android_p.h | |
parent | 44401721f66bdd72da197a14241a66fdb3d11cf4 (diff) |
QNearfieldTarget: Introduce (set)keepConnection() and disconnect()
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>
Diffstat (limited to 'src/nfc/qnearfieldtarget_android_p.h')
-rw-r--r-- | src/nfc/qnearfieldtarget_android_p.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nfc/qnearfieldtarget_android_p.h b/src/nfc/qnearfieldtarget_android_p.h index f2e2ee7f..0063e9a5 100644 --- a/src/nfc/qnearfieldtarget_android_p.h +++ b/src/nfc/qnearfieldtarget_android_p.h @@ -75,6 +75,9 @@ public: virtual QByteArray uid() const; virtual Type type() const; virtual AccessMethods accessMethods() const; + bool keepConnection() const; + bool setKeepConnection(bool isPersistent); + bool disconnect(); virtual bool hasNdefMessage(); virtual RequestId readNdefMessages(); int maxCommandLength() const; @@ -99,6 +102,8 @@ protected: void setupTargetCheckTimer(); void handleTargetLost(); QAndroidJniObject getTagTechnology(const QString &tech) const; + bool setTagTechnology(const QStringList &techList); + bool connect(); QByteArray jbyteArrayToQByteArray(const jbyteArray &byteArray) const; bool catchJavaExceptions(bool verbose = true) const; @@ -108,6 +113,9 @@ protected: QStringList m_techList; Type m_type; QTimer *m_targetCheckTimer; + QString m_tech; + QAndroidJniObject m_tagTech; + bool m_keepConnection; }; QT_END_NAMESPACE |