Fix detection of targets without ATS.

This commit is contained in:
Romain Tartiere 2010-10-08 12:31:07 +00:00
parent 22500eaaf6
commit 215439cf67

View file

@ -53,8 +53,8 @@ freefare_tag_new (nfc_device_t *device, nfc_iso14443a_info_t nai)
for (size_t i = 0; i < sizeof (supported_tags) / sizeof (struct supported_tag); i++) { for (size_t i = 0; i < sizeof (supported_tags) / sizeof (struct supported_tag); i++) {
if (((nai.szUidLen == 4) || (nai.abtUid[0] == NXP_MANUFACTURER_CODE)) && if (((nai.szUidLen == 4) || (nai.abtUid[0] == NXP_MANUFACTURER_CODE)) &&
(nai.btSak == supported_tags[i].SAK) && (nai.btSak == supported_tags[i].SAK) &&
(nai.szAtsLen == supported_tags[i].ATS_length) && (!supported_tags[i].ATS_length || (nai.szAtsLen == supported_tags[i].ATS_length) &&
(0 == memcmp (nai.abtAts, supported_tags[i].ATS, ATS_LENGTH))) { (0 == memcmp (nai.abtAts, supported_tags[i].ATS, ATS_LENGTH)))) {
tag_info = &(supported_tags[i]); tag_info = &(supported_tags[i]);
found = true; found = true;