Android中的Mifare Ultralight C身份验证(2.3.6) [英] Mifare Ultralight C Authentication in Android (2.3.6)

查看:235
本文介绍了Android中的Mifare Ultralight C身份验证(2.3.6)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试验证Mifare Ultralight C(兼容ISO/IEC 14443-2和14443-3 A型)标签.

I'm trying to authenticate a Mifare Ultralight C (ISO/IEC 14443-2 and 14443-3 type A compatible) tag.

我使用Android中提供的MifareUltralight.transceive()函数发送身份验证命令.我还检查了NfcA.transceive()(IsoDep似乎与这种标签不兼容,因为该对象用于处理ISO/IEC 14443-4标签,这就是为什么我不使用IsoDep.transceive()的原因).

I send the authentication command with the MifareUltralight.transceive() function provided in Android. I have also checked NfcA.transceive() (IsoDep seems not to be compatible with this kind of tag because this object is for dealing with ISO/IEC 14443-4 tags and that's why I don't use IsoDep.transceive()).

因此,当我第一次发送身份验证请求命令时,标签会使用AFxxxx回答标签中的transceive()....在这里我处理标签答案,然后再发送另一个包含该答案的transceive(). .之前发送收发()的标签相连,当它送我得到一个标签丢失"警告和收发失败".

So, when I first send the authentication request command the tag answers the transceive() with AFxxxx..... where I process the tag answer and then I send another transceive() with the response to that answer but... just before sending the transceive() the tag is connected, when it's sent I get a "tag was lost" warning and a "transceive failed".

另外,如果我用NfcA尝试,也会发生同样的问题.

Also, if I try it with NfcA the same problem happens.

最后,如果我尝试在第一个响应后发送一个身份验证命令,也会收到标签丢失"的警告,提示收发失败.

Finally, if I try to send one authentication command after the first one response I get also a "Tag was lost" warning with the transceive fail.

所以我的问题是:

为什么当我发送第二个transceive()时NFC标签会丢失?<<

Why does the NFC tag get lost when I send the second transceive()?<<

(这似乎不是超时问题,因为在发送第二个transceive()之前,连接已使用标签打开) 我把所有东西都放在与UI不同的线程中.

(It doesn't seem to be a timeout problem because just before sending the second transceive() the connection is open with the tag) I made all the stuff in a different Thread from the UI one.

提前谢谢!

推荐答案

您的方法似乎是正确的.但是,标签的行为表明您对标签答案的回答不正确.在这种情况下,标签拒绝回答.但从手机的角度来看,这是从标签区分已经消失了,所以你得到一个.

Your approach seems to be correct. However, the tag's behaviour indicates that your response to the tag's answer was incorrect. In that case, the tag refuses to answer. From the phone's point of view this is indistinguishable from the tag having disappeared, so you get a TagLostException.

这篇关于Android中的Mifare Ultralight C身份验证(2.3.6)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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