- 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.
- Add timeout on InJumpForDEP (pn53x) and initiator_select_dep (libnfc API)
- test_dep now works again (except 424Kbps)
- Fix ndi.ndm feeling when select a DEP target
Important: test_dep does not work on PN53x_USB devices after running previous tests
- 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]
- Attempt to sort errors depending their source
- Rename DE* errors to differenciate Device-Error and Driver-Error
- Add ENOTIMPL error to raise a error when a feature is not (yet) implemented in libnfc
nfc_disconnect() now switch NFC device into idle before disconnecting;
pn53x_data now have a operating_mode enum to know the current running mode (initiator, target or idle);
new pn53x_PowerDown wrapper for PowerDown (PN532) command;
Note: ARYGON idle mode now to be implemented and ACR122 does not support this mode.
iAbortFd file descriptor array have been removed from nfc_device_t;
nfc_abort_command() can now failed (return false);
nfc_abort_command() now call abort_command pointer from drivers;
pn532_uart and arygon drivers use a pipe-based mecanism (similar from previous one);
pn53x_usb driver use a boolean flag-based mecanism (the previous one does not work as expected);
pn53x_usb now print smarter messages on error at usb connection;
pn53x_usb now handle a strange case: sometimes, the first sent command is not ACKed by PN53x USB device, a dummy command is now sent.
Always use nfc_initiator_transceive_bytes(). If you where using advanced
features and already relying on nfc_initiator_transceive_bytes(), then your
code has to be updated to unset the NDO_EASY_FRAMING option. See an example of
such a change in the libfreefare's repository:
http://code.google.com/p/nfc-tools/source/detail?r=566
Updates issue 106
Status: Feedback
Romuald: I am not sure about the option enum values. I took 0x02 thinking it
would not hurt but am not really sure about that because I can see many 'holes'
in the sequence.
- Define two sets of DE<FOOBAR> macros: the first one for 'generic' errors
which could be encountered regardless of the NFC device the library is acting
with (0xX000), and ont set for device-dependant errors (0x0X00).
- Make some more functions accept a nfc_device_t* as first argument to have
access to the iLastError;
- Reset errors when entering public API functions;
- Save errors when applicable;
- Distinguish system-level errors (e.g. I/O error) and operational errors (the
PCD returns an unexpected value);
- Minor tweaks.
Update issue 65
Status: Feedback
New review:
Owner: rconty@il4p.fr
Cc: rtartiere@il4p.fr
Summary: Review the error-handling code.
Branch: /branches/libnfc-error-handling
For this development, a strong emphasis has been set on making changes that
will not go through our way on the way to libnfc-1.6+. For this reason, some
constructs are not natural (e.g. error codes defined in two different places),
please keep this in mind when reviewing.
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.