-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
1.2.1
-
None
-
Nokia 701, Symbian Belle FW 111.030.0609
(Qt 4.7.4, Qt Mobility 1.2.1)
Nokia N9, PR 1.2
1. On Symbian, QNearFieldTarget::hasNdefMessage() always returns false for NFC Forum Type 4 tags, even when the tag has NDEF messages present.
If ignoring the return value of this method and still attempting to read the NDEF message from the tag, reading succeeds and returns the expected contents of the tag.
2. If the app doesn't attempt to read the NDEF message of the Type 4 tag, closing the app will cause a panic:
Thread has crashed: Thread 0x73c has panicked. Category: Paniced by NFC-s; Reason: -8
Thread has crashed: Thread 0x73d has panicked. Category: Paniced by NFC-s; Reason: -8
Thread has crashed: Thread 0x73e has panicked. Category: Paniced by NFC-s; Reason: -8
This doesn't happen if the app does read the NDEF message using QNearFieldTarget::readNdefMessages(). So essentially, the app is required to always read NDEF messages from the tag, if it doesn't want to NFC server to panic the app later on.
This behavior is unique to Type 4 tags, and doesn't happen with for example Type 2.
—
General observations:
Writing NDEF messages to Type 4 tags works fine, also on Symbian.
The same code executed on MeeGo Harmattan returns "true" as expected for QNearFieldTarget::hasNdefMessage(). Also reading and writing Type 4 tags works flawlessly on the N9.
—
Reproduce:
To reproduce, run a Qt Mobility NFC app on a Symbian phone and attempt to read a tag.
You can for example use the Nfc Interactor project: http://www.nfcinteractor.com/ (source code linked on the download page).
The code that triggers reading tags is present in: NfcInfo::targetDetected(). It already implements the proposed workaround.
—
Workaround:
bool targetHasNdefMessage = target->hasNdefMessage();
#ifdef Q_OS_SYMBIAN
if (target->type() == QNearFieldTarget::NfcTagType4 && !targetHasNdefMessage) {
targetHasNdefMessage = true;
}
#endif