Commit graph

51 commits

Author SHA1 Message Date
WangYi
e21fab3685 Example and util compile fine. 2020-07-05 00:55:23 +02:00
Philippe Teuwen
db4fae9c2c Remove unreachable statements
As seen with clang -Wunreachable-code
2014-03-04 01:39:12 +01:00
Philippe Teuwen
a7649da2b0 nfc-read-forum-tag3: add -q and document -o - 2014-02-18 00:22:24 +01:00
Philippe Teuwen
2aa4b99b7b nfc-read-forum-tag3: full parsing of NDEF Attribute Block 2014-02-17 23:57:59 +01:00
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
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
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
bb5b712a74 Adding link to AUTHORS in the copyright headers 2013-07-17 13:57:56 +02:00
Philippe Teuwen
bf164220ee Unify copyright notices & update authors lists 2013-03-10 16:15:23 +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
Romuald Conty
1e16795341 'make style' and align some #preprocessor directives 2013-02-19 00:43:20 +01:00
Romuald Conty
89b177c58a Merge Alex Lian branch 2013-02-04 10:16:32 +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
Romuald Conty
3fff5985fc Moves Windows conditional code to dedicated files 2013-01-31 15:58:20 +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
3c9cfc5036 Windows: getopt usage in nfc-read-forum-tag3 fixed by referencing correct header 2013-01-27 23:22:35 -05: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
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
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
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
Romuald Conty
cfd95bae2c Fix shadowed declaration warnings 2012-05-17 01:18:24 +00:00
Philippe Teuwen
7597055f26 fix typos 2012-05-14 19:44:03 +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
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
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
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
Audrey Diacre
5a1f0c2115 check result of nfc_initiator_init() function in examples/ and utils/ 2012-01-05 10:33:50 +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
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
a615d969fd nfc_properties replace now nfc_options and nfc_configure is replaced by nfc_device_set_property_bool which returns error code. 2011-12-14 16:01:00 +00:00
Audrey Diacre
52bc5853d8 Remove whitespace after star symbol for pointers 2011-11-25 15:21:10 +00:00
Audrey Diacre
5c7454a2f7 Timeout is now integer. 2011-11-25 11:37:30 +00:00
Audrey Diacre
784a2f86a2 Change byte_t type to uint8_t (Fixes Issue 147) 2011-11-24 10:54:42 +00:00
Audrey Diacre
c718fafee7 Massive code clean up: (Fixes Issue 161)
- Remove typedef from internal structs
- Remove _t suffix from types
- Fix tests using connstrings
2011-11-23 15:55:40 +00:00
Audrey Diacre
54b6827971 add missing manpages. 2011-11-22 15:23:18 +00:00