Nexus S 上的 NFC:“TagLostException”写入 ISO 15693 芯片上的未知块时

发布于 2024-11-25 20:04:42 字数 2114 浏览 7 评论 0原文

我想知道是否有人偶然发现了我遇到的问题。

我正在编写一个应用程序,以使用 Nexus S NFC 功能与特定的 ISO 15693 RFID 芯片进行通信。大多数时候,手机和芯片之间的通信工作正常。 读取和写入块也可以使用 transcieve() 发送原始字节数组。

我的芯片有 8 个块,每个块 4 字节大。 当我尝试写入 0 - 7 以外的块时,Android 会抛出 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)

我期望从读取 ISO 15693 标准中获取包含有关发生的错误的信息的 2 个字节,但它看起来好像芯片只会保持安静,不发送任何答复。 当尝试读取无效块时也会出现同样的问题。

这是我的卡的问题还是 API/NFC 中的问题? 有谁对这个问题了解更多吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

NFC 芯片有一个内部状态机,用于跟踪它检测到的标签。当标签超出阅读器/手机的范围并且您尝试写入时,您将收到此异常。

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.

○愚か者の日 2024-12-02 20:04:42

当卡向 Nexus S 发送回错误的 CRC 时,我遇到了此问题。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文