summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/nfc/doc/src/nfc-cpp.qdoc5
-rw-r--r--src/nfc/doc/src/nfc-index.qdoc3
-rw-r--r--src/nfc/doc/src/nfc-overview.qdoc8
-rw-r--r--src/nfc/doc/src/nfc-qml.qdoc2
-rw-r--r--src/nfc/qnearfieldmanager.cpp40
-rw-r--r--src/nfc/qnearfieldmanager.h3
-rw-r--r--src/nfc/qnearfieldmanager_p.h4
-rw-r--r--src/nfc/qnearfieldmanager_qnx.cpp6
-rw-r--r--src/nfc/qnearfieldmanager_qnx_p.h2
-rw-r--r--src/nfc/qnearfieldmanagervirtualbase.cpp18
-rw-r--r--src/nfc/qnearfieldmanagervirtualbase_p.h2
-rw-r--r--src/nfc/qnearfieldtarget.cpp3
-rw-r--r--src/nfc/qnearfieldtarget.h2
-rw-r--r--src/nfc/qnx/qnxnfcmanager.cpp3
-rw-r--r--src/nfc/qnx/qnxnfcmanager_p.h2
-rw-r--r--tests/auto/qnearfieldmanager/tst_qnearfieldmanager.cpp10
-rw-r--r--tests/auto/qnearfieldtagtype1/tst_qnearfieldtagtype1.cpp2
-rw-r--r--tests/auto/qnearfieldtagtype2/tst_qnearfieldtagtype2.cpp2
-rw-r--r--tests/nfctestserver/socketcontroller.cpp2
19 files changed, 40 insertions, 79 deletions
diff --git a/src/nfc/doc/src/nfc-cpp.qdoc b/src/nfc/doc/src/nfc-cpp.qdoc
index 3e2942d0..b52db05b 100644
--- a/src/nfc/doc/src/nfc-cpp.qdoc
+++ b/src/nfc/doc/src/nfc-cpp.qdoc
@@ -31,10 +31,9 @@
\qtvariable nfc
\title Qt NFC C++ Classes
-\brief An API for accessing NFC Forum Tags and communication with NFC Forum Devices.
+\brief An API for accessing NFC Forum Tags.
-The \l{Qt NFC} C++ API enables an application to access NFC Forum Tags and communication with NFC
-Forum Devices.
+The \l{Qt NFC} C++ API enables an application to access NFC Forum Tagss.
To use the C++ library in your application, add the following configuration
option to your \c .pro file:
diff --git a/src/nfc/doc/src/nfc-index.qdoc b/src/nfc/doc/src/nfc-index.qdoc
index a3ff0392..a353a759 100644
--- a/src/nfc/doc/src/nfc-index.qdoc
+++ b/src/nfc/doc/src/nfc-index.qdoc
@@ -36,8 +36,7 @@ devices are touched together.
The NFC API provides APIs for interacting with NFC Forum Tags and NFC Forum Devices, including
target detection and loss, registering NDEF message handlers, reading and writing NDEF messages
-on NFC Forum Tags, sending tag specific commands, client and server LLCP sockets for bidirectional
-communication between two NFC Forum Devices.
+on NFC Forum Tags and sending tag specific commands.
\section1 Getting started
diff --git a/src/nfc/doc/src/nfc-overview.qdoc b/src/nfc/doc/src/nfc-overview.qdoc
index a70972d9..6c479c62 100644
--- a/src/nfc/doc/src/nfc-overview.qdoc
+++ b/src/nfc/doc/src/nfc-overview.qdoc
@@ -36,18 +36,14 @@
With the Qt NFC API typical use cases are:
\list
- \li Detect NFC devices entering and leaving communication range.
+ \li Detect NFC tags entering and leaving communication range.
\li Read and write NDEF message on NFC Forum Tags.
- \li Create an LLCP server listening for incoming LLCP socket connections.
- \li Create an LLCP socket connection to a NFC Forum Device.
\li Register an NDEF message handler for a particular content type.
\endlist
The following sections describe how to use QtNfc C++ classes for the above use cases.
-\section1 Detect NFC devices entering and leaving communication range.
+\section1 Detect NFC tags entering and leaving communication range.
\section1 Read and write NDEF message on NFC Forum Tags.
-\section1 Create an LLCP server listening for incoming LLCP socket connections.
-\section1 Create an LLCP socket connection to a NFC Forum Device.
\section1 Register an NDEF message handler for a particular content type.
*/
diff --git a/src/nfc/doc/src/nfc-qml.qdoc b/src/nfc/doc/src/nfc-qml.qdoc
index 3ed4cc9c..54902112 100644
--- a/src/nfc/doc/src/nfc-qml.qdoc
+++ b/src/nfc/doc/src/nfc-qml.qdoc
@@ -31,7 +31,7 @@
\qmlmodule QtNfc 5.0
\title Qt NFC QML Types
\ingroup qmlmodules
-\brief Provides QML types for accessing NFC Forum Tags and Devices
+\brief Provides QML types for accessing NFC Forum Tags
To use the classes of the module in your application you need the following
import statement in your \c .qml file:
diff --git a/src/nfc/qnearfieldmanager.cpp b/src/nfc/qnearfieldmanager.cpp
index 83e2e63e..5e483343 100644
--- a/src/nfc/qnearfieldmanager.cpp
+++ b/src/nfc/qnearfieldmanager.cpp
@@ -71,10 +71,7 @@ QT_BEGIN_NAMESPACE
NFC Forum devices generally operate as the master in master/slave communications. Some devices
are also capable of operating as the slave, so called Card Emulation mode. In this mode the
- local NFC device emulates a NFC Forum Tag or Contactless Card and can be used to perform
- transactions. The transaction happens entirely within a secure element on the device and only a
- notification of the transaction is provided. The transactionDetected() signal is emitted
- whenever a transaction occurs.
+ local NFC device emulates a NFC Forum Tag or Contactless Card.
NFC Forum Tags can contain one or more messages in a standardized format. These messages are
encapsulated by the QNdefMessage class. Use the registerNdefMessageHandler() functions to
@@ -82,9 +79,9 @@ QT_BEGIN_NAMESPACE
unregisterNdefMessageHandler() function.
Applications can connect to the targetDetected() and targetLost() signals to get notified when
- an NFC Forum Device or NFC Forum Tag enters or leaves proximity. Before these signals are
- emitted target detection must be started with the startTargetDetection() function, which takes
- a parameter to limit the type of device or tags detected. Target detection can be stopped with
+ an NFC Forum Tag enters or leaves proximity. Before these signals are
+ emitted target detection must be started with the startTargetDetection() function.
+ Target detection can be stopped with
the stopTargetDetection() function. Before a detected target can be accessed it is necessary to
request access rights. This must be done before the target device is touched. The
setTargetAccessModes() function is used to set the types of access the application wants to
@@ -206,34 +203,17 @@ bool QNearFieldManager::isAvailable() const
}
/*!
- Starts detecting targets of type \a targetTypes. Returns true if target detection is
- successfully started; otherwise returns false.
-
- Causes the targetDetected() signal to be emitted when a target with a type in \a targetTypes is
- within proximity. If \a targetTypes is empty targets of all types will be detected.
+ \fn bool QNearFieldManager::startTargetDetection()
+ Starts detecting targets and returns true if target detection is
+ successfully started; otherwise returns false. Causes the targetDetected() signal to be emitted
+ when a target is within proximity.
\sa stopTargetDetection()
*/
-bool QNearFieldManager::startTargetDetection(const QList<QNearFieldTarget::Type> &targetTypes)
+bool QNearFieldManager::startTargetDetection()
{
Q_D(QNearFieldManager);
-
- if (targetTypes.isEmpty())
- return d->startTargetDetection(QList<QNearFieldTarget::Type>() << QNearFieldTarget::AnyTarget);
- else
- return d->startTargetDetection(targetTypes);
-}
-
-/*!
- \overload
-
- Starts detecting targets of type \a targetType. Returns true if target detection is
- successfully started; otherwise returns false. Causes the targetDetected() signal to be emitted
- when a target with the type \a targetType is within proximity.
-*/
-bool QNearFieldManager::startTargetDetection(QNearFieldTarget::Type targetType)
-{
- return startTargetDetection(QList<QNearFieldTarget::Type>() << targetType);
+ return d->startTargetDetection();
}
/*!
diff --git a/src/nfc/qnearfieldmanager.h b/src/nfc/qnearfieldmanager.h
index c608fcd7..b690c2e2 100644
--- a/src/nfc/qnearfieldmanager.h
+++ b/src/nfc/qnearfieldmanager.h
@@ -75,8 +75,7 @@ public:
void setTargetAccessModes(TargetAccessModes accessModes);
TargetAccessModes targetAccessModes() const;
- bool startTargetDetection(const QList<QNearFieldTarget::Type> &targetTypes);
- bool startTargetDetection(QNearFieldTarget::Type targetType = QNearFieldTarget::AnyTarget);
+ bool startTargetDetection();
void stopTargetDetection();
template<typename T>
diff --git a/src/nfc/qnearfieldmanager_p.h b/src/nfc/qnearfieldmanager_p.h
index 4b6d7df4..24911707 100644
--- a/src/nfc/qnearfieldmanager_p.h
+++ b/src/nfc/qnearfieldmanager_p.h
@@ -73,10 +73,8 @@ public:
return false;
}
- virtual bool startTargetDetection(const QList<QNearFieldTarget::Type> &targetTypes)
+ virtual bool startTargetDetection()
{
- Q_UNUSED(targetTypes);
-
return false;
}
diff --git a/src/nfc/qnearfieldmanager_qnx.cpp b/src/nfc/qnearfieldmanager_qnx.cpp
index 696d2d88..e405ecc0 100644
--- a/src/nfc/qnearfieldmanager_qnx.cpp
+++ b/src/nfc/qnearfieldmanager_qnx.cpp
@@ -70,10 +70,10 @@ bool QNearFieldManagerPrivateImpl::isAvailable() const
return QNXNFCManager::instance()->isAvailable();
}
-bool QNearFieldManagerPrivateImpl::startTargetDetection(const QList<QNearFieldTarget::Type> &targetTypes)
+bool QNearFieldManagerPrivateImpl::startTargetDetection()
{
- qQNXNFCDebug() << "STarting targetdetection in nearfieldmanager";
- if (QNXNFCManager::instance()->startTargetDetection(targetTypes)) {
+ qQNXNFCDebug() << "Starting targetdetection in nearfieldmanager";
+ if (QNXNFCManager::instance()->startTargetDetection()) {
connect(QNXNFCManager::instance(), SIGNAL(targetDetected(QNearFieldTarget *, const QList<QNdefMessage>&)),
this, SLOT(newTarget(QNearFieldTarget *, const QList<QNdefMessage>&)));
return true;
diff --git a/src/nfc/qnearfieldmanager_qnx_p.h b/src/nfc/qnearfieldmanager_qnx_p.h
index 37aeba95..323f85b8 100644
--- a/src/nfc/qnearfieldmanager_qnx_p.h
+++ b/src/nfc/qnearfieldmanager_qnx_p.h
@@ -60,7 +60,7 @@ public:
bool isAvailable() const;
- bool startTargetDetection(const QList<QNearFieldTarget::Type> &targetTypes);
+ bool startTargetDetection();
void stopTargetDetection();
diff --git a/src/nfc/qnearfieldmanagervirtualbase.cpp b/src/nfc/qnearfieldmanagervirtualbase.cpp
index ec3e778d..115a94d6 100644
--- a/src/nfc/qnearfieldmanagervirtualbase.cpp
+++ b/src/nfc/qnearfieldmanagervirtualbase.cpp
@@ -45,11 +45,11 @@
QT_BEGIN_NAMESPACE
-static inline bool matchesTarget(QNearFieldTarget::Type type,
- const QList<QNearFieldTarget::Type> &types)
-{
- return types.contains(type) || types.contains(QNearFieldTarget::AnyTarget);
-}
+//static inline bool matchesTarget(QNearFieldTarget::Type type,
+// const QList<QNearFieldTarget::Type> &types)
+//{
+// return types.contains(type) || types.contains(QNearFieldTarget::AnyTarget);
+//}
QNearFieldManagerPrivateVirtualBase::QNearFieldManagerPrivateVirtualBase()
{
@@ -59,15 +59,13 @@ QNearFieldManagerPrivateVirtualBase::~QNearFieldManagerPrivateVirtualBase()
{
}
-bool QNearFieldManagerPrivateVirtualBase::startTargetDetection(const QList<QNearFieldTarget::Type> &targetTypes)
+bool QNearFieldManagerPrivateVirtualBase::startTargetDetection()
{
- m_detectTargetTypes = targetTypes;
return true;
}
void QNearFieldManagerPrivateVirtualBase::stopTargetDetection()
{
- m_detectTargetTypes.clear();
}
int QNearFieldManagerPrivateVirtualBase::getFreeId()
@@ -125,8 +123,8 @@ bool QNearFieldManagerPrivateVirtualBase::unregisterNdefMessageHandler(int id)
void QNearFieldManagerPrivateVirtualBase::targetActivated(QNearFieldTarget *target)
{
- if (matchesTarget(target->type(), m_detectTargetTypes))
- emit targetDetected(target);
+ //if (matchesTarget(target->type(), m_detectTargetTypes))
+ emit targetDetected(target);
if (target->hasNdefMessage()) {
QTlvReader reader(target);
diff --git a/src/nfc/qnearfieldmanagervirtualbase_p.h b/src/nfc/qnearfieldmanagervirtualbase_p.h
index 93dc517d..804c362f 100644
--- a/src/nfc/qnearfieldmanagervirtualbase_p.h
+++ b/src/nfc/qnearfieldmanagervirtualbase_p.h
@@ -56,7 +56,7 @@ public:
QNearFieldManagerPrivateVirtualBase();
~QNearFieldManagerPrivateVirtualBase();
- bool startTargetDetection(const QList<QNearFieldTarget::Type> &targetTypes);
+ bool startTargetDetection();
void stopTargetDetection();
int registerNdefMessageHandler(QObject *object, const QMetaMethod &method);
diff --git a/src/nfc/qnearfieldtarget.cpp b/src/nfc/qnearfieldtarget.cpp
index 36d1e8c7..c4f00d6d 100644
--- a/src/nfc/qnearfieldtarget.cpp
+++ b/src/nfc/qnearfieldtarget.cpp
@@ -88,15 +88,12 @@ QT_BEGIN_NAMESPACE
This enum describes the type of tag the target is detected as.
- \value AnyTarget This value is only used when registering handlers to indicate that any
- compatible target can be used.
\value ProprietaryTag An unidentified proprietary target tag.
\value NfcTagType1 An NFC tag type 1 target.
\value NfcTagType2 An NFC tag type 2 target.
\value NfcTagType3 An NFC tag type 3 target.
\value NfcTagType4 An NFC tag type 4 target.
\value MifareTag A Mifare target.
- \value NfcForumDevice An NFC Forum device target.
*/
/*!
diff --git a/src/nfc/qnearfieldtarget.h b/src/nfc/qnearfieldtarget.h
index 0cf85400..4e90e275 100644
--- a/src/nfc/qnearfieldtarget.h
+++ b/src/nfc/qnearfieldtarget.h
@@ -66,14 +66,12 @@ class Q_NFC_EXPORT QNearFieldTarget : public QObject
public:
enum Type {
- AnyTarget,
ProprietaryTag,
NfcTagType1,
NfcTagType2,
NfcTagType3,
NfcTagType4,
MifareTag,
- NfcForumDevice
};
enum AccessMethod {
diff --git a/src/nfc/qnx/qnxnfcmanager.cpp b/src/nfc/qnx/qnxnfcmanager.cpp
index 3ecdcfae..bd072c7b 100644
--- a/src/nfc/qnx/qnxnfcmanager.cpp
+++ b/src/nfc/qnx/qnxnfcmanager.cpp
@@ -386,9 +386,8 @@ void QNXNFCManager::targetLost(unsigned int targetId)
}
}
-bool QNXNFCManager::startTargetDetection(const QList<QNearFieldTarget::Type> &targetTypes)
+bool QNXNFCManager::startTargetDetection()
{
- Q_UNUSED(targetTypes)
qQNXNFCDebug() << "Start target detection for all types";
//TODO handle the target types
if (nfc_register_tag_readerwriter(TAG_TYPE_ALL) == NFC_RESULT_SUCCESS) {
diff --git a/src/nfc/qnx/qnxnfcmanager_p.h b/src/nfc/qnx/qnxnfcmanager_p.h
index 44a652db..70729c41 100644
--- a/src/nfc/qnx/qnxnfcmanager_p.h
+++ b/src/nfc/qnx/qnxnfcmanager_p.h
@@ -120,7 +120,7 @@ private Q_SLOTS:
public:
//TODO add a parameter to only detect a special target for now we are detecting all target types
- bool startTargetDetection(const QList<QNearFieldTarget::Type> &targetTypes);
+ bool startTargetDetection();
void updateNdefFilters(QList<QByteArray>,QObject *);
diff --git a/tests/auto/qnearfieldmanager/tst_qnearfieldmanager.cpp b/tests/auto/qnearfieldmanager/tst_qnearfieldmanager.cpp
index 79a2a35a..f431ce6f 100644
--- a/tests/auto/qnearfieldmanager/tst_qnearfieldmanager.cpp
+++ b/tests/auto/qnearfieldmanager/tst_qnearfieldmanager.cpp
@@ -97,17 +97,15 @@ void tst_QNearFieldManager::initTestCase()
void tst_QNearFieldManager::targetDetected_data()
{
- QTest::addColumn<QNearFieldTarget::Type>("type");
QTest::addColumn<bool>("deleteTarget");
- QTest::newRow("AnyTarget") << QNearFieldTarget::AnyTarget << false;
- QTest::newRow("NfcTagType1") << QNearFieldTarget::NfcTagType1 << false;
- QTest::newRow("Delete Target") << QNearFieldTarget::AnyTarget << true;
+ QTest::newRow("AnyTarget") << false;
+ QTest::newRow("NfcTagType1") << false;
+ QTest::newRow("Delete Target") << true;
}
void tst_QNearFieldManager::targetDetected()
{
- QFETCH(QNearFieldTarget::Type, type);
QFETCH(bool, deleteTarget);
QNearFieldManagerPrivateImpl *emulatorBackend = new QNearFieldManagerPrivateImpl;
@@ -116,7 +114,7 @@ void tst_QNearFieldManager::targetDetected()
QSignalSpy targetDetectedSpy(&manager, SIGNAL(targetDetected(QNearFieldTarget*)));
QSignalSpy targetLostSpy(&manager, SIGNAL(targetLost(QNearFieldTarget*)));
- manager.startTargetDetection(type);
+ manager.startTargetDetection();
QTRY_VERIFY(!targetDetectedSpy.isEmpty());
diff --git a/tests/auto/qnearfieldtagtype1/tst_qnearfieldtagtype1.cpp b/tests/auto/qnearfieldtagtype1/tst_qnearfieldtagtype1.cpp
index 7dbb37a8..bbe72e5a 100644
--- a/tests/auto/qnearfieldtagtype1/tst_qnearfieldtagtype1.cpp
+++ b/tests/auto/qnearfieldtagtype1/tst_qnearfieldtagtype1.cpp
@@ -104,7 +104,7 @@ void tst_QNearFieldTagType1::waitForMatchingTarget()
{
QSignalSpy targetDetectedSpy(manager, SIGNAL(targetDetected(QNearFieldTarget*)));
- manager->startTargetDetection(QNearFieldTarget::NfcTagType1);
+ manager->startTargetDetection();
QTRY_VERIFY(!targetDetectedSpy.isEmpty());
diff --git a/tests/auto/qnearfieldtagtype2/tst_qnearfieldtagtype2.cpp b/tests/auto/qnearfieldtagtype2/tst_qnearfieldtagtype2.cpp
index f57b1f23..87e6a41d 100644
--- a/tests/auto/qnearfieldtagtype2/tst_qnearfieldtagtype2.cpp
+++ b/tests/auto/qnearfieldtagtype2/tst_qnearfieldtagtype2.cpp
@@ -106,7 +106,7 @@ void tst_QNearFieldTagType2::waitForMatchingTarget()
{
QSignalSpy targetDetectedSpy(manager, SIGNAL(targetDetected(QNearFieldTarget*)));
- manager->startTargetDetection(QNearFieldTarget::NfcTagType2);
+ manager->startTargetDetection();
QTRY_VERIFY(!targetDetectedSpy.isEmpty());
diff --git a/tests/nfctestserver/socketcontroller.cpp b/tests/nfctestserver/socketcontroller.cpp
index e1b44297..e568d7d7 100644
--- a/tests/nfctestserver/socketcontroller.cpp
+++ b/tests/nfctestserver/socketcontroller.cpp
@@ -81,7 +81,7 @@ SocketController::SocketController(ConnectionType type, QObject *parent)
this, SLOT(targetDetected(QNearFieldTarget*)));
connect(m_manager, SIGNAL(targetLost(QNearFieldTarget*)),
this, SLOT(targetLost(QNearFieldTarget*)));
- m_manager->startTargetDetection(QNearFieldTarget::NfcForumDevice);
+ m_manager->startTargetDetection();
}
break;
default: