Commit graph

957 commits

Author SHA1 Message Date
Philippe Teuwen
37cf7554d9 Add log_posix to Makefile.am 2013-03-08 00:34:14 +01:00
Alex Lian
b3c6ea86ad Split logging internals so that platforms may choose additional or alternate spew mechanisms
In the case of windows, allow for the OutputDebugString call in addition to logging to stderr.
Useful for the dll scenario and debugging in Visual Studio.
2013-03-07 10:36:33 +01:00
Philippe Teuwen
563054d2a2 More explicitely ignoring return value as suggested by Ludovic 2013-03-07 10:34:17 +01:00
Alex Lian
7b917f9a8b Windows: Clean up all compiler warnings and link warnings
- Fixed the suppression of the auto-fixup for linking against MS built libs
- Fixed all the formatting warnings by shifting to inttypes.h specifiers
- shifted to %lu for DWORD printf
2013-03-07 09:37:36 +01:00
Alex Lian
c72846e3c6 Convert by value passing of nfc_target to pointer for str_nfc_target and nfc_initiator_target_is_present
This becomes more consistent with all other pass by pointer of most structures.
Additionally, this should lessen stack memory usage, as building strings with str_nfc_target would push the target (283 bytes) plus then a copy of the info objects (up to 275) onto the stack as it dives into the sprintf functions.

Lastly, this makes my attempt at a .NET wrapper easier, as I can make passing by pointer work, but passing by value seems to bomb on the interop right now.
2013-03-07 09:16:33 +01:00
Philippe Teuwen
a262be5633 Windows: Fix bug when compiling without libusb: skip usbbus.c 2013-03-07 08:09:32 +01:00
Alex Lian
f8d8052866 Windows: Fix compilation due to new usbbus file 2013-03-07 08:05:31 +01:00
Philippe Teuwen
008158090c Fix bug when compiling without libusb: skip usbbus.c 2013-03-07 00:43:35 +01:00
Philippe Teuwen
1c67c3f92a Fix scan-build warning: cast increases required alignment from 1 to 4
acr122_usb.c:562:20: warning: cast from 'uint8_t *' (aka 'unsigned char *') to 'uint32_t *' (aka 'unsigned int *') increases required alignment from 1 to 4 [-Wcast-align]
  uint32_t *pu32 = (uint32_t *)u8;
                   ^~~~~~~~~~~~~~
