* in main():
** errx()/err()/return -> exit()
** return values -> EXIT_SUCCESS & EXIT_FAILURE
* out of main:
** err()/errx()/exit() -> return
** change retval from size_t to int to allow returning errors
** don't use EXIT_SUCCESS / EXIT_FAILURE as retvals
* add nfc_close() & nfc_exit() to exit() on errors
* add missing fclose() on errors
* add missing test if (pnd == NULL)
* unify style if (pnd == / != NULL)
* remove goto's
* few related fixes
* remove if(pnd!=NULL) test on nfc_close() calls
- nfc_device is now an opaque type;
- PN53x specific errors are not public anymore;
- nfc_device_name() renamed to nfc_device_get_name() for the sake of consistency;
- examples/*, utils/* uses the new nfc_device_get_name() function instead of access directly to struct's content;
- new error defined: NFC_ERFTRANS for notifying about RF transmission error, its used by mifare.c to detect permissions error on mifare;
- drivers initiator_transceive_bytes() function now returns libnfc's error code on failure (<0), and received bytes count on success (>=0);
- remove some unused errors.
- Provide a nfc_get_default_device() that allow to grab the connstring stored
in LIBNFC_DEFAULT_DEVICE environnement variable or returns the first
available device if not set;
- nfc_connect(NULL) now takes the default device (see
nfc_get_default_device());
- Removes nfc_driver_desc_t from public types
- Defines nfc_connstring as char[1024]
- examples/*: use nfc_connstring
- examples/nfc-poll: now uses only the default device (instead of all devices
availables)
- Removes parse_args() from nfc-utils.[hc]
Initialisation of RC-S360 in mode 0
Better generic nfc-list, does not rely only on DeSelect to avoid duplicates
Restore SetParameters for RC-S360
Handle Diagnose communication test properly
Tested:
- nfc-list => ok except for B' & 3B
- nfc-anticol => fails to send raw frames before select
- nfc-mfultralight => ok
- nfc-mfclassic => ok
- pn53x-tamashell => ok
- pn53x-diagnose => ok
- nfc-dep-initiator => ok
- nfc-dep-target => fails in InitAsTarget
- nfc-emulate-* => fails in InitAsTarget
Commands momentarily disabled for RC-S330:
- InDeselect
- InRelease
- select_passive_target for B'& 3B
use a new way to handle drivers
use absolute include path instead of relative ones
move some nfc_device_t members in a better place
nfc_device_t now embeddeds driver data and chip data pointers (useful to be more generic)
use more readable variables instead of strange coding convention
move PRINT_HEX macro into nfc-internal.h
silent warnings with more strict CFLAGS
chips/pn53x: use the powerful C99 writing to construct PN53x commands
chips/pn53x: remove almost all memcpy()
chips/pn53x: WriteRegister, ReadRegister and SetParameters command wrappers are correctly named
chips/pn53x: introduce chip state (SLEEP, NORMAL or EXECUTE)
chips/pn53x: add SAMConfiguration command wrapper (need to be improved)
chips/pn53x: remove almost all const arrays
chips/pn53x: use human readable defines for commands instead of hex values
chips/pn53x: in debug mode, the PN53x command is shown in human-readable string, awesome isn't it? ;-)
drivers: split transceive() into send() and receive() to be able to handle more cases (differed replies, abort commands, etc) later
drivers: use a const structure of functions instead of -dirty- callbacks array
drivers/pn532_uart: major improvement of UART handling
drivers/pn532_uart: check PN53x frames when received
buses/uart: receive() is now based on expected bytes instead of calculated timeouts..
buses/uart: use a smart way to determine available ports on POSIX systems (tested on Linux and FreeBSD)
chips/pn53x: adjust size and defines to better handle reply size;
drivers/arygon: improve attempted reply size, should speed up the connexion;
drivers/pn532_uart: improve attempted reply size, should speed up the connexion;
New Issue
Summary: Remove nfc-message.h file from installed ones
nfc-message.h provide some usefull debugging macros but I am not sure that these macros have to be installed with other files.
Avoid redundant code in PN53x usb and uart drivers. Since it makes sense to
report errors at the nfc_device_t level, pass it directly to
pn53x_transceive().
Programs using the libnfc MAY use pn53x_transceive() to communicate with a NFC
device, and SHALL not use anymore pnd->pdc->transceive(). Code in the library
itself SHOULD avoid calling pnd->pdc->transceive(), so such construct have been
updated accordingly.