identification fix for magic chinese cards (#444)
authorOleg Moiseenko <olegmsn@gmail.com>
Wed, 25 Oct 2017 05:56:03 +0000 (08:56 +0300)
committerpwpiwi <pwpiwi@users.noreply.github.com>
Wed, 25 Oct 2017 05:56:03 +0000 (07:56 +0200)
* fixed #411

armsrc/mifarecmd.c
client/mifarehost.c

index edafe0a34129d922397e7deb40fc7bc4f09d4e9e..39029d4e3429dcc2e4202aaf80e21477a99d4c84 100644 (file)
@@ -1510,6 +1510,16 @@ void MifareCIdent(){
 \r
        uint8_t receivedAnswer[MAX_MIFARE_FRAME_SIZE];\r
        uint8_t receivedAnswerPar[MAX_MIFARE_PARITY_SIZE];\r
+       \r
+       LED_A_ON();\r
+       LED_B_OFF();\r
+       LED_C_OFF();\r
+//     FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);\r
+//     SpinDelay(100);\r
+       iso14443a_setup(FPGA_HF_ISO14443A_READER_LISTEN);\r
+\r
+       clear_trace();\r
+       set_tracing(true);      \r
 \r
        ReaderTransmitBitsPar(wupC1,7,0, NULL);\r
        if(ReaderReceive(receivedAnswer, receivedAnswerPar) && (receivedAnswer[0] == 0x0a)) {\r
@@ -1523,8 +1533,13 @@ void MifareCIdent(){
 \r
        // From iceman1001: removed the if,  since some magic tags misbehavies and send an answer to it.\r
        mifare_classic_halt(NULL, 0);\r
-\r
+       \r
+       LED_B_ON();\r
        cmd_send(CMD_ACK,isOK,0,0,0,0);\r
+       LED_B_OFF();\r
+\r
+       FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);\r
+       LEDsoff();      \r
 }\r
 \r
 //\r
index a02019a316cbc52f6cbbe4cad8cea733c409f8f8..ca5d97e13ac1419cbfcac1598ab35d643a9166c7 100644 (file)
@@ -542,11 +542,12 @@ int mfCSetUID(uint8_t *uid, uint8_t *atqa, uint8_t *sak, uint8_t *oldUID) {
 \r
 int mfCIdentify()\r
 {\r
-       UsbCommand c = {CMD_READER_ISO_14443a, {ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0}};\r
-       SendCommand(&c);\r
+  UsbCommand c;\r
+//     UsbCommand c = {CMD_READER_ISO_14443a, {ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0}};\r
+//     SendCommand(&c);\r
 \r
-       UsbCommand resp;\r
-       WaitForResponse(CMD_ACK,&resp);\r
+  UsbCommand resp;\r
+//     WaitForResponse(CMD_ACK,&resp);\r
 \r
        // iso14a_card_select_t card;\r
        // memcpy(&card, (iso14a_card_select_t *)resp.d.asBytes, sizeof(iso14a_card_select_t));\r
@@ -578,11 +579,11 @@ int mfCIdentify()
        }\r
 \r
        // disconnect\r
-       c.cmd = CMD_READER_ISO_14443a;\r
-       c.arg[0] = 0;\r
-       c.arg[1] = 0;\r
-       c.arg[2] = 0;\r
-       SendCommand(&c);\r
+//     c.cmd = CMD_READER_ISO_14443a;\r
+//     c.arg[0] = 0;\r
+//     c.arg[1] = 0;\r
+//     c.arg[2] = 0;\r
+//     SendCommand(&c);\r
 \r
        return (int) isGeneration;\r
 }\r
Impressum, Datenschutz