Commit graph

266 commits

Author SHA1 Message Date
Pim 't Hart
73c84c214d nfc-read-forum-tag3: fix incomplete NDEF retrieval and size of output file 2014-02-17 23:09:15 +01:00
Philippe Teuwen
491db20d54 nfc-jewel: remove extraneous parentheses to silence warning 2014-02-11 23:23:42 +01:00
Philippe Teuwen
766ed55c79 nfc-jewel: fix out-of-bounds array access
Defect(s) Reported-by: Coverity Scan
** CID 1169884:  Out-of-bounds read  (OVERRUN)
/utils/nfc-jewel.c: 186 in write_card()
2014-02-07 23:09:40 +01:00
Pim 't Hart
ef81f06344 Adding nfc-jewel util 2014-02-03 00:04:08 +01:00
Philippe Teuwen
7a30e35496 nfc-mfclassic: update help & man page 2014-01-28 00:22:33 +01:00
Philippe Teuwen
4817a6e5c9 make style 2013-12-02 22:55:10 +01:00
Philippe Teuwen
b8e0eec91d nfc-mfclassic: initialize always bFormatCard 2013-11-12 00:43:25 +01:00
Adam Laurie
250068462b add format/wipe command to nfc-mfclassic 2013-11-11 22:03:09 +00:00
Philippe Teuwen
117b58f501 nfc-read-forum-tag3: avoid passing large struct as parameter
Problem reported by Coverity:
CID 1090334 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
  pass_by_value: Passing parameter nt of type nfc_target const (size 291 bytes) by value.
2013-09-22 18:32:47 +02:00
Philippe Teuwen
cedbefb880 nfc-relay-picc: sleep() expects unsigned int
This avoids Coverity being unhappy that only lower bound was defined, well I hope