2013-03-06 23:22:02 +01:00
Philippe Teuwen
fdd5bd3523 Avoid warning about ignoring return value of 'read' 2013-03-06 21:13:39 +01:00
Philippe Teuwen
7fb538737d Fix cppcheck warning "Non reentrant function 'readdir' called"
For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'.
2013-03-06 20:59:41 +01:00
Philippe Teuwen
90622f52b7 conf.h: make it more standard 2013-03-06 19:36:32 +01:00
Philippe Teuwen
b81519c6a9 uart_posix.c: remove redundant include 2013-03-06 19:34:57 +01:00
Philippe Teuwen
a0b859b2a1 Fix cppcheck warning "Non reentrant function 'readdir' called"
For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'.
2013-03-06 15:20:15 +01:00
Philippe Teuwen
4dafd70b64 Fix cppcheck warning "Statements following return will never be executed" 2013-03-06 12:42:39 +01:00
Philippe Teuwen
1d5f9956fb Fix cppcheck warning "buffer may not be null-terminated after call to strncpy()" 2013-03-06 12:38:59 +01:00
Philippe Teuwen
a3facbdc7d sprint_nfc_target() => snprint_nfc_target()
And all sub-functions in target_subr.c
2013-03-06 12:17:33 +01:00
Philippe Teuwen
658ec4585a Fix cppcheck warning "scanf without field width limits can crash with huge input data" 2013-03-06 11:42:35 +01:00
Philippe Teuwen
f0d5896140 Fix cppcheck style: "The scope of the variable can be reduced" 2013-03-06 11:02:47 +01:00
Philippe Teuwen
0aa1ff309e Fix cppcheck warning "Variable is assigned a value that is never used" 2013-03-06 10:56:12 +01:00
Philippe Teuwen
c37d1742c3 Fix cppcheck style: scope of variable can be reduced
Fix the following cppcheck warnings:
[libnfc/chips/pn53x.c:617]: (style) The scope of the variable 'res' can be reduced
2013-03-06 00:54:49 +01:00
Philippe Teuwen
d577fda412 Fix cppcheck warning "scanf without field width limits can crash with huge input data"
Fix following warnings:
[examples/pn53x-tamashell.c:162]: (warning) scanf without field width limits can crash with huge input data
[libnfc/drivers/acr122_pcsc.c:261]: (warning) scanf without field width limits can crash with huge input data
[libnfc/drivers/acr122s.c:441]: (warning) scanf without field width limits can crash with huge input data
[libnfc/drivers/arygon.c:210]: (warning) scanf without field width limits can crash with huge input data
[libnfc/drivers/arygon.c:522]: (warning) scanf without field width limits can crash with huge input data
[libnfc/drivers/pn532_uart.c:187]: (warning) scanf without field width limits can crash with huge input data
[utils/nfc-relay-picc.c:176]: (warning) scanf without field width limits can crash with huge input data
2013-03-06 00:52:08 +01:00
Philippe Teuwen
4769392157 Fix cppcheck style: scope of variable can be reduced
Fix the following cppcheck warnings:
[libnfc/drivers/pn532_uart.c:492]: (style) The scope of the variable 'res' can be reduced
[libnfc/chips/pn53x.c:320]: (style) The scope of the variable 'res' can be reduced
[libnfc/chips/pn53x.c:616]: (style) The scope of the variable 'res' can be reduced
[libnfc/nfc.c:356]: (style) The scope of the variable '_device_found' can be reduced
[utils/nfc-mfclassic.c:178]: (style) The scope of the variable 'key_index' can be reduced
2013-03-06 00:35:36 +01:00
Philippe Teuwen
03bc30f116 Fix "Possible null pointer dereference" error 2013-03-05 23:56:38 +01:00
Philippe Teuwen
73b5c9d0af nfc_init() return rather than exit on malloc error, examples fixed accordingly 2013-03-05 22:24:59 +01:00
Philippe Teuwen
ae6062e5ba nfc_context_new(): replace err() by return, problem still in nfc_init()!!
Not a good idea to call exit() from a library...
Problem is now moved to
void nfc_init() calling exit()
This requires a change in API to return error rather than exiting...
2013-03-05 20:03:19 +01:00
Philippe Teuwen
09ef2e3927 nfc_device_new(): replace err() by return
Not a good idea to call exit() from a library...
2013-03-05 19:58:32 +01:00
Philippe Teuwen
b0f216b3b2 spi driver: remove compilation warnings
spi_posix.c:141:1: warning: no previous prototype for 'bit_reversal' [-Wmissing-prototypes]
=> set bit_reversal() static

pn532_spi.c:258:48: warning: unused parameter 'timeout' [-Wunused-parameter]
=> remove timeout in pn532_spi_read_spi_status() params
2013-03-03 16:24:10 +01:00
Philippe Teuwen
cd98a4ac87 make style 2013-03-03 16:14:58 +01:00
Philippe Teuwen
2ac7963076 Merge branch 'master' into pn532_spi 2013-03-03 16:10:11 +01:00
Philippe Teuwen
b68a37b835 Replace usb_set_debug() in utils by new group in LIBNFC_LOG_LEVEL
To use it: (NFC_LOG_PRIORITY_DEBUG * 2 ^ NFC_LOG_GROUP_LIBUSB)
LIBUSB_LOG_LEVEL=12288
2013-03-02 23:43:37 +01:00
Philippe Teuwen
2334adc8bd Fix compilation warnings: values never read
Fixes:
pn53x.c:523:11: warning: Value stored to 'pbtRawData' is never read
          pbtRawData += szRawData - 8;
          ^             ~~~~~~~~~~~~~
pn53x.c:544:7: warning: Value stored to 'pbtRawData' is never read
      pbtRawData += 2;
      ^             ~
pn53x.c:532:7: warning: Value stored to 'pbtRawData' is never read
      pbtRawData += 8;
      ^             ~
pn53x.c:3085:3: warning: Value stored to 'buflen' is never read
  buflen -= res;
  ^         ~~~
pn53x.c:3080:3: warning: Value stored to 'buf' is never read
  buf += res;
  ^      ~~~
target-subr.c:466:7: warning: Value stored to 'dst' is never read
      dst += sprintf(dst, "* Unknown card, sorry\n");
      ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
target-subr.c:480:3: warning: Value stored to 'dst' is never read
  dst += sprint_hex(dst, nfi.abtSysCode, 2);
  ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
target-subr.c:490:3: warning: Value stored to 'dst' is never read
  dst += sprint_hex(dst, nji.btId, 4);
  ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
