Skip to content

Commit

Permalink
Turn off encryption after halting
Browse files Browse the repository at this point in the history
Turning off encryption MUST happen after the command has been
sent. Because of this the card is never halted. This is what is
causing the same card to be read over and over again.

Please note that if the card is halted, the status returned will be ERR
- the card it halted and so can not respond. so a timeout will occur. In
this instance, this is the correct response.

Fixes #9.
  • Loading branch information
ljos committed Feb 19, 2016
1 parent 474fdd7 commit 88ac553
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions MFRC522.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,7 @@ int MFRC522::haltTag() {
buffer[0] = MF1_HALT;
buffer[1] = 0;
calculateCRC(buffer, 2, &buffer[2]);
clearBitMask(Status2Reg, 0x08); // turn off encryption
status = commandTag(MFRC522_TRANSCEIVE, buffer, 4, buffer, &len);

clearBitMask(Status2Reg, 0x08); // turn off encryption
return status;
}

0 comments on commit 88ac553

Please sign in to comment.