Commit graph

149 commits

Author SHA1 Message Date
Romain Tartiere
cbbe559f94 Alse remove nfc_target_receive_dep_bytes() and nfc_target_send_dep_bytes().
Update issue 106
Implement what's described in comment 3, 7 and 8.
2010-09-03 16:45:24 +00:00
Romain Tartiere
a5676ecd94 Remove nfc_initiator_transceive_dep_bytes() and introduce NDO_EASY_FRAMING option.
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.
2010-09-03 16:13:36 +00:00
Romuald Conty
d49439246c Fix ARYGON driver. 2010-08-31 12:55:45 +00:00
Romuald Conty
16330c2f65 Minor code clean up in pn532_uart 2010-08-31 12:54:59 +00:00
Romain Tartiere
1130036bf3 - Detect errors in pn53x_get_reg();
- Add a test case to confirm an endianness problem on little-endian machines.
2010-08-28 14:27:33 +00:00
Romain Tartiere
af291c5a16 Report errors of ACR122 devices in the transceive function. 2010-08-28 14:25:49 +00:00
Romain Tartiere
a676d34e5d Fix build on Microsoft Windows. 2010-08-24 11:03:59 +00:00
Romain Tartiere
cbc3a62db1 Remove extern reference to pn53x-specific commands.
Fixes issue 101.
2010-08-24 10:31:21 +00:00
Romain Tartiere
f8ed119d1b Reset pnd->iLastError in nfc.c. 2010-08-24 10:30:18 +00:00
Romain Tartiere
9b44e3b2b7 Rename some internal API to highlight the PN53x operating mode.
pn53x_select_dep_target    -> pn53x_initiator_select_dep_target
pn53x_transceive_dep_bytes -> pn53x_initiator_transceive_dep_bytes
pn53x_transceive_bits      -> pn53x_initiator_transceive_bits
pn53x_transceive_bytes     -> pn53x_initiator_transceive_bytes
2010-08-24 10:26:56 +00:00
Romain Tartiere
ecb51c3554 New internal API functions: pn53x_target_send_bits(), pn53x_target_send_bytes(). 2010-08-24 10:22:55 +00:00
Romain Tartiere
047f274270 New internal API functions: pn53x_target_receive_bits(), pn53x_target_receive_bytes(). 2010-08-24 10:20:04 +00:00
Romain Tartiere
92a6789013 New internal API function: pn53x_target_init(). 2010-08-24 10:17:38 +00:00
Romain Tartiere
7f698431b7 New internal API function: pn53x_target_send_dep_bytes(). 2010-08-24 10:13:09 +00:00
Romain Tartiere
3d69c8b694 New internal API function: pn53x_target_receive_dep_bytes(). 2010-08-24 10:11:48 +00:00
Romain Tartiere
7a231cfb03 New internal API functions: pn53x_transceive_bits(), pn53x_transceive_bytes(). 2010-08-24 09:59:45 +00:00
Romain Tartiere
3cba76cc6f New internal API function: pn53x_transceive_dep_bytes(). 2010-08-24 09:56:22 +00:00
Romain Tartiere
ca0d73875d New internal API function: pn53x_select_dep_target(). 2010-08-24 09:53:51 +00:00
Romain Tartiere
5055f3d30b New internal API function: pn53x_configure(). 2010-08-24 09:49:59 +00:00
Romain Tartiere
71b3a1ad6e New internal API function: pn53x_get_firmware_version(). 2010-08-24 09:47:03 +00:00
Romuald Conty
6a6ae42a97 Fix minor compilation warnings 2010-08-20 10:42:31 +00:00
Romain Tartiere
5b0589c381 Merge r551-563 from trunk. 2010-08-20 10:41:30 +00:00
Romain Tartiere
fd337dd0cc Also detect error frames in pn532_uart (tested) and arygon drivers (not tested). 2010-08-20 10:40:00 +00:00
Romuald Conty
dadaee4cc0 Fix ARYGON compilation 2010-08-20 10:28:11 +00:00
Romuald Conty
bd8a46c3c8 Fix pn532_uart compilation 2010-08-20 10:25:37 +00:00
Romuald Conty
084c001c11 Generate an error before sending InAutoPoll command if chip does not support it. 2010-08-20 10:11:06 +00:00
Romain Tartiere
f4aa4edc94 Rework and fix error frames detection.
While here, rename the pn53x_transceive_callback() function to
pn53x_transceive_check_ack_frame_callback() to make it more obvious what it is
supposed to do.
2010-08-20 10:06:19 +00:00
Romain Tartiere
b0737bd1a0 Fix pn53x_InAutoPoll(). 2010-08-20 09:36:38 +00:00
Romain Tartiere
5744c67039 Fix build on Microsoft Windows (not tested, no hardware). 2010-08-19 18:19:40 +00:00
Romuald Conty
8f19b078ff Add configuration option to enable/disable auto iso14443-4 mode. 2010-08-19 10:58:15 +00:00
Romuald Conty
edba53c5da Fix pn532_uart driver. 2010-08-19 09:01:39 +00:00
Romain Tartiere
076fa3686c Merge r547-550 from trunk. 2010-08-18 17:01:08 +00:00
Romain Tartiere
27b97c0fda Fix build on Microsoft Windows. 2010-08-18 16:55:16 +00:00
Romain Tartiere
c9f88e17a1 Reset pnd->iLastError in nfc.c. 2010-08-18 14:44:19 +00:00
Romain Tartiere
769eef20f7 Merge r520-546 from trunk. 2010-08-18 14:32:01 +00:00
Romuald Conty
d0fe1f8255 Fix debug trace of pn532_uart driver. 2010-08-18 13:56:31 +00:00
Romuald Conty
5c206b7815 Improve ISO14443B support of nfc_initiator_list_passive_targets() function. 2010-08-18 13:10:21 +00:00
Romuald Conty
43694183ff Minor documentation improvements. 2010-08-18 12:39:32 +00:00
Romuald Conty
0c19124984 Increase UART timeout to gain in stability. 2010-08-18 08:06:35 +00:00
Romuald Conty
c021a50768 Oups, r534 was not a joke... just a mistake ;-) This commit fix my r534. 2010-08-17 13:50:49 +00:00
Romuald Conty
88002bf977 Code cleaning: driver_connect() is never executed with pndd==NULL. 2010-08-17 13:31:32 +00:00
Romuald Conty
7788c33da8 Default serial-port paths are now fully hardcoded instead of half-hardcoded and soft-expanded. 2010-08-17 13:29:01 +00:00
Romuald Conty
476c05cfb4 Cleanup up nfc_initiator_list_passive_targets(): remove attempts to retrieve ATQA when collision occurs, after a lot of tests by Romain and me we are not able to find a way to retrieve all tags ATQA if different card types are on the nfc device. 2010-08-17 10:08:38 +00:00
Romuald Conty
3c57861d6b Improve pn53x_decode_target_data() function: move code from nfc_initiator_select_passive_target() to the right place (pn53x.c). 2010-08-17 10:01:11 +00:00
Romuald Conty
ae04479968 Move hardware polling function in pn53x.c/h. 2010-08-17 08:24:38 +00:00
Romain Tartiere
f797d737d3 Fix build on Microsoft Windows. 2010-08-16 17:43:48 +00:00
Romain Tartiere
08eb21aa9d Second part of error handling.
- 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.
2010-08-15 14:08:29 +00:00
Romain Tartiere
8a75f5b45e Fix wrong comment 2010-08-15 12:42:40 +00:00
Romain Tartiere
fab08a3951 Fix doxygen comment: the string SHALL NOT be freed (it's const BTW).
Or maybe I would rather have removed the const and called strdup(3)?

New issue
Summary: Sync code and comments
Owner: rconty@il4p.fr
Status: New
Romuald, can you please review this changeset and fix the code if I corrected
the wrong way (i.e. the comment was Okay and the code bogus while I fixed the
comment thinking the cod was right).

Thanks!
2010-08-13 19:10:31 +00:00
Romain Tartiere
57b775bae2 Always ACK on transmission.
New issue
Summary: Make sending ACK on message transmission skipable.
Owner: rtartiere@il4p.fr
Cc: rtartiere@il4p.fr
Status: New
I guess that for performance reasons, some advance users would prefer to skip
sending the non-mandatory ACK on data transmission.  They may also perform a
quicker check of the ACK returned by the chip after sending the command and
before receiving the response (not sure about this one).

It will probably be a ./configure option disabled by default that allows some "shortcuts" to perform NFC hacking.
2010-08-13 16:02:18 +00:00