target-subr.c:546:7: warning: Value stored to 'dst' is never read
      dst += sprintf(dst, "\n");
      ^      ~~~~~~~~~~~~~~~~~~
target-subr.c:571:5: warning: Value stored to 'dst' is never read
    dst += sprint_hex(dst, nii.abtAtr, nii.szAtrLen);
    ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
target-subr.c:580:3: warning: Value stored to 'dst' is never read
  dst += sprint_hex(dst, nsi.abtUID, 8);
  ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
target-subr.c:593:3: warning: Value stored to 'dst' is never read
  dst += sprintf(dst, "           Fab Code: %02X\n", nci.btFabCode);
  ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
target-subr.c:608:5: warning: Value stored to 'dst' is never read
    dst += sprint_hex(dst, ndi.abtGB, ndi.szGB);
    ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2013-03-02 19:39:20 +01:00
Philippe Teuwen
70b0dffca7 acr122_usb: fix compiler warnings & check return value
acr122_usb.c:570:3: warning: Null pointer passed as an argument to a 'nonnull' parameter
  memcpy(DRIVER_DATA(pnd)->apdu_frame.apdu_payload, data, data_len);
  ^                                                 ~~~~
acr122_usb.c:738:3: warning: Value stored to 'offset' is never read
  offset += len;
  ^         ~~~
acr122_usb.c:753:3: warning: Value stored to 'res' is never read
  res = acr122_usb_bulk_write(DRIVER_DATA(pnd), (unsigned char *) & (DRIVER_DATA(pnd)->tama_frame), res, 1000);
  ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2013-03-02 19:25:36 +01:00
Philippe Teuwen
f07d784b8b make style 2013-03-02 13:17:57 +01:00
Ludovic Rousseau
999631588d closedir() only if opendir() succeeds
Fix compiler warning:
conf.c:186:3: warning: Null pointer passed as an argument to a 'nonnull' parameter
  closedir(d);
  ^        ~
2013-03-02 13:11:30 +01:00
Ludovic Rousseau
aee56b9255 Initialize variables
Fix compiler warnings and potential bug

