libnfc  1.7.0-rc7
Macros | Functions
Error reporting

Macros

#define NFC_SUCCESS
 
#define NFC_EIO
 
#define NFC_EINVARG
 
#define NFC_EDEVNOTSUPP
 
#define NFC_ENOTSUCHDEV
 
#define NFC_EOVFLOW
 
#define NFC_ETIMEOUT
 
#define NFC_EOPABORTED
 
#define NFC_ENOTIMPL
 
#define NFC_ETGRELEASED
 
#define NFC_ERFTRANS
 
#define NFC_EMFCAUTHFAIL
 
#define NFC_ESOFT
 
#define NFC_ECHIP
 

Functions

const char * nfc_strerror (const nfc_device *pnd)
 Return the last error string. More...
 
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. More...
 
void nfc_perror (const nfc_device *pnd, const char *pcString)
 Display the last error occured on a nfc_device. More...
 
int nfc_device_get_last_error (const nfc_device *pnd)
 Returns last error occured on a nfc_device. More...
 

Detailed Description

Most libnfc functions return 0 on success or one of error codes defined on failure.

Macro Definition Documentation

#define NFC_ECHIP

Device's internal chip error

Definition at line 218 of file nfc.h.

#define NFC_EDEVNOTSUPP

Operation not supported by device

Definition at line 168 of file nfc.h.

#define NFC_EINVARG

Invalid argument(s)

Definition at line 163 of file nfc.h.

#define NFC_EIO

Input / output error, device may not be usable anymore without re-open it

Definition at line 158 of file nfc.h.

#define NFC_EMFCAUTHFAIL

MIFARE Classic: authentication failed

Definition at line 208 of file nfc.h.

#define NFC_ENOTIMPL

Not (yet) implemented

Definition at line 193 of file nfc.h.

#define NFC_ENOTSUCHDEV

No such device

Definition at line 173 of file nfc.h.

#define NFC_EOPABORTED

Operation aborted (by user)

Definition at line 188 of file nfc.h.

#define NFC_EOVFLOW

Buffer overflow

Definition at line 178 of file nfc.h.

#define NFC_ERFTRANS

Error while RF transmission

Definition at line 203 of file nfc.h.

#define NFC_ESOFT

Software error (allocation, file/pipe creation, etc.)

Definition at line 213 of file nfc.h.

#define NFC_ETGRELEASED

Target released

Definition at line 198 of file nfc.h.

#define NFC_ETIMEOUT

Operation timed out

Definition at line 183 of file nfc.h.

#define NFC_SUCCESS

Success (no error)

Definition at line 153 of file nfc.h.

Function Documentation

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
pndnfc_device struct pointer that represent currently used device

Definition at line 1123 of file nfc.c.

void nfc_perror ( const nfc_device pnd,
const char *  pcString 
)

Display the last error occured on a nfc_device.

Parameters
pndnfc_device struct pointer that represent currently used device
pcStringa string

Definition at line 1111 of file nfc.c.

const char* nfc_strerror ( const nfc_device pnd)

Return the last error string.

Returns
Returns a string
Parameters
pndnfc_device struct pointer that represent currently used device

Definition at line 1076 of file nfc.c.

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
pndnfc_device struct pointer that represent currently used device
pcStrErrBufa string that contains the last error.
szBufLensize of buffer

Definition at line 1099 of file nfc.c.