Topic: r1314 ACR122S bugs

Hi,

I've just registered here to tell you about some discovery. Me and my friend were stuck for like 3 hours digging what is wrong.
For support of ACS ACR122S (firmware 1.4) we downloaded latest svn commit r1314. When trying nfc-list we've seen that device returning not all characters, just pseudo apdu for SUCCESS "02 00 00 03". While sending manually command over serial was returning complete one with firmware bytes, as it was specified.
So here's the faii:

Index: libnfc/drivers/acr122s.c
===================================================================
--- libnfc/drivers/acr122s.c    (wersja 1314)
+++ libnfc/drivers/acr122s.c    (kopia robocza)
@@ -251,9 +251,9 @@
 acr122s_recv_frame(nfc_device *pnd, uint8_t *frame, size_t frame_size, void *abort_p, int timeout)
 {
   if (frame_size < 13)
-    pnd->last_error = NFC_EINVARG;
+  {  pnd->last_error = NFC_EINVARG;
     return pnd->last_error;
-
+    }
   int ret;
   serial_port port = DRIVER_DATA(pnd)->port;

Someone forgot the bloody brackets! :-D But that's not all. The leftover was a strange situation that we've seen about the command returned showing the success bytes result for pn53x_init, but it was claiming as fail.
Success was 0, so making negation of 0 gives 1, so True.

@@ -621,7 +621,7 @@
   }
 #endif
 
-  if (!pn53x_init(pnd)) {
+  if (pn53x_init(pnd)) {
     log_put(LOG_CATEGORY, NFC_PRIORITY_ERROR, "%s", "Failed initializing PN532 chip.");
     acr122s_close(pnd);
     return NULL;

After all that I was surprised, because with the lib mfoc was able to recover all keys. Unlike my previous trial with ACR122U (firmware 1.6) with Input/Output error while exploting, but I think it still might be fixed :-)

Last edited by mastier (2012-02-04 06:11:25)