Commit graph

957 commits

Author SHA1 Message Date
Romuald Conty
84dc268781 New feature: user can define a device by conf file. 2012-12-05 00:51:13 +01:00
Philippe Teuwen
cf6d843c18 Fix pseudo-logging API when no logging is used 2012-12-04 19:14:37 +01:00
Philippe Teuwen
2651cdce2e Remove last SVN cruft 2012-11-27 18:56:54 +01:00
Romuald Conty
9b3947b8ed Improves log feature:
* Add --disable-log
  * Add a log level filter, configurable using conf file (ie. /etc/nfc/libnfc.conf) or environment var LIBNFC_LOG_LEVEL
2012-11-26 21:02:03 +01:00
Romuald Conty
4722b7dd97 SVN_REVISION is not relevant anymore, use GIT_REVISION (git describe) instead. 2012-11-24 20:11:12 +01:00
Romuald Conty
7963fdfc3b Import code to load configuration from file.
WARNING: This commit do not contains a fully cleaned code:
 - Only nfc-list have been tested
 - Some -commented- code is not used ATM
 - Some printf-as-debug remain in this commit
... but that a bit usable so... happy hacking ;-)
2012-11-24 13:10:52 +01:00
Romuald Conty
3ee77eb79e Fix *transceive*() calls from examples and utils (bug introduced in previous commit) 2012-11-24 13:00:23 +01:00
Romuald Conty
6650105174 Add some functions parameters documentation. 2012-11-23 16:58:10 +01:00
Romuald Conty
c239873634 Add missing NFC_EMFCAUTHFAIL error string. 2012-11-23 16:55:45 +01:00
Romuald Conty
dd451da4a5 Change *transceive*() API to be closer to *transceive_bytes.
Warning: only prototypes have been changed, implementation does not take care about buffer size.

New issue
Summary: Implement buffer overflow protection on all *transceive*() functions
*transceive*() functions do have an argument for rx buffer but some of them dont use it to protect user from buffer overflow.
2012-11-23 16:54:38 +01:00
Philippe Teuwen
fda8d60ce0 Adapt *transmit_bytes_timed API to be closer to *transmit_bytes 2012-11-12 16:54:03 +01:00
Romuald Conty
9f90a04a84 nfc_initiator_transceive_bytes() returns NFC_EMFCAUTHFAIL when AUTH command failed on a Mifare Classic 2012-11-01 01:27:06 +01:00
Romuald Conty
3629219a3b Caller expect nfc_initiator_deselect_target() to be 0 on success. (Fixes Issue 209)
Thanks to Frank Morgner.
2012-10-30 23:22:22 +01:00
Romuald Conty
d6c97cb974 Fixes CMake build (Fixes Issue 211).
Thanks to Alex Lian
2012-10-30 22:29:13 +01:00
Romuald Conty
397222c33f Removes --enable-serial-autoprobe option at compile and replace this feature by LIBNFC_INTRUSIVE_SCAN environment variable at run time. 2012-10-21 14:11:38 +00:00
Romuald Conty
b5aa91fd62 Use a more appropriated term regarding device detection: from probe to scan
- Rename nfc-probe to nfc-scan-device
 - Rename internal drivers function prototypes: _probe to _scan
 - Revamp _scan function prototype: it now returns device found count
