- UsbCommand c = {CMD_READER_ISO_14443a, {strtol(Cmd, NULL, 0), 0, 0}};
- SendCommand(&c);
- return 0;
+ UsbCommand c = {CMD_READER_ISO_14443a, {ISO14A_CONNECT, 0, 0}};
+ SendCommand(&c);
+ UsbCommand * resp = WaitForResponse(CMD_ACK);
+ uint8_t * uid = resp->d.asBytes;
+ iso14a_card_select_t * card = uid + 12;
+
+ if(resp->arg[0] == 0) {
+ PrintAndLog("iso14443a card select failed");
+ return 0;
+ }
+
+ PrintAndLog("ATQA : %02x %02x", card->atqa[0], card->atqa[1]);
+ PrintAndLog(" UID : %s", sprint_hex(uid, 12));
+ PrintAndLog(" SAK : %02x [%d]", card->sak, resp->arg[0]);
+ if(resp->arg[0] == 1)
+ PrintAndLog(" ATS : %s", sprint_hex(card->ats, card->ats_len));
+ else
+ PrintAndLog("proprietary non-iso14443a card found, RATS not supported");
+
+ return resp->arg[0];