Update nfc-poll example to enhance unsupported features detection.

This commit is contained in:
Romain Tartiere 2010-08-20 10:16:52 +00:00
parent 084c001c11
commit 1e329529a7

View file

@ -117,12 +117,6 @@ main (int argc, const char *argv[])
printf ("Connected to NFC reader: %s\n", pnd->acName); printf ("Connected to NFC reader: %s\n", pnd->acName);
if (pnd->nc == NC_PN531) {
// PN531 doesn't support hardware polling (InAutoPoll)
// TODO find a way to handle this in higher level (i.e. libnfc)
WARN ("%s", "PN531 doesn't support hardware polling.");
continue;
}
printf ("PN53x will poll during %ld ms\n", (unsigned long) btPollNr * szTargetTypes * btPeriod * 150); printf ("PN53x will poll during %ld ms\n", (unsigned long) btPollNr * szTargetTypes * btPeriod * 150);
res = nfc_initiator_poll_targets (pnd, &nttMifare, 1, btPollNr, btPeriod, antTargets, &szTargetFound); res = nfc_initiator_poll_targets (pnd, &nttMifare, 1, btPollNr, btPeriod, antTargets, &szTargetFound);
if (res) { if (res) {
@ -134,7 +128,8 @@ main (int argc, const char *argv[])
print_nfc_iso14443a_info (antTargets[n].nti.nai); print_nfc_iso14443a_info (antTargets[n].nti.nai);
} }
} else { } else {
ERR ("%s", "Polling failed."); nfc_perror (pnd, "nfc_initiator_poll_targets");
exit (EXIT_FAILURE);
} }
nfc_disconnect (pnd); nfc_disconnect (pnd);