Most libnfc functions return 0 on success or one of error codes defined on failure.
◆ NFC_ECHIP
Device's internal chip error
Definition at line 220 of file nfc.h.
◆ NFC_EDEVNOTSUPP
Operation not supported by device
Definition at line 170 of file nfc.h.
◆ NFC_EINVARG
Invalid argument(s)
Definition at line 165 of file nfc.h.
◆ NFC_EIO
Input / output error, device may not be usable anymore without re-open it
Definition at line 160 of file nfc.h.
◆ NFC_EMFCAUTHFAIL
MIFARE Classic: authentication failed
Definition at line 210 of file nfc.h.
◆ NFC_ENOTIMPL
Not (yet) implemented
Definition at line 195 of file nfc.h.
◆ NFC_ENOTSUCHDEV
No such device
Definition at line 175 of file nfc.h.
◆ NFC_EOPABORTED
Operation aborted (by user)
Definition at line 190 of file nfc.h.
◆ NFC_EOVFLOW
Buffer overflow
Definition at line 180 of file nfc.h.
◆ NFC_ERFTRANS
Error while RF transmission
Definition at line 205 of file nfc.h.
◆ NFC_ESOFT
Software error (allocation, file/pipe creation, etc.)
Definition at line 215 of file nfc.h.
◆ NFC_ETGRELEASED
Target released
Definition at line 200 of file nfc.h.
◆ NFC_ETIMEOUT
Operation timed out
Definition at line 185 of file nfc.h.
◆ NFC_SUCCESS
Success (no error)
Definition at line 155 of file nfc.h.
◆ nfc_device_get_last_error()
int nfc_device_get_last_error |
( |
const nfc_device * |
pnd | ) |
|
Returns last error occured on a nfc_device.
- Returns
- Returns an integer that represents to libnfc's error code.
- Parameters
-
pnd | nfc_device struct pointer that represent currently used device |
Definition at line 1195 of file nfc.c.
◆ nfc_perror()
void nfc_perror |
( |
const nfc_device * |
pnd, |
|
|
const char * |
pcString |
|
) |
| |
Display the last error occured on a nfc_device.
- Parameters
-
pnd | nfc_device struct pointer that represent currently used device |
pcString | a string |
Definition at line 1183 of file nfc.c.
◆ nfc_strerror()
const char* nfc_strerror |
( |
const nfc_device * |
pnd | ) |
|
Return the last error string.
- Returns
- Returns a string
- Parameters
-
pnd | nfc_device struct pointer that represent currently used device |
Definition at line 1148 of file nfc.c.
◆ nfc_strerror_r()
int nfc_strerror_r |
( |
const nfc_device * |
pnd, |
|
|
char * |
pcStrErrBuf, |
|
|
size_t |
szBufLen |
|
) |
| |
Renders the last error in pcStrErrBuf for a maximum size of szBufLen chars.
- Returns
- Returns 0 upon success
- Parameters
-
pnd | nfc_device struct pointer that represent currently used device |
pcStrErrBuf | a string that contains the last error. |
szBufLen | size of buffer |
Definition at line 1171 of file nfc.c.