Modify pcsc.c to have support for Mifare classic and Ultralight card

Modify pcsc.c and mifare.c files.
1. add code into pcsc.c to have support Mifare classic card.
2. The PCSC reader has SW value, add response data length for PCSC
reader
This commit is contained in:
hongbin@ftsafe.com 2020-05-13 12:15:28 +08:00
parent 66176016ed
commit 8352c80679
2 changed files with 259 additions and 71 deletions

View file

@ -130,7 +130,9 @@ nfc_initiator_mifare_cmd(nfc_device *pnd, const mifare_cmd mc, const uint8_t ui8
// When we have executed a read command, copy the received bytes into the param
if (mc == MC_READ) {
if (res == 16) {
//Check the length of response data, with PCSC reader, there have 2 bytes for SW value
if (res == 16 || res == (16 + 2)) {
memcpy(pmp->mpd.abtData, abtRx, 16);
} else {
return false;