- if (WaitForResponseTimeout(CMD_ACK, &resp, 1000)) {
- uint8_t isOK = resp.arg[0] & 0xFF;
- uint16_t tagtype = resp.arg[1] & 0xFFF;
- if ( isOK ) {
- PrintAndLog(" UID : %s", sprint_hex(resp.d.asBytes, 4));
- switch(tagtype) {
- case 22: PrintAndLog("MIM22 card (22bytes)"); break;
- case 256: PrintAndLog("MIM256 card (256bytes)"); break;
- case 1024: PrintAndLog("MIM1024 card (1024bytes)"); break;
- default: {
- PrintAndLog("Unknown card format: %x", tagtype);
- return 1;
- }
- }
- } else {
- if ( verbose ) PrintAndLog("legic card select failed");
- return 1;
- }
- } else {