CHG: some magic generation1 tags is not following protocol and answers to the "halt" command. This gives an error and makes the users think something went wrong. This also affected the magic identification in "Hf 14a reader" command, where it in those moments stated "NO" even if the tag is indeed a generation1.

This commit is contained in:
iceman1001 2015-11-01 22:16:16 +01:00
parent afa86e5c03
commit acd7ccdbc9

View file

@ -1078,7 +1078,7 @@ void MifareCSetBlock(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datai
}; };
if(mifare_classic_halt(NULL, cuid)) { if(mifare_classic_halt(NULL, cuid)) {
if (MF_DBGLEVEL >= 1) Dbprintf("Halt error"); if (MF_DBGLEVEL >= 4) Dbprintf("INFO - Tag answered the 'Halt' command");
break; break;
}; };
}; };
@ -1114,7 +1114,7 @@ void MifareCSetBlock(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datai
if (workFlags & 0x04) { if (workFlags & 0x04) {
if (mifare_classic_halt(NULL, cuid)) { if (mifare_classic_halt(NULL, cuid)) {
if (MF_DBGLEVEL >= 1) Dbprintf("Halt error"); if (MF_DBGLEVEL >= 4) Dbprintf("INFO - Tag answered the 'Halt' command");
break; break;
}; };
} }
@ -1192,7 +1192,7 @@ void MifareCGetBlock(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datai
if (workFlags & 0x04) { if (workFlags & 0x04) {
if (mifare_classic_halt(NULL, cuid)) { if (mifare_classic_halt(NULL, cuid)) {
if (MF_DBGLEVEL >= 1) Dbprintf("Halt error"); if (MF_DBGLEVEL >= 4) Dbprintf("INFO - Tag answered the 'Halt' command");
break; break;
}; };
} }
@ -1239,9 +1239,8 @@ void MifareCIdent(){
isOK = 0; isOK = 0;
}; };
if (mifare_classic_halt(NULL, 0)) { // removed the if, since some magic tags misbehavies and send an answer to it.
isOK = 0; mifare_classic_halt(NULL, 0);
};
cmd_send(CMD_ACK,isOK,0,0,0,0); cmd_send(CMD_ACK,isOK,0,0,0,0);
} }