收发失败的银河S3具有NFC-B卡 [英] Transceive failed on Galaxy S3 with a NFC-B card

查看:550
本文介绍了收发失败的银河S3具有NFC-B卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Android读取非接触式智能卡的应用程序,但我有一些问题,我的Galaxy S3。
之前描述的问题,我需要precise可在PC上,我可以完全与卡使用来自不同厂商的Java和NFC读者smartcardio API沟通。

I am working on an application for Android reading a contactless smart card but I have some problems with my Galaxy S3. Before to describe problems, I need to precise that on a PC, I can communicate perfectly with the card using the smartcardio API in Java and NFC readers from different manufacturers.

此卡被检测为NFC协议栈支持技术IsoDep和NfcB。
然而,当我把我的APDU命令收发,我得到一个异常的Transceive失败。我曾尝试增加超时,但没有更好的结果。

This card is detected as supporting technologies "IsoDep" and "NfcB" by the NFC stack. However, when I send my apdu command with "transceive", I get an exception "Transceive failed". I have tried to increase timeout but no better result.

iso = IsoDep.get(tag);
if (iso!=null) {
    try {
        iso.connect();
        // txMessage is a TextView object used for debugging purpose
        txMessage.setText("Max:"+iso.getMaxTransceiveLength()+" timeout:"+iso.getTimeout()+" connected:"+iso.isConnected());
        iso.setTimeout(2000);
        txMessage.setText("Max:"+iso.getMaxTransceiveLength()+" timeout:"+iso.getTimeout()+" connected:"+iso.isConnected());
        byte[] command = new byte[] {(byte) 0x00, (byte) 0xA4, (byte) 0x04,(byte) 0x00, (byte) 0x06,(byte) 0xA0,(byte) 0x00,(byte) 0x00, (byte) 0x00,(byte) 0x12,(byte) 0x00};
        byte[] response = iso.transceive(command);
        } catch (IOException e) {
            txMessage.setText(txMessage.getText()+"\n"+e.getMessage());
        }
}

在运行此code,我得到:

When running this code, I get:

Max:261 timeout:309 connected: true
Max:261 timeout:2474 connected: true
Transceive failed

我已经注意到了,这款显卡要求是非常接近的NFC天线的工作。我需要删除为了我的手机的附加的塑料保护盒(不封底)卡将被检测到(我猜供电)。

I have noticed that this card requires to be very close of the NFC antenna to work. I need to remove the additional plastic protection case (not the back cover) of my phone in order the card would be detected (I guess powered).

在后,我读<一个href=\"http://stackoverflow.com/questions/10831464/nfc-typeb-card-not-getting-detected-by-any-nfc-application-likenfctaginfo\">NFC (:nfctaginfo等)和<一键入b卡没有得到任何NFC应用程序检测href=\"http://stackoverflow.com/questions/12103521/android-isodep-isconnected-returns-false-and-maximum-transceive-length0-byte\">Android isodep.isConnected()返回false和最大的Transceive长度:?0字节,B型卡和其他几个其他职位(的 http://forum.xda-developers.com/showthread.php?t=1705970 ,的 HTTP://$c$c.google.com/p/android/issues/detail ID = 35960 ),但我没有找到一个解决方案。

Before to post, I have read NFC typeb card not getting detected by any NFC application (like:nfctaginfo) and Android isodep.isConnected() returns false and maximum Transceive length:0 byte ,for type B card.? and several other posts elsewhere (http://forum.xda-developers.com/showthread.php?t=1705970 , http://code.google.com/p/android/issues/detail?id=35960 ) but I did not find a solution.

一个可能的解决方案是将尝试与外部天线通信,但我不知道从哪里连接呢?在电池连接器里没有+和 -

A possible solution would be to try to communicate with an external antenna but I am not sure where to connect it? On battery connector where there is no "+" and "-"?

另一种解决方案是将尝试与NfcB( NfcB nfcb = NfcB.get(标签); )的卡进行通讯,但我不知道ISO14443- 3B协议(我只知道非常好APDU,T0-TPDU而不是其他TPDU协议)。

Another solution would be to try to communicate with the card with NfcB (NfcB nfcb = NfcB.get(tag);), but I do not know the ISO14443-3B protocol (I only know quite well APDU, T0-TPDU but not other TPDU protocols).

只是可以肯定,我已经更新我的手机到Android 4.1.2(而不是4.1.1),但没有更好的结果。

Just to be sure, I have updated my phone to Android 4.1.2 (instead of 4.1.1) but no better result.

推荐答案

这绝对是一个超时的事,与恩智浦的NFC芯片兼容的东西(如一个在S3)

It is definitely a timeout thing, and a compatibility thing with NXP NFC chips (like the one in the S3)

我与B型标签工作的天线比一个典型的手机天线更高的Q值,和做ISO-DEP,当我需要仍可改变NFC芯片的默认超时,我使用(NXP PN532)。 A型调制由Phillps开发,目前恩智浦。 B型调制由Motorolla开发,并已获得许可,以NXP其读写器芯片,因此,只有基本实现包括相对于A类实现。

I have worked with Type B tags on an antenna with a higher Q factor than that of a typical mobile phone antenna, and when doing ISO-DEP I need to still change the default timeouts of the NFC chip that I'm using (NXP PN532). Type A modulation was developed by Phillps, now NXP. Type B modulation was developed by Motorolla, and is under license to NXP for its reader chips, so only a basic implementation is included relative the the Type A implementation.

我不是在Android这样做,但嵌入式平台,让我有充分的机会来了NFC芯片的功能。因此,只有通过使用需要应用程序处理14443-4协议的更基本transeiving方法和扩大读者的超时宽容是我谈得来使用ISO-DEP B类标签

I am not doing this on an Android, but an embedded platform, so I have full access to the NFC chip's features. Thus, only by using a more basic transeiving method that requires the application to handle the 14443-4 protocol and extending the timeout tolerance of the reader was I able to talk to a Type B tag using ISO-DEP

Android 4.4系统有一种叫做<一个href=\"https://developer.android.com/reference/android/nfc/NfcAdapter.html#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle)\"相对=nofollow>阅读器模式,可能有一个功能,使您能够延长此超时。

Android 4.4 has something called reader mode, that may have a feature that enables you to extend this timeout.

这篇关于收发失败的银河S3具有NFC-B卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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