Topic: Retry on failure?

Would it be good to retry sending commands if they don't return the expected response?

For example in pn532_uart_send do something like?

  if (pn53x_check_ack_frame (pnd, abtRxBuf, sizeof(abtRxBuf))) {
    // The PN53x is running the sent command
  } else {
      // ******  try resending up to 3 times
      pn532_uart_send_helper(pnd, pbtData, szData, attempts+1);

      return false;
  }

As one wrinkle, I don't think it should do this during serial autoprobing, so a mechanism would also be need to be added to disable retries.

Also, would it be OK to return different error codes for the different failures and have a method that can convert the error code to text to be able to display what command failed (even when logging is turned off)?

Any thoughts? Thanks!

Re: Retry on failure?

Hello Ektimo,

Do the case append to you ?

I never happend to me...

Romuald Conty

Re: Retry on failure?

No, it never really happened. There was a case where the chip hadn't been woken up correctly (related to our MCU) and resending commands sometimes helped get past that.