Deactivate NVC connection to NFC Tag type 4 before closing to avoid app crash (Known Issue)
This article provides a workaround to avoid application crashes when closing the connection to an NFC Tag Type 4 on Nokia Belle.
Article Metadata
Tested with
Devices(s): Nokia C7 (firmware FW 022.013 and FW022.014)
Article
Created: mahbub_s60
(06 Feb 2012)
Last edited: hamishwillee
(12 Apr 2012)
Contents |
Introduction
When an NFC tag is lost/separated from the device a handler should be called to close the connection. Due to a bug in the NFC implementation on Nokia Belle, we need to first deactivate the connection before closing it, or the application will panic.
How to produce the bug
- Implement your code to handle the tag lost event as below. Note that this is the correct way to handle the event:
-
void CNfcHandler::TagLost()
{
iTag->CloseConnection(*iIso14443Connection);
delete iIso14443Connection;
iIso14443Connection = 0;
}
-
- Run the application
- Touch an NFC tag type 4 to the device (for example, a Nokia C7) and then remove it
The NFC app is closed due to a panic (Symbian unexpected exception).
Workaround
The following code can be used to workaround this crash on Nokia Belle:
void CNfcHandler::TagLost()
{
if(iIso14443Connection->IsActivated()) {
iIso14443Connection->Deactivate();
}
iTag->CloseConnection(*iIso14443Connection);
delete iIso14443Connection;
iIso14443Connection = 0;
}
Device SW used to test
- C7 with FW 022.013 and FW022.014
Note, this is tracked internally as "Failure 880652: [mcl]NFC 3rd party application crashes"


Hamishwillee - This needs a subedit and possible title change
Hi Mahbub
Would you be happy with a title: "Deactivate NVC connection to NFC Tag type 4 before closing to avoid app crash (Known Issue)"
Is there a defect associated with this? Can we have the link?
OK if I subedit?
Regards
Hamishhamishwillee 00:23, 8 February 2012 (EET)