+int HFLegicInfo(const char *Cmd, bool verbose) {
+
+ char cmdp = param_getchar(Cmd, 0);
+ if ( cmdp == 'H' || cmdp == 'h' ) return usage_legic_info();
+
+ UsbCommand c = {CMD_LEGIC_INFO, {0,0,0}};
+ clearCommandBuffer();
+ SendCommand(&c);
+ UsbCommand resp;
+ 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 {
+ PrintAndLog("legic card select failed");
+ return 1;
+ }
+ } else {
+ PrintAndLog("command execution time out");
+ return 1;
+ }
+ return 0;
+}
+int CmdLegicInfo(const char *Cmd){
+ return HFLegicInfo(Cmd, TRUE);
+}
+