You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to use nfc_initiator_poll_target to poll for a card, and then connect using the libfreefare function corresponding to the card type.
The following works fine for mifare_classic:
nfc_initiator_poll_target(..., candidate)
tag = freefare_tag_new(candidate)
mifare_classic_connect(tag)
mifare_classic_authenticate(tag)
mifare_classic_read(tag)
If I attempt the same for desfire, the call to mifare_desfire_connect hangs until I remove and replace the desfire card:
nfc_initiator_poll_target(..., candidate)
tag = freefare_tag_new(candidate)
mifare_desfire_connect(tag) // hangs here
It actually hangs on line 298 in mifare_desfire.c:
if (nfc_initiator_select_passive_target (tag->device, modulation, tag->info.nti.nai.abtUid, tag->info.nti.nai.szUidLen, &pnti) >= 0) {
I tried setting all parameters in this call to the same ones as used for mifare_classic, but to no avail.
I made an example by editing examples/nfc-poll.c from libnfc, add the following after line 153:
printf("Attempting desfire_connect..\n");
FreefareTag tag = freefare_tag_new(pnd, nt);
if (!tag) {
printf("freefare_tag_new failed");
}
res = mifare_desfire_connect(tag);
printf("Desfire_connect done.\n");
If you place a mifare classic card on the reader, the program will immediately continue until after printf("Desfire_connect done.\n")
If you place a desfire card on the reader, it will hang, and only continue after removing the card and replacing it.
I'm attempting to use nfc_initiator_poll_target to poll for a card, and then connect using the libfreefare function corresponding to the card type.
The following works fine for mifare_classic:
If I attempt the same for desfire, the call to mifare_desfire_connect hangs until I remove and replace the desfire card:
It actually hangs on line 298 in mifare_desfire.c:
I tried setting all parameters in this call to the same ones as used for mifare_classic, but to no avail.
I made an example by editing examples/nfc-poll.c from libnfc, add the following after line 153:
If you place a mifare classic card on the reader, the program will immediately continue until after printf("Desfire_connect done.\n")
If you place a desfire card on the reader, it will hang, and only continue after removing the card and replacing it.
What does work is the following:
But this is quite inefficient.
best regards,
Tom
PS: I originally reported this on the forum: http://forums.nfc-tools.org/post/5717/#p5717
The text was updated successfully, but these errors were encountered: