nfc-tools / libfreefare

A convenience API for NFC cards manipulations on top of libnfc.
Other
396 stars 105 forks source link

Introduce timeout on DESfire operations #98

Closed manu0402 closed 5 years ago

manu0402 commented 5 years ago

There are a few reasons why an NFC operation may timeout, including the pn533 USB toggle bit bug. In that case it helps to report the problem to calling process so that it can retry operation, instead of hanging forever.

For instance, mifare_desfire_format_picc() may make the chip unresponsive (see commit 91d3ff9cc4d3b59573c2301e0dc4c8f034ba13f2), but if calling process gets ETIMEDOUT, it can select_application, authenticate and format_picc again, with some success.

smortex commented 5 years ago

Thanks!