miguelbalboa / rfid

Arduino RFID Library for MFRC522
The Unlicense
2.73k stars 1.42k forks source link

Help! How does the uid data is return to the buffer array in PICC_Select #611

Closed HalmondD closed 6 months ago

HalmondD commented 8 months ago

Like the tile say, when reading your code, It doesn't make any sense to me how does the PICC_Select return the uid data to the buffer array, the only time that you do the Transceive command, you pass in the responseBuffer as your receive data from your PCD_TransceiveData.

At the end, when selectDone = true, you copy the data from buffer[2] to buffer[5] (assume using 4byte card) to uidByte[0] to [3], isn't it make more sense if you copy it from responseBuffer (or buffer[6] to buffer[8]), but still that would not make any sense, since you trying to receive 4 byte of data and yet the responseLength is only 3 bytes. Can you please explain this to me?