lower_bounds: Checking lower bounds of signed scalar "waiting_time" by "waiting_time > 0".
CID 1090343 (#1 of 1): Untrusted value as argument (TAINTED_SCALAR)
  tainted_data: Passing tainted variable "waiting_time" to a tainted sink.
  sleep(waiting_time);
2013-09-22 03:00:58 +02:00
Philippe Teuwen
61884967ea nfc-mfclassic: verify return of nfc_initiator_select_passive_target()
Problem reported by Coverity:
CID 1090323 (#1 of 1): Unchecked return value (CHECKED_RETURN)
  unchecked_value: No check of the return value of "nfc_initiator_select_passive_target(pnd, nmMifare, nt.nti.nai.abtUid, nt.nti.nai.szUidLen, NULL)".
2013-09-22 02:45:23 +02:00
Philippe Teuwen
a4f466df06 Verify return of nfc_device_set_property_bool()
Problem reported by Coverity:
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 02:41:11 +02:00
Philippe Teuwen
679897d0a1 nfc-emulate-forum-tag4: fix TOCTOU
Hopefully fix TOCTOU by calling fopen() before stat()

At least this should prevent Coverity to complain about it:
CID 1090346 (#1 of 1): Time of check time of use (TOCTOU)
  fs_check_call: Calling function "stat(char const *, struct stat *)" to perform check on "filename".
  toctou: Calling function "fopen(char const * restrict, char const * restrict)" that uses "filename" after a check function. This can cause a time-of-check, time-of-use race condition.

Note that it seems pretty hard to avoid completely:
https://en.wikipedia.org/wiki/Time_of_check_to_time_of_use#Preventing_TOCTTOU
2013-09-22 02:29:07 +02:00
Philippe Teuwen
feb5f37aa3 nfc-read-forum-tag3: remove redundant error
switch case was redundant as getopt was already telling the issue:

  nfc-read-forum-tag3: option requires an argument -- 'o'
  Option -o requires an argument.

This fixes also a problem reported by Coverity about missing break:

CID 1090330 (#1 of 1): Missing break in switch (MISSING_BREAK)
  unterminated_case: This case (value 63) is not terminated by a 'break' statement.
2013-09-22 02:14:08 +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
107b4ece8b Fix use after free bug
nfc_exit(context); was called 2 times

CID 1090348 (#1 of 1): Use after free (USE_AFTER_FREE)53. deref_arg:
Calling "nfc_exit(nfc_context *)" dereferences freed pointer "context".
(The dereference is assumed on the basis of the 'nonnull' parameter
attribute.)
2013-09-19 20:38:56 +02:00
Philippe Teuwen
ad9694cf00 nfc-list: New option to choose which technologies to poll for
This is useful especially against chips emulating several types
at once (e.g. PN53x, PN544 etc)
2013-09-09 15:58:07 +02:00
Peter Meerwald
34bf7b3089 nfs-list: drop outdated examples superseeded by connection string
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-09-03 16:30:43 +02:00
Philippe Teuwen
a2a335e3d4 make style 2013-08-31 17:35:41 +02:00
Adam Laurie
07c54cd91b allow setting of UID for special 'chinese' ultralight cards 2013-08-31 16:15:27 +01:00
Philippe Teuwen
bb5b712a74 Adding link to AUTHORS in the copyright headers 2013-07-17 13:57:56 +02:00
Philippe Teuwen
2db4a0e7e4 make style
new version of astyle, better separation of XOR
2013-07-03 00:16:15 +02:00
Philippe Teuwen
7638e9ea87 mifare_classic_block_manufacturer: clearer struct members
Fixes issue 250
2013-06-13 20:14:22 +02:00
Philippe Teuwen
0841a94c65 nfc-mfclassic: allow option f for read operation too 2013-04-09 23:42:55 +02:00
Romuald Conty
e6ab66037d Better support for some special chinese cards
Fixes issue 190
2013-04-05 11:29:31 +02:00
Philippe Teuwen
e70a3314bf Update ChangeLog & make style 2013-03-12 17:07:09 +01:00
Philippe Teuwen
20e51e9752 nfc-mfclassic: add option to allow using keyfile from another card 2013-03-12 15:39:57 +01:00
Philippe Teuwen
16161e1a68 nfc-mfclassic: detect 2K MFP via RATS 2013-03-12 14:15:04 +01:00
Philippe Teuwen
56ea2e65dc nfc-mfclassic: use smaller files for cards < 4k 2013-03-12 10:56:57 +01:00
Philippe Teuwen
94617366a7 nfc-mfclassic: abort if expected UID is not matching real card 2013-03-12 10:56:20 +01:00
Philippe Teuwen
bb7b05681e nfc-mfclassic: fix reporting of processed blocks number 2013-03-12 10:55:45 +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
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
1d5f9956fb Fix cppcheck warning "buffer may not be null-terminated after call to strncpy()" 2013-03-06 12:38:59 +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
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
3f5a3fd58f nfc-read-forum-tag3 & nfc-relay-picc: remove unused variable
Fix cppcheck warnings
[utils/nfc-read-forum-tag3.c:281]: (style) Variable 'len' is assigned a value that is never used
[utils/nfc-relay-picc.c:392]: (style) Variable 'res' is assigned a value that is never used
2013-03-06 00:30:38 +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
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
b1448f6785 nfc-mfclassic: add option to tolerate RW errors & other enhancements
Reconciliate read & write operations.
Add option to tolerate or not RW failures.
Print success/failure for each block as ACL is per block.
2013-03-02 22:29:10 +01:00
Ludovic Rousseau
bd8a9fe96e Remove dead code
The local variable bFailure is set before a return.

nfc-mfclassic.c:319:11: warning: Value stored to 'bFailure' is never read
          bFailure = true;
          ^          ~~~~
2013-03-02 13:24:12 +01:00
Romuald Conty
2506ee35f6 Fixes invalid example in nfc-scan-device manpage 2013-03-01 17:07:40 +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
Romuald Conty
1e16795341 'make style' and align some #preprocessor directives 2013-02-19 00:43:20 +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
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
Romuald Conty
89b177c58a Merge Alex Lian branch 2013-02-04 10:16:32 +01:00
Philippe Teuwen
4d0ee443d1 Fix crash in nfc-relay-picc -i/-t if fd3 or fd4 is missing 2013-02-01 21:55:29 +01:00
Philippe Teuwen
386e08d8b3 Fix nfc_initiator_select_passive_target() in several utils if tag is missing 2013-02-01 20:52:49 +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
Alex Lian
caa09db5fc Merge remote-tracking branch 'refs/remotes/libnfc/master'
Conflicts:
	contrib/windows.h
	libnfc/CMakeLists.txt
	libnfc/log-printf.c
	utils/CMakeLists.txt
2013-01-31 22:17:33 -05:00
Philippe Teuwen
06bfed11b9 Various typos 2013-01-31 21:58:29 +01:00
Romuald Conty
acdde1088c Renames contrib/win32/nfc_win32.c to contrib/win32/stdlib.c 2013-01-31 16:09:41 +01:00
Romuald Conty
c01b961be0 Fixes CMake under GNU/Linux 2013-01-31 16:04:47 +01:00
Romuald Conty
3fff5985fc Moves Windows conditional code to dedicated files 2013-01-31 15:58:20 +01:00
Alex Lian
87182b5a65 Windows: Fix nfc-scan-device to compile by linking in contrib/nfc_win32.c
Re-factored the executable call with a list that is created, so that its easier to modify per tool.
2013-01-31 15:52:40 +01:00
Alex Lian
9eeaf33b94 Windows: getopt usage in nfc-read-forum-tag3 fixed by referencing correct header 2013-01-31 15:52:39 +01:00
Alex Lian
3c9d9a872c Fix all utils compilation on windows.
- As nfc-utils now references str_nfc_target from the lib itself, so the static lib was not properly referencing the libnfc itself, so the final utility link would fail.
- Simply added the libnfc as a target for the static nfcutils library internal to cmake
2013-01-31 15:52:39 +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
Philippe Teuwen
b675db73be nfc-scan-device: fix option -i 2013-01-29 13:52:53 +01:00
Alex Lian
88fd42a89d Windows: Fix nfc-scan-device to compile by linking in contrib/nfc_win32.c
Re-factored the executable call with a list that is created, so that its easier to modify per tool.
2013-01-27 23:24:03 -05:00
Alex Lian
3c9cfc5036 Windows: getopt usage in nfc-read-forum-tag3 fixed by referencing correct header 2013-01-27 23:22:35 -05:00
Alex Lian
5aab7513cf Fix all utils compilation on windows.
- As nfc-utils now references str_nfc_target from the lib itself, so the static lib was not properly referencing the libnfc itself, so the final utility link would fail.
- Simply added the libnfc as a target for the static nfcutils library internal to cmake
2013-01-27 23:08:22 -05: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
0ac3b26982 nfc-relay-picc: Fix received bytes count 2013-01-22 00:54:47 +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
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
Philippe Teuwen
6c7c0a6e63 ReadMobib: make it compatible with Basic card 2012-11-10 17:11:48 +01:00
Romuald Conty
56f9de23be Autotools now distributes nfc-read-forum-tag3 man page in tarball 2012-10-30 22:59:43 +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
bed1d4ba5e Add -i option to nfc-scan-device to allow intrusive scan and add a manpage for this util. 2012-10-21 14:12:04 +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
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
Philippe Teuwen
2a1558fb32 Deleting manpage present already twice 2012-09-28 09:16:30 +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
82e3416619 minor header clean up 2012-09-17 13:47:43 +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
ce443d50ca Rename abtUid from struct mifare_param_auth into abtAuthUid: this is not the UID while using 7-bytes UID MIFARE Classic tags. 2012-06-03 21:02:54 +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
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
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
Ludovic Rousseau
56e44670a5 Log the device name if the open fails 2012-05-22 09:50:12 +00:00
Ludovic Rousseau
b237213f75 Log an error message if opening a device fails 2012-05-22 09:48:43 +00:00
Philippe Teuwen
969102c1a0 utils/nfc-list: always display the card type when a card is found 2012-05-18 21:54:45 +00:00
Ludovic Rousseau
beab815ecb warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') 2012-05-18 07:40:41 +00:00
Philippe Teuwen
4bfd6ac874 fix disruptancies between tools location in src (utils<>examples) and in Debian packages (libnfc-bin<>libnfc-examples) 2012-05-17 19:22:25 +00:00
Romuald Conty
cfd95bae2c Fix shadowed declaration warnings 2012-05-17 01:18:24 +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
Philippe Teuwen
028db71d79 utils/nfc-emulate-forum-tag4: add support for v2.0 of the spec 2012-05-14 22:13:19 +00:00
Philippe Teuwen
7597055f26 fix typos 2012-05-14 19:44:03 +00:00
Romain Tartiere
e9b2f5729c Fix a bunch of warnings. 2012-05-14 13:47:31 +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
a2b022609f Fix some spelling mistakes
Closes Issue #196
2012-05-13 13:10:15 +00:00
Ludovic Rousseau
02cf0b3d60 Fix compiler warning
nfc-list.c:64: warning: no previous prototype for ‘print_usage’
2012-05-13 13:03:47 +00:00
Ludovic Rousseau
2e075df1a9 Fix compiler warnings
nfc-emulate-forum-tag4.c:117: warning: no previous prototype for ‘nfcforum_tag4_io’
nfc-emulate-forum-tag4.c:231: warning: no previous prototype for ‘stop_emulation’
nfc-emulate-forum-tag4.c:241: warning: no previous prototype for ‘ndef_message_load’
nfc-emulate-forum-tag4.c:269: warning: no previous prototype for ‘ndef_message_save’
nfc-emulate-forum-tag4.c:285: warning: no previous prototype for ‘usage’
2012-05-13 12:57:49 +00:00
Ludovic Rousseau
7f9ba48018 Fix compiler warnings
nfc-read-forum-tag3.c:63: warning: no previous prototype for ‘print_usage’
nfc-read-forum-tag3.c:70: warning: no previous prototype for ‘stop_select’
nfc-read-forum-tag3.c:80: warning: no previous prototype for ‘build_felica_frame’
nfc-read-forum-tag3.c:91: warning: no previous prototype for ‘nfc_forum_tag_type3_check’
2012-05-13 12:56:41 +00:00
Ludovic Rousseau
0926f8a7c9 Fix compiler warning
nfc-probe.c:64: warning: no previous prototype for ‘print_usage’
2012-05-13 12:55:26 +00:00
Ludovic Rousseau
b5e688e74a Fix compiler warnings:
nfc-relay-picc.c:76: warning: no previous prototype for ‘intr_hdlr’
nfc-relay-picc.c:85: warning: no previous prototype for ‘print_usage’
nfc-relay-picc.c:96: warning: no previous prototype for ‘print_hex_fd4’
nfc-relay-picc.c:118: warning: no previous prototype for ‘scan_hex_fd3’
nfc-relay-picc.c: In function ‘main’:
nfc-relay-picc.c:190: warning: function declaration isn’t a prototype
2012-05-13 12:53:34 +00:00
Philippe Teuwen
896fa54ece nfc-utils: some changes on the newly introduced fingerprinting method, see log for details
* avoid hardcoded list sizes in #define
* merge card_link data into const_ca
* indexes start at 0, not 1, and use -1 as marker rather than 0
* fix bug in DESFire ATQA
* remove CL1 entries for double size UIDs, in practice we'll always get the latest SAK of the cascade
* remove CL2 tags, cf previous point
* compact const_cs considering the previous points
* keep const_cs strings only where they are informative
* premature halt of inner loop if there is no more SAK index to treat
* change atqa & sak types to uint16_t & uint8_t

* skip redundant matches in the old fingerprinting method
2012-05-02 23:48:06 +00:00
Philippe Teuwen
b10de698dd nfc-utils: new fingerprinting method closer to AN10833, patch proposed by Balazs Bucsay (thanks!) 2012-05-02 23:47:57 +00:00
Philippe Teuwen
93157dd30d nfc-utils.h: rename function oddparity_bytes_ts() to be coherent with nfc-utils.c 2012-05-02 21:18:46 +00:00
Philippe Teuwen
1cf9154296 nfc-utils: fix bug (remaining calls to old OddParity table) 2012-05-02 21:18:31 +00:00
Philippe Teuwen
b84e3d0f20 nfc-utils: smaller oddparity code 2012-05-02 10:02:56 +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
05789e5a68 Fix a couple warnings. 2012-03-01 13:33:13 +00:00
Romuald Conty
3eba0e9b54 Prepare libnfc 1.6.0-rc1 2012-03-01 12:00:23 +00:00
Romuald Conty
75e776ffd0 utils/nfc-mfclassic: remove non-conscistent "extract payload" option in nfc-mfclassic and use MIFARE instead of Mifare typo (Thanks to Thomas Hood) 2012-02-15 13:41:38 +00:00
Audrey Diacre
983d4932f3 documentation: add utils and examples and hide internal files. 2012-01-31 14:28:45 +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
Audrey Diacre
26245add73 Merge libnfc-1.5-new-api branch to trunk (r1168:1303). 2012-01-25 09:56:05 +00:00
Audrey Diacre
5a475cf074 add some whitespaces 2012-01-20 09:17:38 +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
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
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
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
Romain Tartiere
2d393bff91 Make these function accept no argument (instead of any). 2012-01-15 11:06:24 +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
Romuald Conty
7df3bb5aeb various minor fixes/enhancements 2012-01-06 13:08:16 +00:00
Romuald Conty
48e92149e4 drop log4c support 2012-01-06 13:05:10 +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
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
5a1f0c2115 check result of nfc_initiator_init() function in examples/ and utils/ 2012-01-05 10:33:50 +00:00
Romuald Conty
125553c72e verbose option back for nfc-list, and newly implemented in nfc-poll 2012-01-04 21:29:43 +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
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
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
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
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
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
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