ACR122u停止检测SmartPhone

时间:2014-09-07 13:34:04

标签: nfc pcsc

我正在为我的论文开发原型。我正在使用ACR122u读写器,通过APDU命令将数据传递给Android手机(HTC One M7)。在我应用最后一个补丁(6.09.401.5)之前,ACR122u正在检测智能手机,但之后已停止

早些时候,我刚刚用智能手机激活NFC,而ACR122u将从红绿信号转为已检测到。

请寻找一些指导

关于

1 个答案:

答案 0 :(得分:1)

可能"自动PICC轮询"由于更新而被禁用,或者在PICC轮询期间忽略特定标记类型。您可以尝试将PICC操作参数重置为默认值(0xFF),使用程序访问ACR提供的ACR122U阅读器或使用以下程序。

public class ResetReader {
    public static final int FILE_DEVICE_SMARTCARD = 0x310000;
    public static final int IOCTL_CCID_ESCAPE_SCARD_CTL_CODE = 
                                        FILE_DEVICE_SMARTCARD + 3500 * 4;

    public static void main(String[] args) throws Exception {
        // the following loop lists all connected card terminals
        TerminalFactory factory = TerminalFactory.getDefault();
        for (CardTerminal term : factory.terminals().list()) {
            System.out.println(term.getName());
        }

        // connect to the ACR122U by choosing the correct name
        CardTerminal terminal = factory.terminals().getTerminal("ACS ACR122 0");
        Card c = terminal.connect("DIRECT");
        c.transmitControlCommand(IOCTL_CCID_ESCAPE_SCARD_CTL_CODE,
            new byte[]{(byte)0xFF, 0x00, 0x51, (byte)0xFF, 0x00});
    }

}