ACR122u卡仿真模式发送PN532命令
我确实了解目的,但您需要如何将命令发送到ACR122u。
据我所知FF000000意味着:
- FF [班级]
- 00 [INS]
- 00 [P1]
- 00 [P2]
我只是不知道如何发送实际的PN532命令,例如:
- FF000000 D406
- FF000000
我走了这么远:
TerminalFactory factory = TerminalFactory.getDefault(); List<CardTerminal> terminals;
try {
terminals = factory.terminals().list();
CardTerminal terminal = terminals.get(0);
Card card = terminal.connect("*");
CardChannel channel = card.getBasicChannel();
byte[] command = {???};
CommandAPDU command1 = new CommandAPDU(0xFF,0x00,0x00,0x00, command);
ResponseAPDU response1 = channel.transmit(command1);
System.out.println(bytesToHex(response1.getBytes()));
} catch (CardException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
我感谢您的帮助!
提前谢谢了!!
回答:
假设 表示
- 08 [Lc]
- D406 6305 630D 6338 [数据]
它看起来像这样:
byte[] command = new byte[8] { (byte) 0xD4, 0x06, 0x63, 0x05, 0x63, 0x0D, 0x63, 0x38 };
您可以省略,8
因为javac会为您计算字节数。
以上是 ACR122u卡仿真模式发送PN532命令 的全部内容, 来源链接: utcz.com/qa/415305.html