2012-10-21 14:11:17 +00:00
Romuald Conty
6bc9d64fbb Remove unused prototypes in drivers/*.h 2012-10-21 14:10:43 +00:00
Romuald Conty
9afa3c6598 Use copyright format recommended by GNU project.
http://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html
2012-10-21 14:09:16 +00:00
Romuald Conty
6fd29775b2 acr122_usb: Fix compilation and length offset (bug introduced in r1461) 2012-10-04 15:28:30 +00:00
Romuald Conty
b27f8634d6 acr122_usb: Fixes CCID reply decoding. 2012-10-04 09:35:47 +00:00
Romuald Conty
26dabba7ac Add Touchatag support for experimental acr122_usb driver; Thanks to Gregoire Sage for its contribution. (Fixes Issue 201) 2012-10-03 16:21:11 +00:00
Romuald Conty
88a57a50b3 Fix error code when no reply is not ISO14443B2CT compliant 2012-10-03 16:21:02 +00:00
Romuald Conty
91ce008d62 Removes a FIXME: not relevant anymore 2012-10-03 16:20:50 +00:00
Romuald Conty
1f0ec1b43a Remove unused macro. (Fixes Issue 192) 2012-09-27 07:36:02 +00:00
Romuald Conty
921d64dadc Support FTDI dongle under MacOS 2012-09-27 07:35:55 +00:00
Romuald Conty
310d7eba07 New str_nfc_target() function in API.
This allow to convert a nfc_target struct into allocated string.
2012-09-17 13:47:54 +00:00
Romuald Conty
de827ab583 nfc_device_get_information_about() now allocates returned string.
Note: must be freed by free().
2012-09-17 13:47:30 +00:00
Romuald Conty
2aba0f962a documentation: add missing group description 2012-09-17 13:47:18 +00:00
Romuald Conty
3cd6015c81 minor header cleanup 2012-09-17 13:47:11 +00:00
Ludovic Rousseau
4288cd3c33 Add example path so that doxygen can find the file 2012-09-14 20:08:01 +00:00
Ludovic Rousseau
e40d857ac5 Touchatag PC/SC reader name has changed
CCID driver version >= 1.4.6 has changed the order of the readers.
Unfortunately the Touchatag reader uses the exact same PID (USB Product
ID) as many other ACS readers:
#0x072F:0x90CC:ACS ACR122U (ACR122U.txt)
#0x072F:0x90CC:ACS ACR 38U-CCID (ACR38U-CCID.txt)
#0x072F:0x90CC:ACS ACR100 (ACS_ACR100.txt)
#0x072F:0x90CC:ACS ACR38 plugin (ACS_ACR38_plugin.txt)
#0x072F:0x90CC:ACS AET65 (ACS_AET65.txt)

And the name for the device 0x072F:0x90CC is now "ACS AET65"

Fixes bug #202
2012-07-31 08:45:14 +00:00
Philippe Teuwen
c87eab4958 Add support for OpenPCD2 2012-07-01 11:22:45 +00:00
Romuald Conty
9f38ae715d pn53x: allow more delay for Card Presence command (tested on PN533 and PN532 in various contexts). 2012-06-12 16:51:47 +00:00
Romuald Conty
ab312299d6 pn53x_reset_settings() now resets CRC, parity, easyframing and crypto1.
These settings are quite specifics and should be reset in other functions that call pn53x_reset_settings() too: i.e. nfc_initiator_init_secure_element()
2012-06-12 16:46:20 +00:00
Philippe Teuwen
4b5b45f14a Add "usb" keyword support to connstring to specify all usb drivers at once 2012-06-06 01:10:05 +00:00
Romuald Conty
b4ef1a3a5d New nfc_initiator_init_secure_element() function to set SAM as wired card (only relevant with a PN532 SAM-equipped) 2012-06-04 00:16:28 +00:00
Romuald Conty
6f10d6e321 pn53x: return all errors when NP_ACTIVATE_FIELD failed 2012-06-04 00:16:17 +00:00
Romuald Conty
f47af31fb7 Indent correctly previous commit (make style) 2012-06-03 21:05:26 +00:00
Romuald Conty
c973800164 nfc_device_target_is_present() checks if passed target if the current target before sending Card Presence command 2012-06-03 21:02:47 +00:00
Romuald Conty
2b81baa14f Add documentation related to previous commit (NFC_ETGRELEASED on MFC AUTH failure) 2012-06-03 21:02:38 +00:00
Romuald Conty
b7a74931f6 Returns a NFC_ETGRELEASED error when MIFARE Classic's authentication failed (instead of NFC_ECHIP): a MIFARE Classic is halted on AUTH command failure. 2012-06-03 21:02:31 +00:00
Romuald Conty
c7820c6a77 Log an error when user-Rx buffer is too sort to gain data 2012-06-03 21:02:23 +00:00
Romuald Conty
62c4ffd0b7 Raises up default timeout from 250 to 350ms
PN53x sometimes needs more time to compute usual command (ie. with Diagnose/Card Presence when card become unreachable)
2012-05-30 23:02:56 +00:00
Romuald Conty
13e1e054c2 Minor code fix. 2012-05-30 23:02:48 +00:00
Romuald Conty
d7e7979580 Listing passive targets now quit earlier if szTargets count is reached and in that case, leave with the latest tag selected.
That's quite useful when you need to directly use 1 target because in contrast of nfc_initiator_select_passive_target, you don't need to prepare initiator data by hands
2012-05-30 23:02:41 +00:00
Romuald Conty
b5c634cb07 drivers/pn53x_usb: use default timeout command instead of infinite 2012-05-30 23:02:34 +00:00
Philippe Teuwen
568317929d astyle --formatted --mode=c --indent=spaces=2 --indent-switches --indent-preprocessor --keep-one-line-blocks --max-instatement-indent=60 --brackets=linux --pad-oper --unpad-paren --pad-header --align-pointer=name 2012-05-29 15:55:35 +00:00
Philippe Teuwen
01303fab0d astyle --formatted --mode=c --indent=spaces=2 --indent-switches --indent-preprocessor --keep-one-line-blocks --max-instatement-indent=60 --brackets=linux --pad-oper --unpad-paren --pad-header 2012-05-29 15:54:36 +00:00
Philippe Teuwen
562205cc14 astyle --formatted --mode=c --indent=spaces=2 --indent-switches --indent-preprocessor --keep-one-line-blocks --max-instatement-indent=60 --brackets=linux --pad-oper 2012-05-29 15:54:00 +00:00
Philippe Teuwen
67522bae65 astyle --formatted --mode=c --indent=spaces=2 --indent-switches --indent-preprocessor --keep-one-line-blocks --max-instatement-indent=60 --brackets=linux 2012-05-29 15:53:43 +00:00
Philippe Teuwen
a2cd236441 astyle --formatted --mode=c --indent=spaces=2 --indent-switches --indent-preprocessor --keep-one-line-blocks --max-instatement-indent=60 2012-05-29 15:52:51 +00:00
Philippe Teuwen
26569c2202 Indent manually some comments to prepare astyle 2012-05-29 15:52:29 +00:00
Romuald Conty
26865bbc19 Remove extra whitespaces/tabs before EOL.
find . -name '*.[ch]' | xargs perl -pi -e 's/\t+$//; s/ +$//'

Thanks to Ludovic.
2012-05-29 00:33:22 +00:00
Romuald Conty
167238c60d Fix uninitialized variable szTargetsData 2012-05-27 23:25:52 +00:00
Romuald Conty
8f08431ddf New function nfc_initiator_target_is_present() to test is a previously selected target is in the field. 2012-05-27 22:34:21 +00:00
Romuald Conty
2c9275adde nfc_initiator_transceive_bytes() now take a constant size for Rx buffer to have a cleaner API: no more in/out parameters 2012-05-27 21:06:22 +00:00
Philippe Teuwen
dd12a4dd87 drivers/acr122_pcsc: allow LIBNFC_DEFAULT_DEVICE=acr122_pcsc:N where N is the Nth device accepted by the driver 2012-05-22 23:49:32 +00:00
Philippe Teuwen
47e90ee510 drivers/acr122_pcsc: allow LIBNFC_DEFAULT_DEVICE=acr122_pcsc 2012-05-22 17:25:48 +00:00
Philippe Teuwen
ff87cf62b1 Fix segfault in pn53x_initiator_transceive_bytes when pszRx in NULL
Cause was "return *pszRx"
Segfault occured when listing a typeB'
2012-05-18 21:54:55 +00:00
Ludovic Rousseau
48016fa297 warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') 2012-05-18 07:38:42 +00:00
Romuald Conty
e4802de965 Add new public functions to grab information in string format:
- New nfc_device_get_information_about()
 - Moved nfc-utils function str_nfc_baud_rate()
 - New str_nfc_modulation_type()
 - Add new device_get_information_about callback to nfc_driver struct
 - Export new symbols
 - Changed internal pn53x firmware text handling: we now store firmware text for further operations
 - print_nfc_target() now uses str_nfc_* functions
 - nfc-probe util now have a verbose which display information on detected devices (Fix verbose set but not used warning ;-) )
2012-05-17 00:48:47 +00:00
Romuald Conty
6710ca943e Fix ACR122S device detection when no ACR122S device available (endless UART receive) 2012-05-17 00:38:54 +00:00
Ludovic Rousseau
d98b5d00ab Fix the fix in revision r1322
clang warning:
arygon.c:115:118: warning: data argument not used by format string
      [-Wformat-extra-args]
  ..."%s", "Trying to find ARYGON device on serial port: %s at %d bauds.", acPort,...
     ~~~~                                                                  ^
1 warning generated.
2012-05-16 19:13:16 +00:00
Romuald Conty
45ef3b43c4 Fix unused result warnings and add a new NFC_ESOFT error. 2012-05-16 18:24:16 +00:00
Romuald Conty
bfcdb1bd4c Fix more warnings while using -Wswitch-enum and -Wshadow on internal libnfc files 2012-05-16 18:08:42 +00:00
Romuald Conty
05acb85372 Use explicit case instead of default in switch()
- Fix warnings while using -Wswitch-enum
 - Fix two minor bugs due to a bad case handle
2012-05-16 17:51:34 +00:00
Romuald Conty
10f24d97aa Any successfull PowerDown command have to change local power mode state 2012-05-16 16:48:06 +00:00
Ludovic Rousseau
782b72e29f Correctly handle PCSC header files on Mac OS X
Fixes Issue #195
2012-05-16 13:34:21 +00:00
Ludovic Rousseau
3737481262 Correctly use the log_put() format
Fix compiler warning:
warning: format not a string literal and no format arguments
2012-05-16 13:17:52 +00:00
Ludovic Rousseau
eb1e6d0cb4 Check log_put() printf-like format
Thanks to Romain Tartière for the patch
http://groups.google.com/group/libnfc-devel/browse_thread/thread/da352d67e6965851
2012-05-16 13:15:34 +00:00
Romuald Conty
7b82a98b72 Improve acr122_usb frame building and add links to documentations 2012-05-15 07:27:28 +00:00
Romuald Conty
a56e5f9cd7 Fix nfc-emulation, now works with utils/nfc-emulate-forum-tag4 and Nexus S 2012-05-14 21:20:26 +00:00
Romuald Conty
9383fa66bf Fix emulation based on nfc-emulation.c 2012-05-14 20:47:41 +00:00
Romuald Conty
769fc63bb0 Fix acr122_pcsc driver name. 2012-05-14 20:40:19 +00:00
Romain Tartiere
e9b2f5729c Fix a bunch of warnings. 2012-05-14 13:47:31 +00:00
Ludovic Rousseau
dfcabf71f0 Fix compiler warning
uart_posix.c:55:1: warning: initialization discards 'const' qualifier from pointer target type [enabled by default]
2012-05-14 09:23:18 +00:00
Ludovic Rousseau
59d47bc7da Add MIN/MAX declarations in nfc-internal.h and nfc-utils.h
Remove the now useless #include <sys/param.h>
2012-05-13 19:15:44 +00:00
Ludovic Rousseau
a14ec0cbaa Fix compiler warnings:
In file included from nfc-internal.c:26:
nfc-internal.h:111:5: warning: "_BYTE_ORDER" is not defined
nfc-internal.h:111:20: warning: "_LITTLE_ENDIAN" is not defined
2012-05-13 15:11:28 +00:00
Ludovic Rousseau
b9e5e96e49 Use "const char *" instead of "char *" for the strings passed to
log_put()

It does not solve any bug but will allow to detect some by the compiler
2012-05-13 14:58:44 +00:00
Ludovic Rousseau
3e678822ce Fix compiler warnings
pn532_uart.c:151: warning: no previous prototype for ‘pn532_connstring_decode’
pn532_uart.c:491: warning: no previous prototype for ‘pn532_uart_abort_command’
2012-05-13 14:51:18 +00:00
Ludovic Rousseau
56f3baf7a9 Fix compiler warnings
pn53x_usb.c:94: warning: no previous prototype for ‘pn53x_usb_bulk_read’
pn53x_usb.c:107: warning: no previous prototype for ‘pn53x_usb_bulk_write’
pn53x_usb.c:139: warning: no previous prototype for ‘pn53x_usb_get_device_model’
pn53x_usb.c:154: warning: no previous prototype for ‘pn53x_usb_get_end_points’
pn53x_usb.c:259: warning: no previous prototype for ‘pn53x_usb_connstring_decode’
pn53x_usb.c:713: warning: no previous prototype for ‘pn53x_usb_set_property_bool’
pn53x_usb.c:742: warning: no previous prototype for ‘pn53x_usb_abort_command’
2012-05-13 14:50:18 +00:00
Ludovic Rousseau
324776353a Fix compiler warnings
arygon.c:174: warning: no previous prototype for ‘arygon_connstring_decode’
arygon.c:360: warning: no previous prototype for ‘arygon_abort’
arygon.c:545: warning: no previous prototype for ‘arygon_abort_command’
2012-05-13 14:48:08 +00:00
Ludovic Rousseau
55322ad802 Fix compiler warnings
acr122s.c:422: warning: no previous prototype for ‘acr122s_connstring_decode’
acr122s.c:703: warning: no previous prototype for ‘acr122s_abort_command’
2012-05-13 14:47:10 +00:00
Ludovic Rousseau
054dc9b7ca Declare internal functions as static
Fixes compiler warnings:
acr122_usb.c:90: warning: no previous prototype for ‘acr122_usb_bulk_read’
acr122_usb.c:107: warning: no previous prototype for ‘acr122_usb_bulk_write’
acr122_usb.c:140: warning: no previous prototype for ‘acr122_usb_get_device_model’
acr122_usb.c:155: warning: no previous prototype for ‘acr122_usb_get_end_points’
acr122_usb.c:252: warning: no previous prototype for ‘acr122_usb_connstring_decode’
acr122_usb.c:306: warning: no previous prototype for ‘acr122_usb_open’
acr122_usb.c:428: warning: no previous prototype for ‘acr122_usb_close’
acr122_usb.c:497: warning: no previous prototype for ‘acr122_build_frame’
acr122_usb.c:660: warning: no previous prototype for ‘acr122_usb_abort_command’
2012-05-13 14:23:44 +00:00
Ludovic Rousseau
a2b022609f Fix some spelling mistakes
Closes Issue #196
2012-05-13 13:10:15 +00:00
Ludovic Rousseau
55ef86da33 Add a missing #include and fix a compiler warning
iso14443-subr.c:99: warning: no previous prototype for ‘iso14443_cascade_uid’
2012-05-13 13:02:37 +00:00
Ludovic Rousseau
2677dfb161 Add a missing #include and fix a compiler warning
nfc-internal.c:29: warning: no previous prototype for ‘prepare_initiator_data’
2012-05-13 13:01:06 +00:00
Ludovic Rousseau
e80d545b38 Fix compiler warning
mirror-subr.c:64: warning: no previous prototype for ‘mirror_bytes’
2012-05-13 12:58:44 +00:00
Ludovic Rousseau
5c82158a5d Declare internal functions as static
Fixes compiler warnings:
pn53x.c:565: warning: no previous prototype for ‘pn53x_ReadRegister’
pn53x.c:591: warning: no previous prototype for ‘pn53x_WriteRegister’
pn53x.c:748: warning: no previous prototype for ‘pn53x_int_to_timeout’
pn53x.c:1003: warning: no previous prototype for ‘pn53x_initiator_select_passive_target_ext’
pn53x.c:1334: warning: no previous prototype for ‘__pn53x_init_timer’
pn53x.c:1355: warning: no previous prototype for ‘__pn53x_get_timer’
2012-05-13 12:29:39 +00:00
Ludovic Rousseau
59b8ffcdb1 Declare internal functions as static
Fixes compiler warnings:
acr122_pcsc.c:106: warning: no previous prototype for ‘acr122_pcsc_get_scardcontext’
acr122_pcsc.c:118: warning: no previous prototype for ‘acr122_pcsc_free_scardcontext’
acr122_pcsc.c:198: warning: no previous prototype for ‘acr122_pcsc_connstring_decode’
2012-05-13 12:23:42 +00:00
Romuald Conty
851d035588 drivers/pn532_uart: flush uart input on error to resync uart port 2012-05-10 19:37:55 +00:00
Romuald Conty
4990f57df8 debug messages are sent in stderr stream (Thanks to Spock) 2012-05-02 01:46:44 +00:00
Romuald Conty
8549bc1e4c share some traces with USB devices (Thank to yobibe) 2012-05-01 23:17:24 +00:00
Romuald Conty
82b2cfa883 Smart merge of acr122_usb branch: add acr122_usb driver without removing acr122_pcsc support. 2012-05-01 23:09:57 +00:00
Romain Tartiere
2f9bc90a95 Don't return pointer on freed memory on error.
PR:		http://code.google.com/p/nfc-tools/issues/detail?id=87
Submitted by:	jkmalinen@gmail.com
2012-03-05 07:28:45 +00:00
Romain Tartiere
68a1d5c450 Fix another warning for files not compiled in the default configuration. 2012-03-01 14:01:08 +00:00
Romuald Conty
e7f85811a1 fix *get_supported_modulation and *get_supported_baud_rate protos in nfc_driver and public ones. 2012-03-01 13:52:51 +00:00
Romuald Conty
f98437c377 fix pn53x_get_supported_modulation() and pn53x_get_supported_baud_rate() functions 2012-03-01 13:43:04 +00:00
Romain Tartiere
05789e5a68 Fix a couple warnings. 2012-03-01 13:33:13 +00:00
Romuald Conty
03d185b536 Prepare libnfc 1.6.0-rc1 2012-03-01 11:37:16 +00:00
Romuald Conty
4878361d27 drivers/acr122s: fix ACR122S initialization (Fixes Issue 185) 2012-02-27 14:10:47 +00:00
Audrey Diacre
4cc3c72b31 add nfc_device_get_supported_modulation() and nfc_device_get_supported_baud_rate() documentation. 2012-02-20 08:36:15 +00:00
Audrey Diacre
5a5bdf1d66 add nfc_device_get_supported_modulation() and nfc_device_get_supported_baud_rate() functions. 2012-02-17 12:09:56 +00:00
Audrey Diacre
e9bd9e4b67 documentation: exclude some files. 2012-01-31 15:35:13 +00:00
Audrey Diacre
983d4932f3 documentation: add utils and examples and hide internal files. 2012-01-31 14:28:45 +00:00
Audrey Diacre
908fa416bf documentation 2012-01-31 10:02:38 +00:00
Audrey Diacre
3d393e58a9 add some Doxygen documentation. 2012-01-31 09:49:43 +00:00
Audrey Diacre
17c4a09c8f add modules in documentation. 2012-01-30 11:00:02 +00:00
Audrey Diacre
0f20377541 add some API documentations. 2012-01-30 09:43:58 +00:00
Romuald Conty
70484509af libnfc-1.5-acr122-usb> support for ACR122U only (not Touchatag) 2012-01-27 14:38:14 +00:00
Romuald Conty
24e298626a libnfc-1.5-acr122-usb> fix minor bugs and apply pn53x_usb's patch to be used under FreeBSD too 2012-01-26 21:36:08 +00:00
Romuald Conty
e49eb6c660 libnfc-1.5-acr122-usb> import partial work on "ACR122 without PCSC" driver 2012-01-26 15:23:11 +00:00
Audrey Diacre
26245add73 Merge libnfc-1.5-new-api branch to trunk (r1168:1303). 2012-01-25 09:56:05 +00:00
Audrey Diacre
1f3b995c2a add iso14443a_crc as symbol to expose for libfreefare. 2012-01-24 08:42:47 +00:00
Audrey Diacre
5a475cf074 add some whitespaces 2012-01-20 09:17:38 +00:00
Audrey Diacre
838faa8d7e define symbols to expose (Fixes Issue 183). 2012-01-19 11:50:15 +00:00
Romuald Conty
a3a0002f8d fix miss-returned error code (ETGREL -> NFC_ETGRELEASED). 2012-01-18 18:08:39 +00:00
Audrey Diacre
4c011279ff add context to nfc_init(), nfc_exit(), nfc_open() and nfc_list_devices() functions. 2012-01-18 16:22:06 +00:00
Audrey Diacre
86c8ce536b acr122.c: apply changes done in r1296. 2012-01-18 14:44:57 +00:00
Romain Tartiere
3aa31abe18 Add missing header. 2012-01-18 13:21:06 +00:00
Romuald Conty
b366b8c027 add nfc_device_get_connstring() function and nfc-probe example to show devices connection strings 2012-01-18 13:17:01 +00:00
Romain Tartiere
39216f9d7c Do not rely on int to locate USB bus and devices: FreeBSD's libusb use path of
devices in /dev for bus (/dev/usb) and devices (e.g. /dev/ugen0.3) so directly
Compare strings.
2012-01-18 13:13:36 +00:00
Audrey Diacre
207199dc34 examples, test and utils use now nfc_exit() function. 2012-01-18 11:36:18 +00:00
Audrey Diacre
1d55b6f8c6 examples, test and utils use now nfc_init() function. 2012-01-18 11:09:01 +00:00
Audrey Diacre
d1b0e93e8e add initialization and deinitialization. 2012-01-18 09:53:45 +00:00
Romuald Conty
38bdfe3281 pn53x_usb: minor code clean up. 2012-01-18 09:39:33 +00:00
Audrey Diacre
324af418db rename nfc_connect() function to nfc_open(). 2012-01-17 15:21:56 +00:00
Audrey Diacre
9eb37b3eee rename nfc_disconnect() function to nfc_close(). 2012-01-17 14:52:39 +00:00
Audrey Diacre
9d3ca39a44 remove _t suffix from nfc_driver_t type. 2012-01-17 14:17:01 +00:00
Romain Tartiere
ba58138aa9 PRIu32 is defined in inttypes.h. 2012-01-17 13:51:58 +00:00
Audrey Diacre
bd0de9bd61 test: rename test_dep to test_device_modes_as_dep and improve it. 2012-01-13 09:58:47 +00:00
Audrey Diacre
0e2c60d0fa fix some last_error with result of previous function. 2012-01-12 13:52:48 +00:00
Audrey Diacre
f9a464e256 nfc_perror() function displays now LIBNFC_ERROR. 2012-01-11 08:47:14 +00:00
Romuald Conty
e86d08218b add nfc_initiator_poll_dep_target() 2012-01-10 14:17:18 +00:00
Romuald Conty
efa86f0e35 fix various minor mistakes, ajust timeouts 2012-01-10 14:10:44 +00:00
Audrey Diacre
1ec504e163 nfc_list_devices() function returns now the number of devices found. 2012-01-10 10:35:36 +00:00
Audrey Diacre
00818e048c rx buffer size parameter of nfc_target_init() function is now a const size_t. 2012-01-09 11:26:57 +00:00
Audrey Diacre
5e796e0a26 rx buffer size parameter of pn53x_TgInitAsTarget() function is now a const size_t. 2012-01-09 10:47:35 +00:00
Audrey Diacre
c10b473361 rx buffer size parameter of pn53x_transceive() function is now a const size_t. 2012-01-09 10:24:00 +00:00
Romuald Conty
7df3bb5aeb various minor fixes/enhancements 2012-01-06 13:08:16 +00:00
Audrey Diacre
e15f2eedbb rename lastCommand by last_command. 2012-01-06 13:07:37 +00:00
Romuald Conty
48e92149e4 drop log4c support 2012-01-06 13:05:10 +00:00
Audrey Diacre
b41edfb0b4 rename ui8LastCommand by lastCommand. 2012-01-06 09:20:55 +00:00
Romuald Conty
22bea8d99b nfc_target_receive_*() need to know rx buffer size 2012-01-05 21:35:02 +00:00
Audrey Diacre
601105ef79 fix bad cast done in last revision. 2012-01-05 17:03:38 +00:00
Audrey Diacre
642f9a38f7 nfc_target_receive_bytes() function does not now use pszRx as parameter because this function returns it. 2012-01-05 16:33:55 +00:00
Audrey Diacre
7e7ee3299e nfc_target_receive_bits() function does not now use pszRxBits as parameter because this function returns it. 2012-01-05 15:50:07 +00:00
Audrey Diacre
239fd750c4 add timeout on nfc_target_init() and this function returns now received bytes count on success. 2012-01-05 15:10:11 +00:00
Audrey Diacre
c80ebdca25 nfc_abort_command() function returns now 0 on success and libnfc error code on failure and fix some warnings. 2012-01-05 14:49:02 +00:00
Audrey Diacre
8b07a5f4c7 libnfc/drivers: pn53x_usb_init() function returns now 0 on success and libnfc error code on failure. 2012-01-05 14:05:43 +00:00
Audrey Diacre
5d4f22c548 libnfc/drivers: pn532_uart_ack() and arygon_reset_tama() functions return now libnfc error code on failure. 2012-01-05 13:56:12 +00:00
Audrey Diacre
c30e9eed36 send/receive callbacks from internal chip io return now libnfc error code on failure. 2012-01-05 13:24:41 +00:00
Audrey Diacre
331234713d nfc_idle() function returns now 0 on success and libnfc error code on failure. 2012-01-05 08:57:16 +00:00
Audrey Diacre
6ad07c3efb pn53x_writeback_register() function returns now 0 on success and libnfc error code on failure. 2012-01-05 08:42:22 +00:00
Romuald Conty
93b34fa70b enhance new error handling
- add accessor to last error occured
- add new public error NFC_ETGRELEASED (Target Released)
2012-01-05 01:39:10 +00:00
Romuald Conty
af22d34d57 fix some return codes and error checkings 2012-01-04 20:50:05 +00:00
Romuald Conty
254053b940 fix few minor bugs:
- timeout values handling in pn53x_transceive()
- check error code after filling it in pn53x_transceive()
- fix pn53x_check_communication() return code
- lower timeout default values
- fix arygon_abort() return code
2012-01-04 20:02:51 +00:00
Audrey Diacre
52c72383f1 pn53x_build_frame() function returns now 0 on success and libnfc error code on failure. 2012-01-04 16:44:40 +00:00
Audrey Diacre
e87241184a pn53x_check_ack_frame() and pn53x_check_error_frame() functions return now 0 on success and libnfc error code on failure. 2012-01-04 16:32:16 +00:00
Audrey Diacre
4b373263e4 pn53x_idle() returns now 0 on success and libnfc error code on failure. 2012-01-04 16:26:57 +00:00
Audrey Diacre
7e1c776bc1 pn53x_check_communication() returns now 0 on success and libnfc error code on failure. 2012-01-04 16:19:24 +00:00
Audrey Diacre
240cdcddab pn53x_decode_target_data() returns now 0 on success and libnfc error code on failure. 2012-01-04 16:11:30 +00:00
Audrey Diacre
d4c5476652 pn53x_get_firmware_version() returns now 0 on success and libnfc error code on failure.. 2012-01-04 16:07:57 +00:00
Audrey Diacre
c1faa48f54 fix nfc_target_init(). 2012-01-04 15:59:34 +00:00
Audrey Diacre
a41b2b0da8 nfc_initiator_transceive_bytes_timed() function does not now use pszRx as parameter because this function returns it. 2012-01-04 15:53:41 +00:00
Audrey Diacre
b699743973 nfc_initiator_transceive_bits_timed() function does not now use pszRxBits as parameter because this function returns it. 2012-01-04 15:43:08 +00:00
Audrey Diacre
6e7092b160 nfc_initiator_transceive_bits() function does not now use pszRxBits as parameter because this function returns it. 2012-01-04 15:30:42 +00:00
Audrey Diacre
61c3e5b814 pn53x_wrap_frame() and pn53x_unwrap_frame() functions return now frame length in bits on success and libnfc error code on failure. 2012-01-04 14:59:16 +00:00
Audrey Diacre
0de1136037 nfc_target_receive_bits() function returns now received bits count on success and libnfc error code on failure. 2012-01-04 13:33:53 +00:00
Audrey Diacre
951dde8143 nfc_target_send_bits() function returns now sent bits count on success and libnfc error code on failure. 2012-01-04 13:27:15 +00:00
Audrey Diacre
1c49329ffa nfc_initiator_transceive_bits_timed() function returns now received bits count on success and libnfc error code on failure. 2012-01-04 13:18:11 +00:00
Audrey Diacre
d02da0db64 nfc_initiator_transceive_bytes_timed() function returns now received bytes count on success and libnfc error code on failure. 2012-01-04 11:54:55 +00:00
Audrey Diacre
61074f3497 nfc_initiator_transceive_bits() function returns now received bits count on success and libnfc error code on failure. 2012-01-04 11:46:07 +00:00
Audrey Diacre
9c1371dcca nfc_target_send_bytes() function returns now sent bytes count on success and libnfc error code on failure. 2011-12-22 15:59:08 +00:00
Audrey Diacre
ac6f652368 nfc_target_receive_bytes() function returns now received bytes count on success and libnfc error code on failure. 2011-12-22 15:39:51 +00:00
Audrey Diacre
658fceb7fc nfc_initiator_select_dep_target() function returns now selected D.E.P targets count on success. 2011-12-22 13:28:41 +00:00
Audrey Diacre
b864215d63 pn53x_initiator_poll_target() function returns now polled targets count on success. 2011-12-22 11:16:27 +00:00
Audrey Diacre
340e80d7a8 pn53x_initiator_select_passive_target_ext() function now does not return error when there is no target. 2011-12-21 11:52:02 +00:00
Audrey Diacre
f93bc59504 nfc_initiator_select_passive_target() function returns now the selected passive targets count on success. 2011-12-21 11:33:21 +00:00
Audrey Diacre
ff066e394d nfc_initiator_deselect__target() function returns now libnf error code. 2011-12-21 09:53:16 +00:00
Audrey Diacre
c41d7de8ca nfc_initiator_select_dep_target() function returns nox libnf error code and fix some uses of nfc_initiator_transceive_bytes() function. 2011-12-21 09:15:44 +00:00
Audrey Diacre
0f5cc5683d nfc_initiator_poll_target() function returns now libnfc error code. 2011-12-20 15:46:35 +00:00
Audrey Diacre
42276ccd14 the following functions now return libnfc error code:
_ pn53x_set_tx_bits
_ pn53x_read_register
_ pn53x_InAutoPoll
_ pn53x_TgInitAsTarget
_pn53x_init
2011-12-20 14:41:17 +00:00
Audrey Diacre
c5f05f0592 pn53x_set_parameters() function returns now libnfc error code. 2011-12-20 13:37:54 +00:00
Audrey Diacre
9c5ec3c4e1 the following functions now return libnfc error code:
_pn53x_write_register()
_pn53x_WriteRegister()
_pn53x_transceive()
_pn53x_SAMConfiguration()
_pn53x_PowerDown()
 _pn53x_InListPassiveTarget()
_pn53x_InDeselect()
_pn53x_InRelease()
_pn53x_RFConfiguration__*
2011-12-20 11:25:33 +00:00
Audrey Diacre
103485518c nfc_initiator_select_passive_target() function returns now libnfc error code. 2011-12-19 16:27:50 +00:00
Audrey Diacre
ba2a7cfe2e nfc_target_init() function returns now 0 on succes and libnfc error code on failure. 2011-12-19 15:35:37 +00:00
Audrey Diacre
145cc4b2ad nfc_initiator_transceive_bytesfunction now returns libnfc error code on failure and received bytes count on success. 2011-12-19 14:37:22 +00:00
Audrey Diacre
31f67be83e add some forgotten NFC_SUCCESS returns in pn53x_set_property_bool function and fix some return types in test/ 2011-12-19 14:05:02 +00:00
Romuald Conty
bf7c36d9bb less structs and defines publicly exposed
- 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.
2011-12-19 00:23:21 +00:00
Romuald Conty
9bdc20353c nfc_device struct is not exposed as public API anymore (partial commit)
- split libnfc's errors and chip's errors
 - fix nfc_property enum
2011-12-15 16:02:38 +00:00
Audrey Diacre
98355d36a7 nfc_initiator_init returns now error code and nfc_initiator_list_passive_targets returns now the number of targets found or error code. 2011-12-15 11:46:14 +00:00
Audrey Diacre
a615d969fd nfc_properties replace now nfc_options and nfc_configure is replaced by nfc_device_set_property_bool which returns error code. 2011-12-14 16:01:00 +00:00
Romuald Conty
c181cb35ec set correctly default timeout values 2011-12-14 15:03:29 +00:00
Romuald Conty
26b9c28f48 new properties to tune timeouts:
- add nfc_properties (will replace nfc_options)
 - introduce some error codes
 - rework functions to use the new timeout_command value
2011-12-14 13:27:11 +00:00
Romuald Conty
90c05c7d13 Add a printf-based logging when log4c is not available (I experiemented some bugs using log4c) 2011-12-07 14:59:40 +00:00
Romuald Conty
c286eec920 DEP enhancements:
- 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
2011-12-06 10:05:35 +00:00
Romuald Conty
e76e531d2d pn53x_usb: clean timeout handling. 2011-11-25 16:13:40 +00:00
Audrey Diacre
297a8566a0 Oups, too quick replacement commited in r1183 2011-11-25 15:47:24 +00:00
Audrey Diacre
52bc5853d8 Remove whitespace after star symbol for pointers 2011-11-25 15:21:10 +00:00
Audrey Diacre
5a9a778879 Remove whitespace after star symbol for pointers 2011-11-25 13:32:29 +00:00
Audrey Diacre
90b5961b40 Rename fixed_timeout to timeout_tv and cleam useless allocation. 2011-11-25 13:30:13 +00:00
Audrey Diacre
5c7454a2f7 Timeout is now integer. 2011-11-25 11:37:30 +00:00
Audrey Diacre
784a2f86a2 Change byte_t type to uint8_t (Fixes Issue 147) 2011-11-24 10:54:42 +00:00
Audrey Diacre
322eec6fb1 Define macro to cast to serial_port_unix. 2011-11-24 10:20:36 +00:00
Audrey Diacre
c718fafee7 Massive code clean up: (Fixes Issue 161)
- Remove typedef from internal structs
- Remove _t suffix from types
- Fix tests using connstrings
2011-11-23 15:55:40 +00:00
Anugrah Redja Kusuma
136cfdf48d Implement driver for ACR122S device 2011-11-23 03:05:12 +00:00
Romuald Conty
63f168440b Provide a (poor) logging capability when log4c is not available but DEBUG is enabled. 2011-10-27 15:14:18 +00:00
Romuald Conty
b4ebb4510d Removes libusb types workaround (r200) as it seems to not be needed anymore but may disturb compiler. 2011-10-18 11:03:54 +00:00
Romuald Conty
55daa29a7c Allow to connect to a device using a connection string:
- 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]
2011-10-17 13:03:56 +00:00
Romuald Conty
dc842a844c examples/nfc-read-forum-tag3: add new example to read a NFC Forum Tag Type 3 2011-10-10 00:40:34 +00:00
Romuald Conty
b24191a9b9 Fix compilation using cmake 2011-10-04 21:43:05 +00:00
Romuald Conty
8fa83ac70f Fix infinite software polling 2011-10-04 21:42:06 +00:00
Romuald Conty
dccfd65c80 Add software polling for non-PN532 equipped device (Fixes Issue 136) 2011-10-03 11:19:08 +00:00
Romuald Conty
b1a30e3e3b drivers/pn53x_usb: fix timeout computing 2011-10-03 08:59:21 +00:00
Romuald Conty
b2666dea15 windows port improved:
- PCSC headers/libs are not a requierement sif you dont select ACR122 driver
 - uart_win32 implementation now handles timeouts
2011-10-01 14:50:53 +00:00
Romuald Conty
5ecf382dfc windows: Oups... timeout is a pointer... 2011-10-01 09:59:27 +00:00
Romuald Conty
afd015f1b7 Attempt to provide a Windows implementation of timeouts handling in UART 2011-09-30 14:02:51 +00:00
Romain Tartiere
311d12feef Make a copy of the provided timeout before calling select(2). 2011-09-29 15:01:48 +00:00
Romuald Conty
8f7834c625 drivers/arygon,pn532_uart,pn53x_usb: all PN53x commands are now cancelable 2011-09-29 14:53:52 +00:00
Romuald Conty
49ab6a7f31 raise up loggin level when PCSC context is not found (e.g. under POSIX system, pcscd is not running) 2011-09-29 11:59:34 +00:00
Romuald Conty
590e3910de Document new timeout parameter 2011-09-29 09:49:08 +00:00
Romuald Conty
87c13825af drivers/pn53x_usb: rework timeout usage 2011-09-22 16:21:22 +00:00
Romain Tartiere
481fb4943f - Add timeout capablities to nfc_initiator_transceive_bytes(), nfc_target_send_bytes() and nfc_target_receive_bytes();
- Bump version to 1.5.1.
2011-09-22 13:03:47 +00:00
Romuald Conty
f6b582cf2b windows: Remove DGB/WARN/ERROR obsolete macros usage. 2011-09-21 06:54:53 +00:00
Romuald Conty
e4524bc810 chips/pn53x: add RFConfiguration wrappers 2011-09-20 22:43:45 +00:00
Romuald Conty
b33fb81234 logging: fix LOG_CATEGORY and show the last command status. 2011-09-20 18:22:47 +00:00
Romuald Conty
cf99796a77 Removes semaphore.h depends. 2011-09-20 16:23:48 +00:00
Romuald Conty
ca8bd1df91 logging: remove semaphore usage since libnfc is not threaded and log4c does handle threaded cases itself. (Should ease Windows compiling) 2011-09-20 14:07:40 +00:00
Romain Tartiere
f6fc637d77 Soooo fragile :-)))) 2011-09-12 17:05:00 +00:00
Romuald Conty
e8eec583ed Enhance logging system:
* Removes internal DBG/WARN/ERR macros (but keep them in examples);
 * Removes almost all DEBUG define references;
 * Uses the flexible log4c library to log all messages.
2011-09-12 14:50:01 +00:00
Romuald Conty
fa7084fa77 removes the libusb-win32 workaround: libusb-win32 project released a new stable version which fixes the infinite timeout issue. (Thanks to Ergeerts Glenn) 2011-08-08 10:02:47 +00:00
Romuald Conty
676477e20c rework the way to determine which command is needed to send/receive a frame as target. 2011-06-30 17:05:59 +00:00
Romain Tartiere
84918fd075 Fix invalid memory access when a new driver is probing for hardware and the number of requested devices was already reached.
The probing functions assume that at least one device should be found and
passed to the caller, and only after finding such a device they will check that
they should eventually stop looking for more devices.  While we could make each
probing function capable of handling the special-case of finding 0 devices, it
is much more consistent to perform the check from the calling function.
2011-06-30 13:35:40 +00:00
Romuald Conty
fd19773c21 drivers/pn53x_usb: Make valgrind more happy :) 2011-06-28 14:05:40 +00:00
Romuald Conty
eec2794d2d drivers/pn532_uart,arygon: Make valgrind happy with UART-based drivers 2011-06-28 13:16:44 +00:00
Romuald Conty
e6051ceca4 chip/pn53x: clean up SAMConfiguration usage. 2011-06-27 17:12:25 +00:00
Romuald Conty
eb70f3842e Error handling improvement:
- 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
2011-06-27 16:31:10 +00:00
Romuald Conty
9c314d5652 Shrink InJumpForDEP frame size according to user manual. 2011-06-27 12:33:55 +00:00
Romuald Conty
904f41e0f7 drivers/pn53x*: use shared pn53x_ack_frame[] and pn53x_nack_frame[] instead of local declaration. 2011-06-27 10:33:55 +00:00
Romuald Conty
699e9008d1 Move ISO14443-3 UID cascading in a dedicated function. 2011-06-27 10:19:00 +00:00
Romuald Conty
0b42cbfb8f examples/nfc-emulate-forum-tag4: this example now fails with ENOTSUPP when used with a non-PN532 chip. 2011-06-27 09:14:19 +00:00
Romuald Conty
c40319c7b4 Windows: implement automatic uart port detection and input flush (Thanks to Edwin Evans) 2011-06-16 11:50:39 +00:00
Romain Tartiere
a8394caed5 Fix comparison between signed and unsigned. 2011-06-13 21:46:01 +00:00
Romuald Conty
29856a67a0 Rename USB_TIMEOUT to USB_INFINITE_TIMEOUT and use it each time bulk read need to be infinite. (Thanks to Guty) 2011-06-10 10:04:31 +00:00
Romuald Conty
850b3c2375 Improve USB support:
- All USB errors are now reported in text format;
 - USB drivers now relies on libusb-win32 with version >= 1.2.4.x (1.2.4.6 recommended) (Many thanks to Glenn)
2011-06-09 14:00:45 +00:00
Philippe Teuwen
7c88fc27b5 RC-S360, work-in-progress 2011-06-09 08:59:06 +00:00
Philippe Teuwen
082edbf598 More attempt to support Sony RC-S360 reader
Adapt InDeselect & InRelease to RC-S360
nfc-list now supports discovery of several typeA tags properly

Current status of RC-S360 support is:
    - 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-S360:
    - select_passive_target for B'& 3B
2011-06-08 00:09:57 +00:00
Philippe Teuwen
80a5ad1fd6 More attempt to support Sony S360 reader
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
2011-06-07 20:36:20 +00:00
Philippe Teuwen
91c46050c0 First attempt to support Sony S330 reader
Tested:
- nfc-list
- nfc-anticol
- nfc-mfultralight
- nfc-mfclassic

Commands momentarily disabled:
- SetParameters
- InDeselect
- InRelease
2011-06-05 22:25:05 +00:00
Philippe Teuwen
96538d052b Extend max length for firmware description & fix typo 2011-05-25 19:53:45 +00:00
Romuald Conty
17c63aebb5 pn53x_usb: continue to search a available device on usb errors (r1092 reverted then issue fixed). 2011-05-25 12:08:42 +00:00
Romuald Conty
917717c4ca drivers: UART based drivers could now use uart_flush_input() to discard junk bytes on input. 2011-05-25 10:31:19 +00:00
Romuald Conty
22e25a8b1e chips/pn53x: drivers now uses pn53x_data_new() and pn53x_data_free() to handle strcut pn53x_data allocation, initialization and freeing. 2011-05-25 10:25:17 +00:00
Romuald Conty
c45d4e685a pn53x_usb: continue to search a available device on usb errors (ie. Device Busy) 2011-05-25 10:15:18 +00:00
Romuald Conty
78ce62e7b6 Fix ISO/IEC 14443-4 hardware emulation.
NDO_AUTO_ISO14443_4 is now set to _true_ by default with nfc_target_init();
nfc_emulate_target() now fails (return _false_) when emulator->state_machine->io() failed;
Initialize nfc_device_t variables to _false_ in order to send correctly (see notes in nfc-device.c);
nfc_emulate_forum_tag4 prints error when nfc_emulate_target() failed.
2011-05-24 17:10:13 +00:00
Romuald Conty
975cd275d1 minor fixes 2011-05-20 16:09:00 +00:00
Romain Tartiere
4828211e97 Fix crash when usb_bulk_read() fails. 2011-05-18 22:25:09 +00:00
Romuald Conty
da6add3534 drivers/pn53x_usb: make PN53x usb connection more stable:
- move well-know USB problem hack into pn53x_usb_bulk_write()
 - put NACK hack to handle PN533 direct reply case
2011-05-17 10:41:26 +00:00
Philippe Teuwen
ff7696fffb nfc.c: reformulate comments of prev commit in chip-agnostic way. BTW there is more to do... 2011-05-12 20:51:44 +00:00
Philippe Teuwen
e5601e562f _timed(): now allows indirect control of intern prescaler via max expected cycles count 2011-05-12 20:33:00 +00:00
Philippe Teuwen
b98afced69 Move prescaler to CHIP_DATA struct & remove some compilation warnings 2011-05-11 23:22:52 +00:00
Philippe Teuwen
ab54a37678 list_targets support for ASK CTS512B (no anticol support yet) 2011-05-11 23:00:54 +00:00
Philippe Teuwen
53f1acfdcb _timed() fcts: allow 32b cycles counter & prescaler!=0 2011-05-11 20:56:09 +00:00
Philippe Teuwen
ca3c5007f6 pn53x _timed fcts now use burst read/write on fifo register 2011-05-10 23:44:36 +00:00
Philippe Teuwen
21dfe81d0b Some optimisations in initialisation of registers 2011-05-10 23:44:27 +00:00
Romuald Conty
2a9f876363 Import BUFFER_* macros from libfreefare and use them in writeback cache 2011-05-10 19:13:08 +00:00
Romuald Conty
2e630f7e0f windows port: fix uart_receive() under Win32 platform 2011-05-10 17:02:33 +00:00
Romuald Conty
d37b917352 chips/pn53x: remove double defines for pn53x registers. 2011-05-10 15:13:19 +00:00
Romuald Conty
e4dfa75045 chips/pn53x: *_timed() functions should prefer pn53x_WriteRegister() to bypass any kind of logical handling (mask, writeback, etc) 2011-05-10 13:53:48 +00:00
Romuald Conty
7bb4f4597d windows port: implement abort mecanism in pn532_uart driver (Based on provided patch: many thanks to Edwin Evans) 2011-05-10 13:26:57 +00:00
Philippe Teuwen
0e3357b589 pn53x _timed fcts: safebelts towards new writeback mechanism 2011-05-09 21:08:03 +00:00
Romuald Conty
ef3303839a chips/pn53x: fix memset size on writeback cache, typo and fix a mask problem on data store 2011-05-09 20:42:11 +00:00
Romuald Conty
b3cade2db2 Fix writeback cache size and some typo. 2011-05-09 19:55:22 +00:00
Romuald Conty
009d851771 Implement WriteBack cache (Fixes Issue 155) 2011-05-09 19:34:00 +00:00
Romuald Conty
95914345e1 chips/pn53x: add pn53x_data_new() function to alloc and init pn53x_data structure. 2011-05-09 18:47:48 +00:00
Romuald Conty
ebb352f1f3 Clean up and add some debug msg on ReadRegister/WriteRegister 2011-05-09 15:14:50 +00:00
Romuald Conty
25e2dbec95 chips/pn53x: set ui8LastCommand in chip layer instead of driver layer. 2011-05-09 14:22:12 +00:00
Romuald Conty
902bbfb04c Fix a segfault when abort_p is NULL. 2011-05-09 11:19:01 +00:00
Romuald Conty
921d28d976 Attempt to provide an abort mecanism for windows users... 2011-05-09 11:14:43 +00:00
Romuald Conty
468027ba2b chips/pn53x: PN532 now goes in LowVBat mode when setting idle mode from target mode. 2011-05-09 10:44:44 +00:00
Romuald Conty
be0f0b0828 New function nfc_idle() to set the NFC device in idle mode.
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.
2011-05-09 10:09:40 +00:00
Romuald Conty
3a9327d1be document nfc_abort_command() 2011-05-06 23:25:41 +00:00
Philippe Teuwen
d834860965 Add partial support (list) for ISO14443B-3 ST SRx & ASK CTx cards 2011-05-06 19:11:03 +00:00
Romuald Conty
805d738b24 Implement PN53x extended information frames with USB devices. (Fixes Issue 158) 2011-05-06 15:03:08 +00:00
Romuald Conty
11a91af749 Add some SFR registers description, typo in PN53X_REG_CIU_TxMode address. 2011-05-06 14:32:32 +00:00
Romuald Conty
cd6946e751 Add ISO/IEC 14443 B' aka Type B' modulation partial support 2011-05-06 14:14:06 +00:00
Philippe Teuwen
77e522aade chips/pn53x.c: allow null reception buffers for transceive commands 2011-05-05 23:13:49 +00:00
Philippe Teuwen
c0a38e6eb0 drivers: fix bug on receive: all pn53x_transceive after an error were flagged as erroneous 2011-05-05 22:26:51 +00:00
Romuald Conty
cad3dc652d chips/pn53x: print a debug trace when reading PN53x registers. 2011-05-05 18:19:20 +00:00
Romuald Conty
04820bea47 chips/pn53x: set some parameters in FeliCa when using DEP mode. 2011-05-05 15:19:46 +00:00
Romuald Conty
80b4cd9767 chips/pn53x: set some parameters in ISO/IEC 14443A when using DEP mode (ie. SAK says ISO/IEC 18092 compliant) 2011-05-05 15:00:34 +00:00
Philippe Teuwen
e276d3e6ba nfc_target_init: drop explicitely the field 2011-05-05 14:58:26 +00:00
Philippe Teuwen
8dd8d25ef7 LoGO progressive field: remove hacks, unneeded with revised initializations 2011-05-05 12:45:56 +00:00
Romuald Conty
64b036b129 drivers: InDataExchange is an abortable command too. 2011-05-05 11:49:43 +00:00
Romuald Conty
008f2a8d4c Minor returns fixes. 2011-05-05 11:46:12 +00:00
Philippe Teuwen
4124dc662d Cleanup of initializations 2011-05-05 10:12:26 +00:00
Romuald Conty
5f890fedcc Remove obsolete callbacks 2011-05-05 09:45:39 +00:00
Romuald Conty
0265515a0c Abort mecanism is now implemented in driver layer:
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.
2011-05-05 09:27:17 +00:00
Philippe Teuwen
412c326c3a better fix for timed fcts 2011-05-04 14:14:18 +00:00
Philippe Teuwen
f2cb0eaa6e list_passive_targets: fixed for TypeB on LoGO 2011-05-03 19:22:28 +00:00
Romuald Conty
c7da492872 drivers/pn53x_usb: use progressive field on/off only for ISO14443 Type B target listing. 2011-05-03 13:55:38 +00:00
Philippe Teuwen
8169da3701 pn53x: Fix bug in _timed fcts 2011-05-03 13:55:20 +00:00
Romuald Conty
26071a817b drivers/pn53x_usb: enable progressive field on init to allow pn53x-tamashell to works (note: it does not distrib progressive field enabling when nfc_list_passive_target() is used). 2011-05-03 13:19:03 +00:00
Audrey Diacre
e82e897bd9 pn53x: oups, fix typo. 2011-05-03 12:24:33 +00:00
Audrey Diacre
85a30c0897 pn53x:reorder functions according to header. 2011-05-03 12:08:54 +00:00
Romuald Conty
96358368f5 cast explicitly sz (uint8_t) in size_t 2011-05-02 16:43:03 +00:00
Romuald Conty
517cde2517 Prepare 1.5.0 version 2011-04-29 10:13:57 +00:00
Romuald Conty
de9255eaea drivers/arygon: enable abort() mecanism on InJumpForDEP command 2011-04-27 15:09:22 +00:00
Romuald Conty
6fc4a5b70a Use a new current target pointer to choose correctly the sending/receiving method (ie. TgSetData/TgGetData or TgResponseToInitiator/TgGetInitiatorCommand). 2011-04-27 14:42:27 +00:00
Romuald Conty
1107b226ac drivers/pn532_uart: enable abort() mecanism on InJumpForDEP command 2011-04-27 14:38:05 +00:00
Romuald Conty
ee718d6f9b drivers/pn53x_usb: do not send ACK when its not needed, enable abort() mecanism on InJumpForDEP command 2011-04-27 14:37:24 +00:00
Romuald Conty
1198a71d64 chip/pn53x: handle PN532 "power down" and "low VBat" power mode instead of a simple "sleep" mode. (Fixes Issue 167) 2011-04-27 13:16:36 +00:00
Romuald Conty
332e4afc31 drivers/arygon: add a debug message when a not supported payload is sent. 2011-04-22 17:30:17 +00:00
Romuald Conty
971d799e39 Arygon driver: append Arygon firmware version to device name. 2011-04-20 14:06:12 +00:00
Romuald Conty
f4f0b38f73 Put a comment on tcflush(), it does not produce the attempted effect. ie. there are remaining bytes from old connections. 2011-04-20 14:03:41 +00:00
Romuald Conty
762f6fb1f3 Windows: install libusb into examples directory using "Bundle" feature from CMake (Thanks to Glenn Ergeerts) 2011-04-20 13:18:38 +00:00
Romuald Conty
231913fd35 show PRINT_HEX result on stderr in debug mode (that helps to sync with debug msg which are printed on standard error output.) 2011-04-20 12:11:31 +00:00
Romuald Conty
4996d36f5f drivers/arygon: reject too heavy payload (ARYGON does not support extended frame even with PN532 equipped device) 2011-04-14 15:50:04 +00:00
Romuald Conty
fe49ccd701 Implement extended frame send/receive for PN532_UART driver. 2011-04-13 16:39:58 +00:00
Philippe Teuwen
9c7c4307d4 pn53x_usb: turn off LEDs on LoGO on exit 2011-04-08 19:27:10 +00:00
Philippe Teuwen
ed715056e2 pn53x_usb: add comments on LED switching 2011-04-08 19:11:42 +00:00
Romuald Conty
0daa5822f5 add SCM SCL3711 led support: the led is now On/Off accordingly to field activation. 2011-04-08 14:42:29 +00:00
Romuald Conty
bd7c9a2b85 Enhance ASK LoGO dedicated code:
- Initialize the device right after pn53x_init() instead of pn53x_initiator_init().
 - Turn on LED1 when initialized
 - Switch On/Off LED2 on Activation/Desactivation of the field.
2011-04-08 14:30:23 +00:00
Romuald Conty
494e0f4474 windows: copy libusb.dll to bin install dir (windows needs it to be alongside the exe or in the path) (Thanks to Gleen Ergeerts) 2011-04-08 14:11:42 +00:00
Philippe Teuwen
55495e1e97 *_timed fcts: proper error codes 2011-04-05 13:44:36 +00:00
Philippe Teuwen
743fa048e1 pn53x: adapt MaxRetries to avoid issue with 2 tags on PN531, using same value as what LoGO does 2011-04-05 13:39:47 +00:00
Philippe Teuwen
7f2b300dde support crc auto-handling in ...transceive_bytes_timed 2011-04-04 22:23:38 +00:00
Philippe Teuwen
ffe2714b28 pn53x: factorize timer code 2011-04-04 19:04:43 +00:00
Romuald Conty
11668f1143 Chip type is filled in pn53x_init(). 2011-04-04 15:21:28 +00:00
Romuald Conty
601081d50a Calibrate PN532_UART and ARYGON drivers. 2011-04-04 15:20:33 +00:00
Philippe Teuwen
93de7fcd5c pn53x drivers: fix timer corrections location 2011-04-04 15:07:39 +00:00
Philippe Teuwen
fb398c387f pn53x: add timed versions of transceive_bytes/bits 2011-04-04 14:16:36 +00:00
Romuald Conty
b21d3c6728 ASK LoGO: enable progressive field feature. 2011-04-04 09:53:33 +00:00
Romuald Conty
71c400ae14 Fix a bug when value is larger than mask. 2011-04-04 09:53:00 +00:00
Philippe Teuwen
93c56a4b44 pn53x_usb: fix description strings 2011-04-04 09:29:14 +00:00
Philippe Teuwen
5600007dd3 pn53x: factorize & generalize CHIP_DATA() usage 2011-04-04 09:26:10 +00:00
Romuald Conty
5db8be908b Windows support contribution:
- Move CMake modules from cmake_modules/ to cmake/modules/
 - CMake now use cmake/config_windows.h.cmake to create config.h on Windows platform
 - contrib/windows.h header is automagically included by config.h
 - Put missing NFC_EXPORT macro on front of emulation API
 - nfc-mfclassic and nfc-mfcultralight examples are now compiled under Windows
Many thanks to Glenn Ergeerts which provide the initial patch.
2011-03-31 13:38:49 +00:00
Romuald Conty
8ed870d886 windows: implement a dynamicly construct list of serial ports (Thanks to Edwin Evans) 2011-03-30 14:19:53 +00:00
Romuald Conty
2c37571a40 Add nfc-emulation source while build using CMake 2011-03-30 09:40:33 +00:00
Romuald Conty
d72d5c536e Add licence and document a bit some files. 2011-03-30 09:39:08 +00:00
Romain Tartiere
e44af986a0 Unbreak aborting from the pn53X_usb driver. 2011-03-13 20:42:27 +00:00
Romain Tartiere
2d31877aec Fix header protection. 2011-03-13 20:33:00 +00:00
Romain Tartiere
0f0fa2b14f Move nfc_emulate_target() from examples to the library. 2011-03-13 14:31:06 +00:00
Romuald Conty
4d458ec3d6 Attempt to fix Windows port. 2011-03-09 18:41:57 +00:00
Romain Tartiere
2f60e23fd5 Cleanup macro. 2011-03-09 16:13:44 +00:00
Romain Tartiere
2cca743e07 Return an error when a command is aborted;
Fix aborting with UART devices.
2011-03-09 14:10:40 +00:00
Romain Tartiere
605a5f2db3 Fix nfc_pick_device() when called from nfc_connect with NULL nfc_device_desc_t parameter (Fixes Issue 156) 2011-03-09 13:49:33 +00:00
Romain Tartiere
cfc5273275 Simplify uart_send() on POSIX systems. 2011-03-09 13:42:23 +00:00
Romain Tartiere
ad530f6d02 Various cleanups.
- New functions nfc_device_new(), nfc_device_free();
- Add experimental abort mechanism for the PN53x USB driver;
- Move chip-specific variables from nfc_device_t to pn53x_data (Fixes Issue 124).
2011-03-09 13:37:16 +00:00