Skip to content

Commit

Permalink
Modify code to add compatibility of readers
Browse files Browse the repository at this point in the history
Follow the NXP  Contactless card IC rules to be compatible with Feitian new and old R502 reader.
  • Loading branch information
FeitianSmartcardReader committed Oct 20, 2020
1 parent 435e2ff commit 0cd314c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions libnfc/drivers/pcsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
uint8_t atqa[2];
pcsc_get_atqa(pnd, atqa, sizeof(atqa));
//memcpy(pnt->nti.nai.abtAtqa,atqa,2);
pnt->nti.nai.abtAtqa[0] = atqa[1];
pnt->nti.nai.abtAtqa[1] = atqa[0];
//ATQA Coding of NXP Contactless Card ICs
if(ataq[0] = 0x00 || atqa[0] == 0x03)
{
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];
pcsc_get_sak(pnd, sak, sizeof(sak));
pnt->nti.nai.btSak = sak[0];
Expand Down

0 comments on commit 0cd314c

Please sign in to comment.