[英]ACR122u card-emulation mode send PN532 commands
I just read this answer about how to put my ACR122U in card-emulation mode. 我刚刚看了这个答案如何把我的ACR122U卡模拟模式。 I do understand the purpose but how do you need to send the commands to the ACR122u.
我确实了解目的,但您需要如何将命令发送到ACR122u。
As far as I know FF000000 means: 据我所知FF000000意味着:
I just can't figure out how I can send the actual PN532 command for example: 我只是不知道如何发送实际的PN532命令,例如:
I have come this far: 我走了这么远:
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();
}
I appreciate your help! 我感谢您的帮助!
Many thanks in advance!! 提前谢谢了!!
Assuming 08 D406 6305 630D 6338 means 假设08 D406 6305 630D 6338表示
It would look like this: 它看起来像这样:
byte[] command = new byte[8] { (byte) 0xD4, 0x06, 0x63, 0x05, 0x63, 0x0D, 0x63, 0x38 };
You can leave out the the 8
since javac will count the bytes for you. 您可以省略
8
因为javac会为您计算字节数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.