采用Android NFC的Mifare超轻3C认证超时 [英] NFC Mifare Ultralight C authentication timeout using Android

查看:148
本文介绍了采用Android NFC的Mifare超轻3C认证超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图遵循的步骤和验证使用Android手机(三星Galaxy Nexus的)一个超轻的Mifare标签Ç。如果在步骤之间没有延迟的认证工作正常。但如果有一个延迟,例如,等待200毫秒的响应消息之前,则抛出IOException。

I am trying to follow the steps and authenticate an Mifare Ultralight C tag using Android phone (Samsung Galaxy Nexus). The authentication works fine if there is no delay in between the steps. But if there is a delay, for example, wait for 200ms before the response message, an IOException is thrown.

我试图通过Android的API提供的setTimeout的方法,但它似乎不有所作为。

I tried the setTimeout method provided by Android API, but it doesn't seem to make a difference.

我不认为它是标签问题,因为我可以使用连接到我的MacBook不同的读者甚至与一些延误验证它。 (其实我是能够逐步完成code和标签也没有抱怨)。

I don't think it is the Tag problem, as I can authenticate it using a different reader connected to my Macbook, even with some delays. (Actually I was able to step through the code and the tag didn't complain).

这是一个Android API的限制?任何变通办法?不应该在这种情况下,要使用的setTimeout的方法?我怀疑我可能会错误地使用方法。

Is this an Android API limitation? Any workarounds? Does the setTimeout method supposed to be used in this case? I suspect I might use the method incorrectly.

先谢谢了。

推荐答案

当你不与标签进行通信,Android将继续检查标签的presence。它如何依赖于标签的技术(NFCA / B / F / V或IsoDep),但在MIFARE超轻的情况下,这将重新选择标签来完成。这实质上重置,所以任何身份验证上下文会丢失,标签将无法继续进行身份验证。

Whenever you are not communicating with a tag, Android will continuously check for the presence of the tag. How it does that depends on the tag's technology (NfcA/B/F/V or IsoDep), but in case of a MIFARE Ultralight, this will be done by re-selecting the tag. This essentially resets it, so any authentication context will be lost and the tag will not be able to continue with the authentication.

此行​​为是完全不同的形式是一个典型的桌面阅读器会做。所以,你需要意识到这一点,在这样的情况下。做的最好的事情是prevent自动presence通过与标签通信不断检查开始。 (presence检查也将开始,当你单步你的code在调试器,顺便说一句。)

This behaviour is quite different form what a typical desktop reader would do. So you need to be aware of this in cases such as this. The best thing to do is to prevent the automatic presence checking from starting by continuously communicating with the tag. (Presence checking will also start when you single-step through your code in the debugger, BTW.)

这篇关于采用Android NFC的Mifare超轻3C认证超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