mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-03-10 17:43:49 +00:00
enhance new error handling
- add accessor to last error occured - add new public error NFC_ETGRELEASED (Target Released)
This commit is contained in:
11
libnfc/nfc.c
11
libnfc/nfc.c
@@ -433,7 +433,7 @@ nfc_initiator_poll_target (nfc_device *pnd,
|
||||
|
||||
/**
|
||||
* @brief Select a target and request active or passive mode for D.E.P. (Data Exchange Protocol)
|
||||
* @return Returns selected D.E.P tagets count on success, otherwise returns libnfc's error code (negative value).
|
||||
* @return Returns selected D.E.P targets count on success, otherwise returns libnfc's error code (negative value).
|
||||
*
|
||||
* @param pnd \a nfc_device struct pointer that represent currently used device
|
||||
* @param ndm desired D.E.P. mode (\a NDM_ACTIVE or \a NDM_PASSIVE for active, respectively passive mode)
|
||||
@@ -791,6 +791,15 @@ nfc_perror (const nfc_device *pnd, const char *pcString)
|
||||
fprintf (stderr, "%s: %s\n", pcString, nfc_strerror (pnd));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns last error occured on a nfc_device
|
||||
*/
|
||||
int
|
||||
nfc_device_get_last_error (const nfc_device *pnd)
|
||||
{
|
||||
return pnd->last_error;
|
||||
}
|
||||
|
||||
/* Special data accessors */
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user