Commit graph

931 commits

Author SHA1 Message Date
Philippe Teuwen
cc7c0c32f1 Fix warning about incompatible types
pn53x.c:85:57: warning: Result of 'malloc' is converted to a pointer of type 'nfc_modulation_type', which is incompatible with sizeof operand type 'nfc_modulation'
    CHIP_DATA(pnd)->supported_modulation_as_initiator = malloc(sizeof(nfc_modulation) * 9);
                                                        ^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
2013-07-02 22:44:55 +02:00
Mike Auty
ebe6335fc1 Rerun usb_find_busses() and usb_find_devices() without recalling usb_init()
Fixes issue #252
2013-06-22 20:03:45 +02:00
Philippe Teuwen
03e1f23a40 Make use of new PN53x_ACK_FRAME__LEN 2013-06-15 23:14:54 +02:00
Laurent Latil
80a41010fb Fix various problems in I2C support of PN532: - Fix a memory leak in pn532_i2c_wait_rdyframe() - Remove unused parameters and local variables - Fix all other compilation warnings
Note: a new constant (PN53x_ACK_FRAME__LEN) has been defined in
pn53x-internal.h file to avoid hard coding the ACK frame length.
2013-06-15 22:53:35 +02:00
Philippe Teuwen
957bebfd48 make style 2013-06-15 22:51:53 +02:00
Philippe Teuwen
9de66d463b UART: add support for BeagleBone serial ports
Thanks to Johan Henselmans!
2013-06-15 22:01:28 +02:00
Philippe Teuwen
d99bcb79fa I2C: add i2c support to CMake 2013-06-15 00:41:20 +02:00
Philippe Teuwen
77445f1672 I2C: remove unneeded I2C_DRIVERS_ENABLED 2013-06-15 00:20:04 +02:00
Philippe Teuwen
3cd26a18f1 I2C: add Laurent Latil as author 2013-06-15 00:04:06 +02:00
Philippe Teuwen
238be3f068 make style 2013-06-15 00:01:25 +02:00
Laurent Latil
1b11450312 Add I2C protocol support for PN532. 2013-06-14 23:59:46 +02:00
Philippe Teuwen
6038aca7d1 acr122_usb: remove ACR122<>TOUCHATAG model distinction 2013-06-14 23:58:55 +02:00
Philippe Teuwen
c6bda74f44 acr122_usb: ACR122U does not need PCSC Escape anymore
ACR122U:
Through PCSC we couldn't send APDUs to the reader if there was no card
but now that we communicate directly with the reader, we can send APDUs
even if there is no card, so we don't need the Escape mechanism anymore
2013-06-14 23:39:43 +02:00
Philippe Teuwen
c2fa73b404 acr122_usb: retry a few times if init failed 2013-06-14 23:28:03 +02:00
Philippe Teuwen
f0471ebc89 acr122_usb: capture more specifically the expected error SW=637f 2013-06-13 21:01:08 +02:00
Romuald Conty
af7eef0c54 acr122_usb: check received Status Word (Touchatag)
Test if SW1 is 0x61 (means more bytes have to be read) before using SW2 as length.

Update issue 251
The driver now check that Status Word (SW1) is equals to 0x61 (more data available) before using SW2 as length.
If SW is not as expected, it show SW1 and SW2.
2013-06-13 15:56:39 +02:00
Romuald Conty
5757fafe0c acr122_usb: check if received frame is long enough (Touchatag)
This prevents from potential out-of-memory read.
2013-06-13 15:49:48 +02:00
Romain Tartière
0a5199a737 Avoid clash with system's htole32 if it exists.
Fix build on FreeBSD.

Reported by:    Ganael Laplanche
2013-05-20 17:02:24 +02:00
Romain Tartière
c1db25c05b Include <stdlib.h>, required for getenv(3).
Fix build if -Werror is set, avoid coredumping at runtime otherwise.

Reported by:	Ganael Laplanche
2013-05-20 17:01:49 +02:00
Romuald Conty
936210c076 pn53x: only create a current target when at least one have been found. 2013-05-13 09:43:46 +02:00
Philippe Teuwen
41ec6d49f6 Add ISO14443-4 chaining support for RX (MI) 2013-04-28 23:52:15 +02:00
Romuald Conty
b84ac324ff pn532_uart: fix 'operation abort' feature with this driver 2013-04-18 13:49:10 +02:00
Philippe Teuwen
b950eacfdf drivers USB: check usb_open() result
Fixes issue 245
2013-04-05 15:42:57 +02:00
Philippe Teuwen
9cb9e0e6da Fix cppcheck warning: The scope of the variable X can be reduced. 2013-04-05 14:38:03 +02:00
Alex Lian
8b8b8d49a7 Windows packaging improvement
- Stepped away from NSIS, to just be a plain zip file
- Fixed a bug (though when trying NSIS) of dealing with slashes in windows paths
- Had package add .lib file instead of .dll.a file, since lib files tend to be more useful for Windows developers
2013-04-03 01:06:03 -04:00
Ludovic Rousseau
a8f91c05d2 Fix autoreconf warning
libnfc/buses/Makefile.am:16: warning: EXTRA_DIST multiply defined in
condition TRUE ...
libnfc/buses/Makefile.am:9: ... 'EXTRA_DIST' previously defined here
2013-04-01 18:26:23 +02:00
Philippe Teuwen
0625544cc3 Merge branch 'pn532_spi'
* pn532_spi:
  SPI: remove dead code
  SPI: add 1ms sleep in wakeup()
  SPI: update NEWS & Changelog
  Add connstring example for SPI on RPi
  Add PN532 SPI driver to CMake
  spi: fix doc typos
  spi: remove spi_posix.c, exotic platform implementations will have to be done in their respective contrib subdir
  Only include SPI related files when (at least) one SPI driver is enabled
  pn532_spi: missing malloc() checks, spi_close(), nfc_device_close() on some error handling branches
  pn532_spi: fix missing free(ndd.port)
  pn532_spi: fix double free() of spi port info
  Add pn532_spi author to AUTHORS
  Unify copyright notices
  pn532_spi: use new connstring_decode()
  Fix cppcheck warning "Non reentrant function 'readdir' called"
  Fix cppcheck warning "scanf without field width limits can crash with huge input data"
  Fix cppcheck warning "Obsolete function 'usleep' called"
  spi driver: remove compilation warnings
  make style
  Adding a SPI driver for pn532
