+
+ iso14b_card_select_t card;
+ memcpy(&card, (iso14b_card_select_t *)resp.d.asBytes, sizeof(iso14b_card_select_t));
+
+ uint64_t status = resp.arg[0];
+
+ switch( status ){
+ case 0:
+ PrintAndLog(" UID : %s", sprint_hex(card.uid, card.uidlen));
+ PrintAndLog(" ATQB : %s", sprint_hex(card.atqb, sizeof(card.atqb)));
+ PrintAndLog(" CHIPID : %02X", card.chipid);
+ print_atqb_resp(card.atqb, card.cid);
+ isSuccess = TRUE;
+ break;
+ case 2:
+ if (verbose) PrintAndLog("iso14443-3 ATTRIB fail");
+ break;
+ case 3:
+ if (verbose) PrintAndLog("iso14443-3 CRC fail");
+ break;
+ default:
+ if (verbose) PrintAndLog("iso14443b card select failed");
+ break;
+ }
+
+ rawClose();
+ return isSuccess;
+}
+
+// test for other 14b type tags (mimic another reader - don't have tags to identify)
+bool HF14B_Other_Reader(){
+
+ // uint8_t data[] = {0x00, 0x0b, 0x3f, 0x80};
+ // uint8_t datalen = 4;
+
+ // // 14b get and print UID only (general info)
+ // uint32_t flags = ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_RAW | ISO14B_APPEND_CRC;
+
+ // UsbCommand c = {CMD_ISO_14443B_COMMAND, {flags, datalen, 0}};
+ // memcpy(c.d.asBytes, data, datalen);
+
+ // clearCommandBuffer();
+ // SendCommand(&c);
+ // UsbCommand resp;
+ // WaitForResponse(CMD_ACK,&resp);
+
+ // if (datalen > 2 ) {
+ // printandlog ("\n14443-3b tag found:");
+ // printandlog ("unknown tag type answered to a 0x000b3f80 command ans:");
+ // //printandlog ("%s", sprint_hex(data, datalen));
+ // rawclose();
+ // return true;
+ // }
+
+ // c.arg1 = 1;
+ // c.d.asBytes[0] = ISO14443B_AUTHENTICATE;
+ // clearCommandBuffer();
+ // SendCommand(&c);
+ // UsbCommand resp;
+ // WaitForResponse(CMD_ACK, &resp);
+
+ // if (datalen > 0) {
+ // PrintAndLog ("\n14443-3b tag found:");
+ // PrintAndLog ("Unknown tag type answered to a 0x0A command ans:");
+ // // PrintAndLog ("%s", sprint_hex(data, datalen));
+ // rawClose();
+ // return TRUE;
+ // }
+
+ // c.arg1 = 1;
+ // c.d.asBytes[0] = ISO14443B_RESET;
+ // clearCommandBuffer();
+ // SendCommand(&c);
+ // UsbCommand resp;
+ // WaitForResponse(CMD_ACK, &resp);
+
+ // if (datalen > 0) {
+ // PrintAndLog ("\n14443-3b tag found:");
+ // PrintAndLog ("Unknown tag type answered to a 0x0C command ans:");
+ // PrintAndLog ("%s", sprint_hex(data, datalen));
+ // rawClose();
+ // return TRUE;
+ // }
+
+ // rawClose();
+ return FALSE;
+}
+
+// get and print general info about all known 14b chips
+bool HF14BReader(bool verbose){
+
+ // try std 14b (atqb)
+ if (HF14B_Std_Reader(verbose)) return TRUE;