diff --git a/libnfc/buses/uart_posix.c b/libnfc/buses/uart_posix.c index 28e47ef..15fc743 100644 --- a/libnfc/buses/uart_posix.c +++ b/libnfc/buses/uart_posix.c @@ -221,6 +221,8 @@ uart_receive (serial_port sp, byte_t * pbtRx, size_t * pszRx) .tv_usec = uiTimeoutStatic + (uiTimeoutPerByte * iExpectedByteCount), }; struct timeval tv = tvTimeout; + DBG("Expected bytes count: %d", iExpectedByteCount); + // if(iExpectedByteCount>250) { abort(); }; // Reset the output count *pszRx = 0; @@ -239,7 +241,7 @@ uart_receive (serial_port sp, byte_t * pbtRx, size_t * pszRx) if (res == 0) { if (*pszRx == 0) { // Error, we received no data - // DBG ("RX time-out (%lu µs), buffer empty.", tvTimeout.tv_usec); + DBG ("RX time-out (%lu µs), buffer empty.", tvTimeout.tv_usec); return DETIMEOUT; } else { // We received some data, but nothing more is available @@ -261,10 +263,12 @@ uart_receive (serial_port sp, byte_t * pbtRx, size_t * pszRx) } *pszRx += res; - tv.tv_usec = uiTimeoutPerByte * MIN( iExpectedByteCount, 16 ); // Reload timeout with a low value to prevent from waiting too long on slow devices (16x is enought to took at least 1 byte) - // DBG("Timeout reloaded at: %d µs", tv.tv_usec); + tv.tv_usec = uiTimeoutPerByte * MIN( iExpectedByteCount, 16 ); + DBG("Timeout reloaded at: %d µs", tv.tv_usec); } while (byteCount && (iExpectedByteCount > 0)); + DBG("Remaining expected bytes count: %d", iExpectedByteCount); + return 0; } diff --git a/manual-test-results.txt b/manual-test-results.txt index 0ea0fe7..6b9f1f3 100644 --- a/manual-test-results.txt +++ b/manual-test-results.txt @@ -4,6 +4,7 @@ r736, nfc-anticol, ACS ACR122U PICC Interface 00 00 / ACR122U102 - PN532 v1.4, DESfire, OK r736, nfc-anticol, ACS ACR122U PICC Interface 00 00 / ACR122U102 - PN532 v1.4, MFC, OK r736, nfc-anticol, ACS ACR122U PICC Interface 00 00 / ACR122U102 - PN532 v1.4, UL, OK +r846, nfc-anticol, ARYGON 00V5.1 (/dev/ttyUSB0) - PN532 v1.4 (APDB2UA33), MFC, OK r736, nfc-anticol, SCM Micro / SCL3711-NFC&RW - PN533 v2.7, DESfire, OK r736, nfc-anticol, SCM Micro / SCL3711-NFC&RW - PN533 v2.7, MFC, OK r736, nfc-anticol, SCM Micro / SCL3711-NFC&RW - PN533 v2.7, UL, OK @@ -30,6 +31,7 @@ r736, nfc-list, ACS ACR122U PICC Interface 00 00 / ACR122U102 - PN532 v1.4, topa r736, nfc-list, ACS ACR122U PICC Interface 00 00 / ACR122U102 - PN532 v1.4, typeB Calypso, OK r736, nfc-list, ACS ACR122U PICC Interface 00 00 / ACR122U102 - PN532 v1.4, ULC, OK r736, nfc-list, ACS ACR 38U-CCID 00 00 / ACR122U102 - PN532 v1.4, DESFire, OK +r846, nfc-list, ARYGON 00V5.1 (/dev/ttyUSB0) - PN532 v1.4 (APDB2UA33), MFC, OK r736, nfc-list, SCM Micro / SCL3711-NFC&RW - PN533 v2.7, 2 DESfire, OK r736, nfc-list, SCM Micro / SCL3711-NFC&RW - PN533 v2.7, 2 UL, OK r736, nfc-list, SCM Micro / SCL3711-NFC&RW - PN533 v2.7, DESFire, OK @@ -39,6 +41,7 @@ r736, nfc-list, SCM Micro / SCL3711-NFC&RW - PN533 v2.7, topaz, OK r736, nfc-list, SCM Micro / SCL3711-NFC&RW - PN533 v2.7, typeB Calypso, OK r736, nfc-list, SCM Micro / SCL3711-NFC&RW - PN533 v2.7, ULC, OK r736, nfc-mfclassic r a foo, ACS ACR122U PICC Interface 00 00 / ACR122U102 - PN532 v1.4, MFC, OK +r846, nfc-mfclassic r a foo, ARYGON 00V5.1 (/dev/ttyUSB0) - PN532 v1.4 (APDB2UA33), MFC, OK r736, nfc-mfclassic r a foo, SCM Micro / SCL3711-NFC&RW - PN533 v2.7, MFC, OK r736, nfc-mfultralight r foo, ACS ACR122U PICC Interface 00 00 / ACR122U102 - PN532 v1.4, UL, OK r736, nfc-mfultralight r foo, SCM Micro / SCL3711-NFC&RW - PN533 v2.7, UL, OK @@ -49,8 +52,12 @@ r739, nfc-poll, ACS ACR122U PICC Interface 00 00 / ACR122U102 - PN532 v1.4, MFC, r739, nfc-poll, ACS ACR122U PICC Interface 00 00 / ACR122U102 - PN532 v1.4, topaz, OK r739, nfc-poll, ACS ACR122U PICC Interface 00 00 / ACR122U102 - PN532 v1.4, typeB Calypso, OK r739, nfc-poll, ACS ACR122U PICC Interface 00 00 / ACR122U102 - PN532 v1.4, ULC, OK +r846, nfc-poll, ARYGON 00V5.1 (/dev/ttyUSB0) - PN532 v1.4 (APDB2UA33), MFC, FAIL +r849, nfc-poll, ARYGON 00V5.1 (/dev/ttyUSB0) - PN532 v1.4 (APDB2UA33), MFC, OK r736, pn53x-diagnose, ACS ACR122U PICC Interface 00 00 / ACR122U102 - PN532 v1.4, N/A, OK r736, pn53x-diagnose, ACS ACR 38U-CCID 00 00 / ACR122U102 - PN532 v1.4, N/A, OK +r846, pn53x-diagnose, ARYGON 00V5.1 (/dev/ttyUSB0) - PN532 v1.4 (APDB2UA33), N/A, FAIL +r849, pn53x-diagnose, ARYGON 00V5.1 (/dev/ttyUSB0) - PN532 v1.4 (APDB2UA33), N/A, OK r736, pn53x-diagnose, SCM Micro / SCL3711-NFC&RW - PN533 v2.7, N/A, OK r744, pn53x-sam (mode 1), Philips / PN531 - PN531 v4.2 + SAM, CardMan 5321, OK r736, pn53x-tamashell < pn53x-tamashell-scripts/UltraLightRead.cmd, ACS ACR122U PICC Interface 00 00 / ACR122U102 - PN532 v1.4, ultralight, OK