Enhance error handeling.

- New API functions: nfc_strerror(), nfc_strerror_r() and nfc_perror();
  - Drivers now have a reference to chips callback methods;
  - Rename -pn53x_err2string to pn53x_strerror and add it to pn53x_callbacks_list.
This commit is contained in:
Romain Tartiere 2010-07-29 14:16:11 +00:00
parent 30e715cff0
commit daa178b18f
7 changed files with 96 additions and 63 deletions

View file

@ -78,6 +78,11 @@ NFC_EXPORT bool nfc_target_send_bits(nfc_device_t* pnd, const byte_t* pbtTx, con
NFC_EXPORT bool nfc_target_send_bytes(nfc_device_t* pnd, const byte_t* pbtTx, const size_t szTxLen);
NFC_EXPORT bool nfc_target_send_dep_bytes(nfc_device_t* pnd, const byte_t* pbtTx, const size_t szTxLen);
/* Error reporting */
NFC_EXPORT const char *nfc_strerror (const nfc_device_t *pnd);
NFC_EXPORT int nfc_strerror_r (const nfc_device_t *pnd, char *pcStrErrBuf, size_t szBufLen);
NFC_EXPORT void nfc_perror (const nfc_device_t *pnd, const char *pcString);
/* Special data accessors */
NFC_EXPORT const char* nfc_device_name(nfc_device_t* pnd);