Commit graph

446 commits

Author SHA1 Message Date
Romain Tartière
ae56188005 Fix outsource build with the autotools 2019-02-08 07:25:55 -10:00
Romain Tartière
a9e4c915f2 Add missing INCLUDES
CC       pn53x-tamashell.o
    pn53x-tamashell.c:48:12: fatal error: 'readline/readline.h' file not found
    #  include <readline/readline.h>
    	   ^~~~~~~~~~~~~~~~~~~~~
    1 error generated.
2019-02-05 08:16:59 -10:00
rocco8620
2b96c9f3c5 Wrong variable names
Wrong variable names (missing dots) on line 269, 270, 271
2017-09-03 21:53:17 +02:00
Michal Suchanek
f9417586c0 nfc-poll: print "Waiting for card removing..." before waiting 2017-07-14 16:19:26 +02:00
Philippe Teuwen
dcdbff0705 New NFC modulation type NMT_BARCODE 2017-05-17 13:58:16 +02:00
Philippe Teuwen
9f1a68530a nfc-barcode: add options -r & -n 2017-05-16 14:35:58 +02:00
Philippe Teuwen
9f4290b61b Add nfc-barcode 2017-05-16 13:22:30 +02:00
Philippe Teuwen
6235a8a26b Update example script to support PCard 2017-04-16 00:05:21 +02:00
Philippe Teuwen
024fca9cb7 make style 2017-04-01 00:46:12 +02:00
Philippe Teuwen
f2457d0559 Add pn53x-* to CMakeLists 2017-03-31 22:46:11 +02:00
Simon Yorkston
6c44c20ffc Adding support for 4K magic cards 2017-03-01 18:41:16 +01:00
Julien Ehrhart
7ae5a0c333 Fix nfc-poll card removing check (should be done only if a target has been found). 2015-08-02 16:16:19 +00:00
Dario Carluccio
e96061e44b nfc-mfsetuid: allow to write complete Block0, instead of only UID
Fixes #282
2015-04-30 14:45:05 +02:00
Romuald Conty
8fbedb87f5 Update links from googlecode to github. 2015-04-30 14:19:03 +02:00
Philippe Teuwen
6ab3c368b8 nfc-emulate-uid: remove unreachable code and add proper cleaning when interrupted 2014-03-04 01:41:01 +01:00
Philippe Teuwen
a38279793a cppcheck on nfc-pool: Variable 'res' is assigned a value that is never used 2014-02-07 01:22:27 +01:00
Romuald Conty
7b5ab23452 Partial MFC support while checking target presence on PN532/PN531
Goal is to implement "ping" on MFC the same as PN533 does. This patch implements MFC re-selection, but do not take care about authentication; this means this will have side effect while you are authenticated on a MFC block.
2014-01-29 11:36:12 +01:00
Philippe Teuwen
e2135dbaa5 pn53x-sam: fix truncated stdio return value
Problem reported by Coverity:
CID 1090318 (#1 of 1): Truncated stdio return value (CHAR_IO)
char_io: Assigning the return value of "getchar(void)" to char "input" truncates its value
2013-09-22 02:38:17 +02:00
Philippe Teuwen
d9b531f50f Verify return of nfc_device_set_property_bool()
Problem reported by Coverity
CID 1090319 (#1 of 1): Unchecked return value (CHECKED_RETURN)
  unchecked_value: No check of the return value of "nfc_device_set_property_bool(pnd, NP_EASY_FRAMING, nt.nti.nai.btSak & 0x20)".
CID 1090320 (#1 of 1): Unchecked return value (CHECKED_RETURN)
  unchecked_value: No check of the return value of "nfc_device_set_property_bool(dev, NP_HANDLE_CRC, false)".
CID 1090324 (#1 of 2): Unchecked return value (CHECKED_RETURN)
  unchecked_value: No check of the return value of "nfc_device_set_property_bool(pnd, NP_ACTIVATE_FIELD, true)".
CID 1090325 (#1 of 1): Unchecked return value (CHECKED_RETURN)
  unchecked_value: No check of the return value of "nfc_device_set_property_bool(pnd, NP_AUTO_ISO14443_4, false)".
2013-09-22 01:31:45 +02:00
Ludovic Rousseau
565134d4c4 Add missing \n in a printf() 2013-08-31 17:59:24 +02:00
Philippe Teuwen
bb5b712a74 Adding link to AUTHORS in the copyright headers 2013-07-17 13:57:56 +02:00
Romain Tartière
27c43e8b8a Improve a bit shell scripts portability.
- Use /bin/sh: bash is not required here;
  - Avoid Perl regexp in grep(1): this is a GNU extension;
  - While here, make ReadNavigo.sh fail earlier if pn53x-tamashell
    fails at first invocation.

Reported by:	Ganael Laplanche <martymac@FreeBSD.org>
2013-05-25 13:29:38 +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
Philippe Teuwen
fc144fe389 nfc-anticol: add option -t for timed exchanges 2013-04-05 14:33:16 +02:00
Ludovic Rousseau
7d986844c4 Fix compiler warnings
doc/quick_start_example1.c:24: warning: unused parameter ‘argc’
doc/quick_start_example2.c:21: warning: unused parameter ‘argc’
2013-04-03 17:55:40 +02:00
Philippe Teuwen
ecc12d28aa quick_start_example1.c: avoid using warnx() to remove err.h dependency
err.h is not available under Windows and the goal of this example is not to learn how to get around that problem ;)
2013-03-12 17:46:04 +01:00
Philippe Teuwen
d019f9729d nfc-anticol: fix ATS length 2013-03-12 12:23:15 +01:00
Philippe Teuwen
bf164220ee Unify copyright notices & update authors lists 2013-03-10 16:15:23 +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
Philippe Teuwen
d8a93217ff make style 2013-03-07 09:17:27 +01:00
Philippe Teuwen
181cd914d5 pn53x-sam: fix print_nfc_target 2013-03-07 09:17:11 +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
048ed88e16 Fix cppcheck warning "Obsolete function 'usleep' called"
It is recommended to use the 'nanosleep' or 'setitimer' function instead.
2013-03-06 21:43:36 +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
4822bb3e42 Fix bug introduced in some signal traps where context was not declared 2013-03-05 23:58:35 +01:00
Philippe Teuwen
e55efd6db0 examples/utils: add nfc_exit() to signal traps
and one missing nfc_abort_command()
2013-03-05 22:50:37 +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
bece73faaf Error conditions in utils & examples: fix leaks, unify style (see details)
* in main():
** errx()/err()/return -> exit()
** return values -> EXIT_SUCCESS & EXIT_FAILURE

* out of main:
** err()/errx()/exit() -> return
** change retval from size_t to int to allow returning errors
** don't use EXIT_SUCCESS / EXIT_FAILURE as retvals

* add nfc_close() & nfc_exit() to exit() on errors
* add missing fclose() on errors
* add missing test if (pnd == NULL)
* unify style if (pnd == / != NULL)
* remove goto's
* few related fixes
* remove if(pnd!=NULL) test on nfc_close() calls
2013-03-05 19:44:59 +01:00
Philippe Teuwen
232930c3d5 Fix resource leaks detected by cppcheck
[examples/pn53x-tamashell.c:94]: (error) Resource leak: input
[utils/nfc-mfultralight.c:264]: (error) Resource leak: pfDump
2013-03-04 01:06:16 +01:00
Philippe Teuwen
7af127ac0d pn53x-tamashell: allow larger commands up to full extended frame (264 bytes)
It was arbitrarily limited to MAX_FRAME_LEN-10 probably because of bug in LOG_HEX() fixed in previous commit
2013-02-21 22:36:23 +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
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
Nobuhiro Iwamatsu
50f5c610a1 Add man of nfc-emulate-forum-tag2 to the installation
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2013-02-01 01:57:47 +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
Ludovic Rousseau
109d496222 Compilation: Change the order of arguments
Put the -lnfc at the end of the command lie to avoid undefined
references on Ubuntu 12.04.

Close #219
2013-01-25 14:18:28 +01:00
Philippe Teuwen
9815ac728f nfc-emulate-uid: fix BCC 2013-01-22 00:45:42 +01:00
Romuald Conty
cbdac66fa4 Add quick start examples compliation to "make check" 2013-01-18 16:05:43 +01:00
Romuald Conty
995368cffa Update quick_start_examples 2012-12-05 02:05:16 +01:00
Romuald Conty
5b0e276572 Examples and utils are now updated to use the requiered nfc_context 2012-12-05 00:51:13 +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