sege
sege

Reputation: 91

NFC on Nexus S: "TagLostException" when writing to unknown block on ISO 15693 Chip

I am wondering if anyone out there has stumbled across the issue I am experiencing.

I am writing an app to talk to a specific ISO 15693 RFID Chip using the Nexus S NFC capabilities. Communication between the phone and the chip works fine, most of the time. Reading and Writing the blocks is also working using transcieve() to send raw byte-arrays.

My chip has 8 blocks, each 4 bytes big. When I am trying to write to a block other than 0 - 7, Android throws a TagLostException:

07-21 14:07:39.390: WARN/System.err(5770): android.nfc.TagLostException: Tag was lost.
07-21 14:07:39.394: WARN/System.err(5770):     at android.nfc.tech.BasicTagTechnology.transceive(BasicTagTechnology.java:141)
07-21 14:07:39.398: WARN/System.err(5770):     at android.nfc.tech.NfcV.transceive(NfcV.java:92)
07-21 14:07:39.398: WARN/System.err(5770):     at de.myapp.ForegroundDispatchNfcV.sendRawCommand(ForegroundDispatchNfcV.java:246)
07-21 14:07:39.402: WARN/System.err(5770):     at de.myapp.ForegroundDispatchNfcV$3.onClick(ForegroundDispatchNfcV.java:135)
07-21 14:07:39.406: WARN/System.err(5770):     at android.view.View.performClick(View.java:2485)
07-21 14:07:39.406: WARN/System.err(5770):     at android.view.View$PerformClick.run(View.java:9080)
07-21 14:07:39.410: WARN/System.err(5770):     at android.os.Handler.handleCallback(Handler.java:587)
07-21 14:07:39.414: WARN/System.err(5770):     at android.os.Handler.dispatchMessage(Handler.java:92)
07-21 14:07:39.414: WARN/System.err(5770):     at android.os.Looper.loop(Looper.java:123)
07-21 14:07:39.417: WARN/System.err(5770):     at android.app.ActivityThread.main(ActivityThread.java:3683)
07-21 14:07:39.421: WARN/System.err(5770):     at java.lang.reflect.Method.invokeNative(Native Method)
07-21 14:07:39.421: WARN/System.err(5770):     at java.lang.reflect.Method.invoke(Method.java:507)
07-21 14:07:39.425: WARN/System.err(5770):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-21 14:07:39.429: WARN/System.err(5770):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-21 14:07:39.429: WARN/System.err(5770):     at dalvik.system.NativeStart.main(Native Method)

What I would expect from reading the ISO 15693 standard would be to get back 2 bytes containing infos on the error that occured, but it seams as if the chip would just stay quiet and send no answer. The same issue also occurs when trying to read a block that's not valid.

Is this a issue with my card or maybe something in the API / NFC ? Does anyone know more about this issue?

Upvotes: 2

Views: 2613

Answers (2)

Ben
Ben

Reputation: 19

I had this problem when the card was sending back an incorrect CRC to the Nexus S.

Upvotes: 0

Michael Elias
Michael Elias

Reputation: 212

The NFC chip has an internal state machine that keeps track of what tags it has detected. When the tag is out of range of the reader/phone and you try to write to it you will get this exception.

Upvotes: 0

Related Questions