Modify code to add compatibility of readers

Follow the NXP  Contactless card IC rules to be compatible with Feitian new and old R502 reader.
This commit is contained in:
Feitian Technologies 2020-10-20 14:29:15 +08:00 committed by GitHub
parent 435e2ffc81
commit 0cd314c514
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -351,9 +351,15 @@ static int pcsc_props_to_target(struct nfc_device *pnd, uint8_t it, const uint8_
if (is_pcsc_reader_vendor_feitian(pnd)) { if (is_pcsc_reader_vendor_feitian(pnd)) {
uint8_t atqa[2]; uint8_t atqa[2];
pcsc_get_atqa(pnd, atqa, sizeof(atqa)); pcsc_get_atqa(pnd, atqa, sizeof(atqa));
//memcpy(pnt->nti.nai.abtAtqa,atqa,2); //ATQA Coding of NXP Contactless Card ICs
pnt->nti.nai.abtAtqa[0] = atqa[1]; if(ataq[0] = 0x00 || atqa[0] == 0x03)
pnt->nti.nai.abtAtqa[1] = atqa[0]; {
memcpy(pnt->nti.nai.abtAtqa,atqa,2);
}else {
pnt->nti.nai.abtAtqa[0] = atqa[1];
pnt->nti.nai.abtAtqa[1] = atqa[0];
}
uint8_t sak[1]; uint8_t sak[1];
pcsc_get_sak(pnd, sak, sizeof(sak)); pcsc_get_sak(pnd, sak, sizeof(sak));
pnt->nti.nai.btSak = sak[0]; pnt->nti.nai.btSak = sak[0];