Commit graph

1770 commits

Author SHA1 Message Date
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
Romain Tartiere
1e329529a7 Update nfc-poll example to enhance unsupported features detection. 2010-08-20 10:16:52 +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
040db45ae4 nfc-mfclassic: disable ISO14443-4 auto-switching in order to read devices that emulate Mifare Classic with ISO14443-4 compliance.(e.g. Nokia 6212 Classic) 2010-08-19 10:59:45 +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
eb90b92c12 Detect errors in examples. 2010-08-18 17:22:13 +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
0a09c8d8e7 Flag some problems in the examples. 2010-08-18 14:44:40 +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
6354e94657 mifare function improvement: it now failed when read command does not return a whole block (16 bytes). 2010-08-18 13:53:34 +00:00
Romuald Conty
4b123ab583 nfc-mfclassic now fails ealier when something goes wrong (this allow to prevent from false-success). 2010-08-18 13:20:40 +00:00
Romuald Conty
cf9af4ee49 nfc-list example now use nfc_initiator_list_passive_targets() function. 2010-08-18 13:13:14 +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
3dd2257b57 Add print_nfc_felica_info() and print_nfc_iso14443b_info() functions to nfc-utils (used by examples) 2010-08-18 12:50:40 +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
eeaad85151 Add SAK decoding for compliance with ISO/IEC. 2010-08-17 15:24:37 +00:00
Romuald Conty
6e84e757c7 List available drivers in ./configure --help 2010-08-17 14:40: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
Romuald Conty
41b1455f04 Clean up wrong comments in nfc-poll. 2010-08-16 16:27:50 +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
655fdb569a Fix nfc_initiator_mifare_cmd() in examples.
In r509, a direct call to pn53x_transceive() was changed into a call to nfc_initiator_transceive_dep_bytes() which is part of the public API. The command to send was updated accordingly, but the code that extracts the response have not.

Update issue 98
This should fix the problem: because the response was not the expected length, the actual card data was not copied to the buffer, so it was always the same 16 uninitialized bytes that where returned for any block.

PR:		Issue 98
Submitted by:	zamby.ing
Pointy hat to:  me
2010-08-13 19:53:13 +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
d7e0b926ac Rename the only test of the regression test suite to a more explicit name.
- While here, add assertions, enhance slightly the code and decrease the number of loop turns.
2010-08-13 18:34:30 +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
Romain Tartiere
f4bc39bf41 Mostly revert r521.
It was obviously an April joke: iErrorCode which was renamed iPICCError is
indeed a PCD Error, so I renamed it to iLastError since communications errors are
also to handle at the device driver level (read chip level), although I guess
that some errors would be common to distinct devices.
PICC error are irrelevant because they can either be transmission error
detection (in which case the libnfc should retry the transmission) or
application-level errors the libnfc cannot be aware of.
2010-08-13 09:02:20 +00:00
Romain Tartiere
0502401a29 Minor tweaks.
- Rename the nfc_device_t's struct iErrorCode member to iPICCError (We are
    likely to have both PICC and PCD errors fields to avoid unneeded complexity
    at some point);
  - Make the PN53x error descriptions static;
  - Enhance some comments here and there.
2010-08-13 08:31:16 +00:00
Romain Tartiere
b289784359 Merge r511-519 from trunk. 2010-08-11 16:59:09 +00:00
Romuald Conty
2029e0c66f Remove usb_reset() call: this function always failed. 2010-08-11 16:44:34 +00:00
Romuald Conty
d11e7a1320 Prevent from segfault when nfc_disconnect() on NULL pointer 2010-08-11 16:38:22 +00:00
Romain Tartiere
9cc31f6aad Add a regression test directory. 2010-08-11 16:36:35 +00:00
Romain Tartiere
caa594eba8 Remove deprecated code.
Reported by:	rconty@il4p.fr
2010-08-11 09:46:14 +00:00
Romain Tartiere
f237d44339 Take care of 16-blocks-long sectors of Mifare Classic 4K in the nfc-mfclassic example's blocks counting routine. 2010-08-11 09:26:22 +00:00
Romain Tartiere
ca6b768a67 Fix build on Microsoft Windows. 2010-08-10 21:45:30 +00:00
Romain Tartiere
4a5347e5ae Merge r512 from trunk. 2010-08-10 21:41:42 +00:00