I've been using the ACR122 card reader for a while which had no trouble reading either Mifare 1K or Mifare Ultralight NFC cards.
After upgrading the card reader to the newest version (ACR1251), my program can't read the UID from the Mifare 1K cards.
This is the snippet I use for reading:
CardTerminal terminal = terminalWithCardPresent.get(0);
terminal.waitForCardPresent(0);
Card card = terminal.connect("T=1");
if (card != null) {
CommandAPDU command = new CommandAPDU((byte) 0xFF, (byte) 0xCA, (byte) 0x00, (byte) 0x00, (byte) 0x07);
CardChannel channel = card.getBasicChannel();
ResponseAPDU response = channel.transmit(command);
StringBuilder sb = new StringBuilder();
if (response.getSW1() == 0x90 && response.getSW2() == 0x00) {
byte[] data = response.getData();
String code = decoder.apply(data);
sb.append(code);
}
cardIdRead.recieve(sb.toString());
}
terminal.waitForCardAbsent(0);
With the new version of the rad reader:
- the ResponseAPDU.getSW1() function returns 98
- while getSW2() returns 130
I've tried searching both the web and the card readers documentation for an explanation for the response codes with no luck. Anyone else had simular problems, and know how to read the UID from a card returnon sw1 sw2 98 130?