2013-04-01 13:24:28 +02:00
Philippe Teuwen
0b1bf105be Revert 1c67c3f92a
Fixes issue 244
errorlibnfc.driver.acr122_usbToo small reply
2013-03-30 17:51:06 +01:00
Philippe Teuwen
1b45bd4ee1 SPI: remove dead code 2013-03-28 00:20:03 +01:00
Philippe Teuwen
f9bd5d79d2 SPI: add 1ms sleep in wakeup()
Without this delay I had troubles with a Raspberry-Pi:
With debug enabled I could go as high as 7.8MHz but without debug I had to go lower than 500kHz otherwise I got following error:
  errorlibnfc.driver.pn532_spiUnable to wait for SPI data. (RX)
  pn53x_check_communication: Timeout
It could work occassionally faster but very unreliable.
So the delay introduced by printf() was enough to "fix" the problem, therefore this little extra sleep() in wakeup().
2013-03-28 00:19:29 +01:00
Philippe Teuwen
7c2f8b4cb0 Add PN532 SPI driver to CMake 2013-03-27 23:25:43 +01:00
Philippe Teuwen
dcc527df7b Merge branch 'master' into pn532_spi
* master:
  CMake: enable same set of default drivers as for autotools
  pn532_uart: Unify copyright notices & update authors lists (somehow this file was forgotten)
2013-03-27 23:13:19 +01:00
Philippe Teuwen
7df8fdd0f6 spi: fix doc typos 2013-03-27 22:58:59 +01:00
Philippe Teuwen
12b756e97a spi: remove spi_posix.c, exotic platform implementations will have to be done in their respective contrib subdir 2013-03-27 17:40:22 +01:00
Philippe Teuwen
fc420d58af Only include SPI related files when (at least) one SPI driver is enabled 2013-03-27 16:58:01 +01:00
Philippe Teuwen
1ab282d43c pn532_spi: missing malloc() checks, spi_close(), nfc_device_close() on some error handling branches 2013-03-27 16:27:25 +01:00
Philippe Teuwen
f1a9a8ee38 pn532_uart: Unify copyright notices & update authors lists (somehow this file was forgotten) 2013-03-27 16:12:18 +01:00
Philippe Teuwen
794fcdc1ad pn532_spi: fix missing free(ndd.port) 2013-03-27 12:06:37 +01:00
Philippe Teuwen
87a3dd7067 pn532_spi: fix double free() of spi port info 2013-03-27 12:06:33 +01:00
Philippe Teuwen
1417bdc164 Merge branch 'master' into pn532_spi
* master: (28 commits)
  Update Changelog
  Add missing windows files in archive
  Move log implementation for Windows in dedicated directory
  Move UART implementation for Windows in dedicated directory
  CMake: only compile usbbus.c when (at least) one USB driver is enabled
  CMake: only include UART related files when (at least) one UART driver is enabled
  Only include UART related files when (at least) one UART driver is enabled
  Fix environment vars usage when compiling with CMake
  Remove unsed code section in log.c (was commented)
  pn53x_current_target_new() now returns null ptr upon malloc() error
  fix missing tests on malloc() return
  pn53x_data_new() now returns null ptr upon malloc() error
  uart drivers: missing pn53x_data_free() on some error handling branches
  uart drivers: missing nfc_device_free() on some error handling branches
  uart drivers: missing uart_close() on some error handling branches
  uart drivers: fix missing free(ndd.port)
  config parser: missing fclose()
  UART drivers: fix double free() of serial port info
  Fix cmake build failure under linux
  quick_start_example1.c: avoid using warnx() to remove err.h dependency
  ...

Conflicts:
	libnfc/buses/Makefile.am
2013-03-27 11:44:29 +01:00
Romuald Conty
2be00e7615 Move log implementation for Windows in dedicated directory 2013-03-18 23:53:01 +01:00
Romuald Conty
cb3452db7b Move UART implementation for Windows in dedicated directory 2013-03-18 23:46:14 +01:00
Romuald Conty
a422ae2211 CMake: only compile usbbus.c when (at least) one USB driver is enabled 2013-03-18 23:32:07 +01:00
Romuald Conty
b6b356b948 CMake: only include UART related files when (at least) one UART driver is enabled 2013-03-18 23:27:23 +01:00
Romuald Conty
699e9123ea Only include UART related files when (at least) one UART driver is enabled 2013-03-18 23:07:19 +01:00
Romuald Conty
e898e5f73b Remove unsed code section in log.c (was commented) 2013-03-18 15:25:07 +01:00
Philippe Teuwen
890f028b0c pn53x_current_target_new() now returns null ptr upon malloc() error 2013-03-18 01:00:41 +01:00
Philippe Teuwen
69c435f348 fix missing tests on malloc() return 2013-03-18 00:46:31 +01:00
Philippe Teuwen
06d5b54308 pn53x_data_new() now returns null ptr upon malloc() error 2013-03-18 00:21:08 +01:00
Philippe Teuwen
af57df532b uart drivers: missing pn53x_data_free() on some error handling branches 2013-03-18 00:21:03 +01:00