pn53x.c:1526:19: warning: The right operand of '<' is a garbage value
    for (i = 0; i < sz; i++) {
                  ^ ~~
pn53x.c:1621:19: warning: The right operand of '<' is a garbage value
    for (i = 0; i < sz; i++) {
                  ^ ~~
2013-03-02 13:09:23 +01:00
Philippe Teuwen
ae571941c5 usbbus: make usb_initialized static 2013-03-02 12:43:15 +01:00
Philippe Teuwen
1f0b0e5b81 Fix zealous double free 2013-03-02 12:26:24 +01:00
Ludovic Rousseau
e7290de83b Fix compiler warning
nfc.c:121: warning: function declaration isn't a prototype
nfc.c: In function 'nfc_drivers_init':
nfc.c:121: warning: old-style function definition
2013-03-02 11:30:24 +01:00
Romuald Conty
3aadb45988 Ease diff between both libusb based drivers: acr122_usb and pn53x_usb 2013-03-02 10:59:37 +01:00
Philippe Teuwen
b2b1d2a2a2 make style 2013-03-02 02:52:07 +01:00
Philippe Teuwen
a6c405a5d5 malloc/free: some more cleaning & checking malloc errors 2013-03-02 02:51:33 +01:00
Philippe Teuwen
0708279215 malloc/free: some cleaning & checking malloc errors 2013-03-02 02:25:13 +01:00
Philippe Teuwen
d7e7abb061 Fix mem leak in config file parser (opendir)
This fixes the following leaks:

==30517== 32,808 bytes in 1 blocks are definitely lost in loss record 11 of 12
==30517==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==30517==    by 0x50F4B2A: __alloc_dir (opendir.c:186)
==30517==    by 0x4E34998: conf_devices_load.constprop.1 (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==30517==    by 0x4E36350: nfc_context_new (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==30517==    by 0x4E34D98: nfc_init (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
2013-03-02 01:21:13 +01:00
Philippe Teuwen
3d9ebb5044 Fix mem leak in config file parser
This fixes the following leaks:

==18690== 256 bytes in 1 blocks are definitely lost in loss record 75 of 100
==18690==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==18690==    by 0x511613F: regcomp (regcomp.c:487)
==18690==    by 0x4E34313: conf_parse_file (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==18690==    by 0x4E349F5: conf_devices_load.constprop.1 (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==18690==    by 0x4E362C0: nfc_context_new (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==18690==    by 0x4E34D08: nfc_init (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==18690==
==18690== 32,068 (224 direct, 31,844 indirect) bytes in 1 blocks are definitely lost in loss record 98 of 100
==18690==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==18690==    by 0x4C28D6F: realloc (vg_replace_malloc.c:632)
==18690==    by 0x5115DF3: re_compile_internal (regcomp.c:760)
==18690==    by 0x51161AB: regcomp (regcomp.c:506)
==18690==    by 0x4E34313: conf_parse_file (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==18690==    by 0x4E349F5: conf_devices_load.constprop.1 (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==18690==    by 0x4E362C0: nfc_context_new (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==18690==    by 0x4E34D08: nfc_init (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
2013-03-02 01:09:47 +01:00
Philippe Teuwen
9dcf7378b6 Fix mem leak with libusb by introducing buses/usbbus.c
Now call only once usb_init(); usb_find_busses(); usb_find_devices()
instead of multiple calls in several scan() then open()

This fixes the following leaks:

==1159== 8 bytes in 1 blocks are definitely lost in loss record 9 of 102
==1159==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==1159==    by 0x53D9931: usb_parse_configuration (in /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4)
==1159==    by 0x53DB8B1: usb_os_find_devices (in /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4)
==1159==    by 0x53D8FDC: usb_find_devices (in /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4)
==1159==    by 0x4E41D79: pn53x_usb_scan (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==1159==
==1159== 8 bytes in 1 blocks are definitely lost in loss record 10 of 102
==1159==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==1159==    by 0x53D9931: usb_parse_configuration (in /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4)
==1159==    by 0x53DB8B1: usb_os_find_devices (in /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4)
==1159==    by 0x53D8FDC: usb_find_devices (in /lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4)
==1159==    by 0x4E42CC7: pn53x_usb_open (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
==1159==    by 0x4E351E6: nfc_open (in /usr/lib/x86_64-linux-gnu/libnfc.so.4.0.0)
2013-03-02 01:08:07 +01:00
Eugeny Boger
d9fd9155ea Adding a SPI driver for pn532
The driver seems to work well.
I tested it on Linux with i.mx233-based board using hardware SPI.
I tried to modify the build files as well, but it's probably a little messy.
I'm not sure whether it will work on other *nix OSes,
so it's probably better to limit the driver to Linux only using build system.
2013-02-28 23:24:42 +01:00
Philippe Teuwen
7e3549819e Split --disable-conf into --disable-conffiles & --disable-envvars 2013-02-22 21:53:16 +01:00
Ahti Legonkov
fd6d4db5b7 Make it possible to disable conf.
Now the configure script has --disable-conf command-line argument
that can be used to turn off environment variables and use of
configuration files.
2013-02-22 21:09:46 +01:00
Philippe Teuwen
72b10c5d9b Fix warnings: ignoring return value of 'pipe' & discarding const qualifier 2013-02-21 23:20:28 +01:00
Philippe Teuwen
24e1edd858 make style 2013-02-21 22:39:39 +01:00
Philippe Teuwen
5ced93fcbf Makefile.am: move header files from noinst_HEADERS to _SOURCES
Ensures proper recompilation when a header file is edited.
cf https://www.gnu.org/software/automake/manual/html_node/Headers.html
2013-02-21 22:37:20 +01:00
Philippe Teuwen
9935095a36 Fix stack smash bug in LOG_HEX() macro
Fixes issue 232
2013-02-21 22:31:19 +01:00
Romuald Conty
7e26869b68 Fixes nfc_drivers memory leak 2013-02-21 19:58:40 +01:00
Romuald Conty
1e16795341 'make style' and align some #preprocessor directives 2013-02-19 00:43:20 +01:00
Philippe Teuwen
09ce0e822c nfc_free(): fix related doc 2013-02-16 22:18:00 +01:00
Romuald Conty
f8601886fd Adds nfc_free() function to freed allocated buffers
Fixes issue 228 (Thanks to Alex Lian)
2013-02-16 14:20:37 +01:00
Romuald Conty
360365ca84 Preserves error code while setting parameters
It now returns a more precise error code while using pn53x_set_property_bool() with NP_AUTO_ISO14443_4 flag.
2013-02-15 09:38:26 +01:00
Alex Lian
4487fd768e Windows: Shift files from libnfc/windows to libnfc/contrib/win32
- Fixes the fact files were missed in package
2013-02-14 15:33:47 +01:00
Philippe Teuwen
73992041b4 Merge remote-tracking branch 'ahti/issue-137' into master
* ahti/issue-137:
  Add nfc_register_driver.

Fixes issue 225
Helps issue 137
2013-02-06 15:07:18 +01:00
Romuald Conty
d5b6a7c4d1 Resolves conflict between Alex Lian and master branch 2013-02-04 10:14:34 +01:00
Alex Lian
54e0bdb62f Windows: Build updates
- Generate rc files from version.rc.in + CMake variable information in CMakeLists files
- Add step to generate .lib file for windows developers
- Re-structure tool flag usage, apparently ADD_DEFINTIONS adds them to _ALL_ tools. This is bad for rc files with the windres tool.

Needs other platform testing, as the flags have changed to fix Windows rc file generation.
2013-02-01 10:19:02 -05:00
lego
225094e2c8 Add nfc_register_driver. Issue 137.
The nfc_register_driver allows users of the library to write their
own device drivers without needing to resort to hacking libnfc itself.
2013-02-01 14:40:40 +02:00
Romuald Conty
8127a2ca63 Merge branch 'master' of https://code.google.com/p/libnfc 2013-02-01 11:46:26 +01:00
Romuald Conty
b5f8ce91c7 Uses configurable path for libnfc's configuration files 2013-02-01 11:11:39 +01:00
Romuald Conty
cf9e02879a Enables logging by default when using CMake 2013-02-01 10:32:44 +01:00
Philippe Teuwen
06bfed11b9 Various typos 2013-01-31 21:58:29 +01:00
Romuald Conty
519dd8f8e2 make style 2013-01-31 16:12:14 +01:00
Romuald Conty
acdde1088c Renames contrib/win32/nfc_win32.c to contrib/win32/stdlib.c 2013-01-31 16:09:41 +01:00
Alex Lian
ef33827f04 Fix setenv/unsetenv link errors by implementing a local version using Windows SetEnvironmentVariable.
Untested, and does not comply with the error returns per setenv.
2013-01-31 15:52:39 +01:00
Alex Lian
9f682cc52b Fix enabling of LIBNFC_DEBUG_OUTPUT
- inclusion of log-printf.c didn't align with needed preprocessor definitions
- Added extra #error as well as preprocessor protection
- fixed CMakeList to specify -DLOG as appropriate per the header log.h usage
2013-01-31 15:52:39 +01:00
Alex Lian
eb90c5a8db Add CMake options for Win32 to require PCRE 2013-01-31 15:52:39 +01:00
Philippe Teuwen
8bc7a1c291 call idle() from driver-dependent close() rather than from nfc_close() as some driver still need to do an ack() before 2013-01-31 01:18:23 +01:00
Philippe Teuwen
683505f39b pn53x_idle: call driver-dependent PowerDown & do InRelease first, skip redundant InDeselect 2013-01-31 01:16:37 +01:00
Philippe Teuwen
1682a86166 Add driver-dependent PowerDown 2013-01-31 01:15:03 +01:00
Philippe Teuwen
db8033622a acr122_pcsc: fix log category 2013-01-31 01:08:23 +01:00
Philippe Teuwen
5446242094 acr122_usb: remove pn53x_idle support. Fixes issue #217 2013-01-30 01:27:18 +01:00
Romuald Conty
98948172b4 Fixes pn53x_usb timeout while bulk write.
Thanks to Tredger for reporting.

Fixes issue 223.
2013-01-30 00:57:06 +01:00
Romuald Conty
cd2b03a08a Add timeout parameter to nfc_emulate_target() function.
Fixes issue 219.

Thanks to raidolinja.
2013-01-30 00:10:24 +01:00
Romuald Conty
4b97700352 Removes exit() calls
Fixes issue 220

exit() was used to run abort-driven development while API changed, I forgot to remove them, sorry for that :-)
2013-01-28 13:57:40 +01:00
Ludovic Rousseau
2faa532826 Fix a typo detected by lintian(1)
unkown -> unknown
2013-01-25 14:41:33 +01:00
Philippe Teuwen
5876e33e49 Fix returned value ((res=f()<0)) => ((res=f())<0); this solves a bug in nfc-relay-picc 2013-01-22 00:56:34 +01:00
Philippe Teuwen
edacadbce6 make style 2013-01-20 15:48:32 +01:00
Philippe Teuwen
532b30a2cd Merge branch 'test_user_defined_device_optional'
* test_user_defined_device_optional:
  Fix double malloc
  Allow device.optional=true to tolerate missing device
2013-01-20 15:36:29 +01:00
Philippe Teuwen
bcd53a7cdc Fix double malloc 2013-01-20 15:24:03 +01:00
Philippe Teuwen
4576bad369 Fix ISO14443B' ATS broken by updated API 2013-01-19 00:14:19 +01:00
Philippe Teuwen
04a7d2a3ba Allow device.optional=true to tolerate missing device 2013-01-18 22:54:44 +01:00
Romuald Conty
2d53208082 Fix unit tests
This commit bring tests to life!

New issue
Summary: test_dep_states test fails
When first device is idle, the second one states  "RF Transmission Error" instead of simply not found any available device.
Full cutter log here:

debug   libnfc.chip.pn53x       InJumpForDEP
debug   libnfc.chip.pn53x       Timeout values: 300
debug   libnfc.bus.uart TX: 00  00  ff  05  fb  d4  56  00  00  00  d6  00
debug   libnfc.bus.uart RX: 00  00  ff  00  ff  00
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.bus.uart Timeout!
debug   libnfc.chip.pn53x       InJumpForDEP
debug   libnfc.chip.pn53x       Timeout values: 300
debug   libnfc.bus.uart TX: 00  00  ff  05  fb  d4  56  00  00  00  d6  00
debug   libnfc.bus.uart RX: 00  00  ff  00  ff  00
debug   libnfc.chip.pn53x       PN53x ACKed
debug   libnfc.bus.uart RX: 00  00  ff  03  fd
debug   libnfc.bus.uart RX: d5  57
debug   libnfc.bus.uart RX: 01
debug   libnfc.bus.uart RX: d3  00
debug   libnfc.chip.pn53x       Chip error: "Timeout" (01), returned error: "RF Transmission Error" (-20))
F
===============================================================================
Failure: test_dep_states
Problem with nfc_idle
<0 == res>
expected: <0>
  actual: <-20>

diff:
? -20

./test_device_modes_as_dep.c:171: initiator_thread(): cut_assert_equal_int(0, res, cut_test_context_set_current_result_user_message( cut_test_context_current_peek(), cut_test_context_take_printf(cut_test_context_current_peek(), "Problem with nfc_idle")))
===============================================================================
2013-01-18 18:28:45 +01:00
Romuald Conty
443f70dd65 Fix wrong condition to display a warning when user disables autoscan 2013-01-18 18:14:59 +01:00
Romuald Conty
f2be582cd5 Fix timeout documentation 2013-01-15 14:22:21 +01:00
Romuald Conty
945e1d140d Bump API version 2013-01-15 13:45:48 +01:00
Romuald Conty
82c41b4fc1 Fixes style: make style 2012-12-09 20:09:55 +01:00
Romuald Conty
8d9d6a5696 Add ttyAMA* to radix list from UART scanning
It allows a PN532 UART connected on raspberry pi to be detected when intrusive scan allowed (e.g. with nfc-scan-device -i)
2012-12-09 19:10:35 +01:00
Romuald Conty
0af58b1cdd Attempt to build libnfc under for Windows target.
This commit fixes some issues related to the new log system, but libnfc can not build on Windows in this stage since regex.h have been introduced for configuration file parsing and regex.h is not available in Windows.

New issue
Summary: Update Windows port
Due to the recent configuration file parsing introduction, libnfc can not be built under Windows: regex.h is missing.
Google says there is a port of PCRE for Windows which contains a compiliant regex.h.
Contribution are welcome as nobody from currently active team use Windows as OS.
2012-12-05 18:22:27 +01:00
Romuald Conty
8f015c4369 Suppress warnings: "ISO C99 requires rest arguments to be used" 2012-12-05 16:53:43 +01:00
Romuald Conty
08f428fbdf Fix CMake build. 2012-12-05 16:47:08 +01:00
Romuald Conty
53349c8c20 Prevent from segfault if user add too many devices in configuration file(s) 2012-12-05 16:41:44 +01:00
Romuald Conty
a3a3fa2848 Enhance messages display 2012-12-05 16:40:52 +01:00
Romuald Conty
dc949c257e Removes nfc_get_default_device() function.
The nfc_get_default_device() is not needed anymore since the first element from returned nfc_connstring list of nfc_list_devices() function.
Plus, nfc_open() can be use with NULL nfc_connstring which will select automatically the first available device (ie. the default one).
2012-12-05 00:51:13 +01:00
Romuald Conty
03e5611d14 New feature: search in a directory for devices configuration files. 2012-12-05 00:51:13 +01:00
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