ACR122u卡仿真模式发送PN532命令 [英] ACR122u card-emulation mode send PN532 commands
本文介绍了ACR122u卡仿真模式发送PN532命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚刚阅读了此答案,该答案关于如何将ACR122U置于卡仿真模式.我确实了解目的,但是您需要如何将命令发送到ACR122u.
I just read this answer about how to put my ACR122U in card-emulation mode. I do understand the purpose but how do you need to send the commands to the ACR122u.
据我所知FF000000表示:
As far as I know FF000000 means:
- FF [Class]
- 00 [INS]
- 00 [P1]
- 00 [P2]
例如,我只是不知道如何发送实际的PN532命令:
I just can't figure out how I can send the actual PN532 command for example:
- FF000000 08 D406 6305 630D 6338
- FF000000 11 D408 6302 80 6303 80 6305 xx 630D是6338 zz
- FF000000 08 D406 6305 630D 6338
- FF000000 11 D408 6302 80 6303 80 6305 xx 630D yy 6338 zz
我已经走了这么远:
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 D406 6305 630D 6338 表示
- 08 [Lc]
- D406 6305 630D 6338 [数据]
它看起来像这样:
byte[] command = new byte[8] { (byte) 0xD4, 0x06, 0x63, 0x05, 0x63, 0x0D, 0x63, 0x38 };
您可以省去8
,因为javac会为您计数字节.
You can leave out the the 8
since javac will count the bytes for you.
这篇关于ACR122u卡仿真模式发送PN532命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文