various minor fixes/enhancements

This commit is contained in:
Romuald Conty 2012-01-06 13:08:16 +00:00
parent e15f2eedbb
commit 7df3bb5aeb
3 changed files with 8 additions and 5 deletions

View file

@ -118,7 +118,7 @@ main (int argc, const char *argv[])
printf ("Connected to NFC reader: %s\n", nfc_device_get_name (pnd));
printf ("NFC device will poll during %ld ms (%u pollings of %lu ms for %zd modulations)\n", (unsigned long) uiPollNr * szModulations * uiPeriod * 150, uiPollNr, (unsigned long) uiPeriod * 150, szModulations);
if ((res = nfc_initiator_poll_target (pnd, nmModulations, szModulations, uiPollNr, uiPeriod, &nt)) < 0) {
nfc_perror (pnd, "nfc_initiator_poll_targets");
nfc_perror (pnd, "nfc_initiator_poll_target");
nfc_disconnect (pnd);
exit (EXIT_FAILURE);
}

View file

@ -796,7 +796,7 @@ pn53x_set_property_bool (struct nfc_device *pnd, const nfc_property property, co
// to "gain" a sort-of hardware polling (ie. like PN532 does)
if (pn53x_RFConfiguration__MaxRetries (pnd,
(bEnable) ? 0xff : 0x00, // MxRtyATR, default: active = 0xff, passive = 0x02
(bEnable) ? 0xff : 0x00, // MxRtyPSL, default: 0x01
(bEnable) ? 0xff : 0x01, // MxRtyPSL, default: 0x01
(bEnable) ? 0xff : 0x02 // MxRtyPassiveActivation, default: 0xff (0x00 leads to problems with PN531)
) == 0)
return NFC_SUCCESS;
@ -1144,7 +1144,7 @@ pn53x_initiator_select_dep_target(struct nfc_device *pnd,
nfc_target *pnt,
const int timeout)
{
const uint8_t abtPassiveInitiatorData[] = { 0x00, 0xff, 0xff, 0x00, 0x00 }; // Only for 212/424 kpbs: First 4 bytes shall be set like this according to NFCIP-1, last byte is TSN (Time Slot Number)
const uint8_t abtPassiveInitiatorData[] = { 0x00, 0xff, 0xff, 0x00, 0x0f }; // Only for 212/424 kpbs: First 4 bytes shall be set like this according to NFCIP-1, last byte is TSN (Time Slot Number)
const uint8_t * pbtPassiveInitiatorData = NULL;
switch (nbr) {
@ -1843,6 +1843,9 @@ pn53x_target_receive_bits (struct nfc_device *pnd, uint8_t *pbtRx, const size_t
} else {
// Save the received bits
szRxBits = szFrameBits;
if ((szRx - 1) > szRxLen)
return NFC_EOVFLOW;
// Copy the received bytes
memcpy (pbtRx, abtRx + 1, szRx - 1);
}

View file

@ -726,7 +726,7 @@ print_nfc_target (const nfc_target nt, bool verbose)
print_nfc_iso14443b2ct_info (nt.nti.nci, verbose);
break;
case NMT_DEP:
printf ("D.E.P. (%s) target:\n", str_nfc_baud_rate(nt.nm.nbr));
printf ("D.E.P. (%s, %s) target:\n", str_nfc_baud_rate(nt.nm.nbr), (nt.nti.ndi.ndm == NDM_ACTIVE)? "active mode" : "passive mode");
print_nfc_dep_info (nt.nti.ndi, verbose);
break;
}