Commit graph

375 commits

Author SHA1 Message Date
Audrey Diacre
b864215d63 pn53x_initiator_poll_target() function returns now polled targets count on success. 2011-12-22 11:16:27 +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
0f5cc5683d nfc_initiator_poll_target() function returns now libnfc error code. 2011-12-20 15:46:35 +00:00
Audrey Diacre
9c5ec3c4e1 the following functions now return libnfc error code:
_pn53x_write_register()
_pn53x_WriteRegister()
_pn53x_transceive()
_pn53x_SAMConfiguration()
_pn53x_PowerDown()
 _pn53x_InListPassiveTarget()
_pn53x_InDeselect()
_pn53x_InRelease()
_pn53x_RFConfiguration__*
2011-12-20 11:25:33 +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
Audrey Diacre
145cc4b2ad nfc_initiator_transceive_bytesfunction now returns libnfc error code on failure and received bytes count on success. 2011-12-19 14:37:22 +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
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
Romuald Conty
90c05c7d13 Add a printf-based logging when log4c is not available (I experiemented some bugs using log4c) 2011-12-07 14:59:40 +00:00
Romuald Conty
c286eec920 DEP enhancements:
- Add timeout on InJumpForDEP (pn53x) and initiator_select_dep (libnfc API)
- test_dep now works again (except 424Kbps)
- Fix ndi.ndm feeling when select a DEP target
Important: test_dep does not work on PN53x_USB devices after running previous tests
2011-12-06 10:05:35 +00:00
Audrey Diacre
3b657ee547 quick_start_example1 is now compiled when running make check or distcheck (Fixes Issue 178) 2011-11-30 11:21:01 +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
ce846931bc Move nfc-emulate-forum-tag2 from utils to examples. 2011-11-24 10:27:02 +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
Romuald Conty
6752951084 Refresh quick_start_example1.c according to new API 2011-10-18 16:07:13 +00:00
Romuald Conty
55daa29a7c Allow to connect to a device using a connection string:
- Provide a nfc_get_default_device() that allow to grab the connstring stored
   in LIBNFC_DEFAULT_DEVICE environnement variable or returns the first
   available device if not set;
 - nfc_connect(NULL) now takes the default device (see
   nfc_get_default_device());
 - Removes nfc_driver_desc_t from public types
 - Defines nfc_connstring as char[1024]
 - examples/*: use nfc_connstring
 - examples/nfc-poll: now uses only the default device (instead of all devices
   availables)
 - Removes parse_args() from nfc-utils.[hc]
2011-10-17 13:03:56 +00:00
Romuald Conty
dccfd65c80 Add software polling for non-PN532 equipped device (Fixes Issue 136) 2011-10-03 11:19:08 +00:00
Romuald Conty
b2666dea15 windows port improved:
- PCSC headers/libs are not a requierement sif you dont select ACR122 driver
 - uart_win32 implementation now handles timeouts
2011-10-01 14:50:53 +00:00
Romuald Conty
d286a3c4b7 make distcheck OK 2011-10-01 13:29:18 +00:00
Romuald Conty
03a6f5e29c Update examples and utils manpages.(Fixes Issue 159) 2011-10-01 12:26:11 +00:00
Romuald Conty
8c7b61eaba move some examples to utils/ since they are not examples anymore :) (Fixes Issue 164) 2011-09-30 11:33:31 +00:00
Romuald Conty
8f7834c625 drivers/arygon,pn532_uart,pn53x_usb: all PN53x commands are now cancelable 2011-09-29 14:53:52 +00:00
Romain Tartiere
481fb4943f - Add timeout capablities to nfc_initiator_transceive_bytes(), nfc_target_send_bytes() and nfc_target_receive_bytes();
- Bump version to 1.5.1.
2011-09-22 13:03:47 +00:00
Romain Tartiere
f6fc637d77 Soooo fragile :-)))) 2011-09-12 17:05:00 +00:00
Romuald Conty
580768a489 pn53x-diagnose: uses config.h if present 2011-09-12 14:46:58 +00:00
Adam Laurie
24881bd32d Fix accidental overwrite of Mifare special trailer block in unlocked read 2011-09-07 09:41:04 +00:00
Adam Laurie
028f310576 Unlocked read and format/wipe of special Mifare cards 2011-09-06 21:17:38 +00:00
Adam Laurie
1a07613ce2 -h usage explicitly state Chinese clone cards required for block 0 write 2011-09-06 11:00:01 +00:00
Adam Laurie
8d6f0d7321 Add man page for nfc-mfsetuid 2011-09-06 09:47:50 +00:00
Adam Laurie
e401f4ec4e Write special Mifare 1K cards, including Block 0 / UID 2011-09-05 14:40:56 +00:00
Romain Tartiere
752c247761 Add cast to fix build on 32bit systems. 2011-07-05 08:00:11 +00:00
Romuald Conty
3a1cb72681 examples/nfc-emulate-forum-tag2: add new example to emulate a NFC Forum Tag Type 2 2011-06-30 14:59:47 +00:00
Romuald Conty
10d9e30615 examples/nfc-emulate-forum-tag4: add document references. 2011-06-30 14:24:47 +00:00
Romuald Conty
eec2794d2d drivers/pn532_uart,arygon: Make valgrind happy with UART-based drivers 2011-06-28 13:16:44 +00:00
Romuald Conty
e6051ceca4 chip/pn53x: clean up SAMConfiguration usage. 2011-06-27 17:12:25 +00:00
Romuald Conty
0b42cbfb8f examples/nfc-emulate-forum-tag4: this example now fails with ENOTSUPP when used with a non-PN532 chip. 2011-06-27 09:14:19 +00:00
Romuald Conty
7b6baafd1d example/nfc-relay-picc: Move windows related code into contrib/win32 2011-06-27 08:56:38 +00:00
Romain Tartiere
4259f595ec Initialize DEP mode (nt.nti.ndi.ndm) to NDM_UNDEFINED. 2011-06-26 14:43:11 +00:00
Philippe Teuwen
80a5ad1fd6 More attempt to support Sony S360 reader
Initialisation of RC-S360 in mode 0
Better generic nfc-list, does not rely only on DeSelect to avoid duplicates
Restore SetParameters for RC-S360
Handle Diagnose communication test properly

Tested:
    - nfc-list          => ok except for B' & 3B
    - nfc-anticol       => fails to send raw frames before select
    - nfc-mfultralight  => ok
    - nfc-mfclassic     => ok
    - pn53x-tamashell   => ok
    - pn53x-diagnose    => ok
    - nfc-dep-initiator => ok
    - nfc-dep-target    => fails in InitAsTarget
    - nfc-emulate-*     => fails in InitAsTarget

Commands momentarily disabled for RC-S330:
    - InDeselect
    - InRelease
    - select_passive_target for B'& 3B
2011-06-07 20:36:20 +00:00
Philippe Teuwen
cbbda20018 nfc-anticol: -f option to force RATS 2011-06-07 18:47:20 +00:00
Philippe Teuwen
f4c3d9d4ed nfc-mfclassic: handle 7-byte UID cards & MFC Mini 2011-05-26 22:49:45 +00:00
Philippe Teuwen
96538d052b Extend max length for firmware description & fix typo 2011-05-25 19:53:45 +00:00
Romuald Conty
78ce62e7b6 Fix ISO/IEC 14443-4 hardware emulation.
NDO_AUTO_ISO14443_4 is now set to _true_ by default with nfc_target_init();
nfc_emulate_target() now fails (return _false_) when emulator->state_machine->io() failed;
Initialize nfc_device_t variables to _false_ in order to send correctly (see notes in nfc-device.c);
nfc_emulate_forum_tag4 prints error when nfc_emulate_target() failed.
2011-05-24 17:10:13 +00:00
Romain Tartiere
6d66866268 Silent down the compiler. 2011-05-18 18:53:00 +00:00
Philippe Teuwen
ab54a37678 list_targets support for ASK CTS512B (no anticol support yet) 2011-05-11 23:00:54 +00:00
Philippe Teuwen
21dfe81d0b Some optimisations in initialisation of registers 2011-05-10 23:44:27 +00:00
Philippe Teuwen
a2a93e7224 nfc-relay: fix UID 2011-05-09 08:51:07 +00:00
Philippe Teuwen
d834860965 Add partial support (list) for ISO14443B-3 ST SRx & ASK CTx cards 2011-05-06 19:11:03 +00:00
Romuald Conty
cd6946e751 Add ISO/IEC 14443 B' aka Type B' modulation partial support 2011-05-06 14:14:06 +00:00
Romuald Conty
651d88fd15 examples/nfc-anticol: now use nfc_abort_command() 2011-05-05 14:24:27 +00:00
Philippe Teuwen
eb86efa341 oops typo 2011-05-05 10:14:21 +00:00
Philippe Teuwen
4124dc662d Cleanup of initializations 2011-05-05 10:12:26 +00:00
Romuald Conty
72422e819b examples/nfc-dep-*: disconnect from NFC device on error. 2011-05-05 09:17:38 +00:00
Romuald Conty
9231f47123 examples/pn53x-tamashell-scripts: minor enhancements. 2011-05-03 15:10:51 +00:00
Philippe Teuwen
fc48b7eb89 mfc: removing alpha feature to prepare release 2011-04-28 14:53:44 +00:00
Romuald Conty
59c4e69feb examples/pn53x-diagnose: fix memcmp strings coverage 2011-04-28 13:35:05 +00:00
Romuald Conty
7c274029e7 examples/pn53x-diagnose: fix PN53x commands and report internal error using nfc_perror() 2011-04-28 13:26:47 +00:00
Romuald Conty
6974fb4562 examples/nfc-dep-*: add signal handler to use the abort mecanism. 2011-04-27 15:10:14 +00:00
Romuald Conty
09b18bf6b8 example/nfc-emulate-forum-tag4: add some notes about my experiments. 2011-04-22 17:32:07 +00:00
Romuald Conty
762f6fb1f3 Windows: install libusb into examples directory using "Bundle" feature from CMake (Thanks to Glenn Ergeerts) 2011-04-20 13:18:38 +00:00
Philippe Teuwen
8a77b68b10 mfc fingerprinting: fixing data 2011-04-12 07:45:41 +00:00
Philippe Teuwen
b89eb58257 mfc fingerprinting: more data 2011-04-11 15:23:38 +00:00
Philippe Teuwen
a72e61acbb change exec mode of scripts 2011-04-09 20:01:08 +00:00
Romuald Conty
f65c601dd4 pn53x-tamashell: add a script to read Navigo card. 2011-04-09 14:51:58 +00:00
Romuald Conty
6a8e4b9c4d pn53x-tamashell: add a script to read Mobib card. 2011-04-09 14:51:11 +00:00
Philippe Teuwen
610e5c9513 tamashell example for LoGO LEDs 2011-04-08 19:50:19 +00:00
Philippe Teuwen
9a101943b8 tamashell: now pause in milliseconds 2011-04-08 19:50:09 +00:00
Philippe Teuwen
174c916961 nfc-mfclassic: add some more fingerprints 2011-04-08 18:33:48 +00:00
Philippe Teuwen
fae451d236 mfclassic fingerprinting 2011-04-05 13:30:49 +00:00
Philippe Teuwen
8d70321d80 nfc-list: fix grammatical typo if multiple tags 2011-04-04 19:21:27 +00:00
Romuald Conty
5db8be908b Windows support contribution:
- Move CMake modules from cmake_modules/ to cmake/modules/
 - CMake now use cmake/config_windows.h.cmake to create config.h on Windows platform
 - contrib/windows.h header is automagically included by config.h
 - Put missing NFC_EXPORT macro on front of emulation API
 - nfc-mfclassic and nfc-mfcultralight examples are now compiled under Windows
Many thanks to Glenn Ergeerts which provide the initial patch.
2011-03-31 13:38:49 +00:00
Romain Tartiere
53960c4643 Split user_data and state_machine_data. 2011-03-13 14:40:36 +00:00
Romain Tartiere
0f0fa2b14f Move nfc_emulate_target() from examples to the library. 2011-03-13 14:31:06 +00:00
Romuald Conty
4dad8c2307 Minor manpage improvements. 2011-03-12 16:02:11 +00:00
Romuald Conty
ef7e4c126e Update nfc-emulate-forum-tag4 manpage 2011-03-12 15:56:57 +00:00
Romain Tartiere
03913708db Add write support to nfc-emulate-forum-tag4. 2011-03-12 15:01:04 +00:00
Romain Tartiere
7b95a8a487 Load NDEF message from file if a valid filename is provided. 2011-03-11 19:01:28 +00:00
Philippe Teuwen
35e9696ada pn53x-tamashell properly properly fixed 2011-03-10 14:43:59 +00:00
Philippe Teuwen
5bc113792b pn53x-tamashell properly fixed 2011-03-10 14:38:50 +00:00
Romuald Conty
4d458ec3d6 Attempt to fix Windows port. 2011-03-09 18:41:57 +00:00
Romain Tartiere
e0dead1d7f Rewrite nfc-emulate-forum-tag4 example logic. 2011-03-09 18:17:05 +00:00
Philippe Teuwen
3dc8d6c97c pn53x-sam: fixed with new API 2011-03-09 14:49:38 +00:00
Philippe Teuwen
351f08a54b pn53x-tamashell: fixed with new API 2011-03-09 14:45:22 +00:00
Romain Tartiere
2cca743e07 Return an error when a command is aborted;
Fix aborting with UART devices.
2011-03-09 14:10:40 +00:00
Romain Tartiere
8d27768097 Implement abort in the nfc-emulate-forum-tag4 example. 2011-03-09 13:31:12 +00:00
Romuald Conty
c457c45f55 examples/nfc-emulate-tag: minor comments improvements. 2011-03-06 18:48:25 +00:00
Romuald Conty
f1e69a7658 silent warnings in examples/. 2011-03-05 09:07:43 +00:00
Romuald Conty
bd04a1ab9a oops: add missing lines in nfc-utils.h. 2011-03-05 08:55:53 +00:00
Romuald Conty
dba06a555e remove nfc-message.h usage from examples. 2011-03-05 08:53:46 +00:00
Romain Tartiere
76a1744d37 Lint returns. 2011-03-05 01:45:49 +00:00
Romain Tartiere
4b6060aeeb Enable aborting blocking commands (e.g. TgInitAsTarget) and refactor
*_check_communication() as pn53x_check_communication().
2011-03-04 19:59:49 +00:00
Romuald Conty
7ec1080e16 Remove a dummy argument in pn53x_transceive(). 2011-03-02 15:32:52 +00:00
Romuald Conty
4b6ba0aa3c Always set the size of Rx buffer (prevent from overflow) 2011-03-02 15:02:30 +00:00
Romuald Conty
5af845cdfc Broke whole the libnfc :-)
use a new way to handle drivers
use absolute include path instead of relative ones
move some nfc_device_t members in a better place
nfc_device_t now embeddeds driver data and chip data pointers (useful to be more generic)
use more readable variables instead of strange coding convention
move PRINT_HEX macro into nfc-internal.h
silent warnings with more strict CFLAGS
chips/pn53x: use the powerful C99 writing to construct PN53x commands
chips/pn53x: remove almost all memcpy()
chips/pn53x: WriteRegister, ReadRegister and SetParameters command wrappers are correctly named
chips/pn53x: introduce chip state (SLEEP, NORMAL or EXECUTE)
chips/pn53x: add SAMConfiguration command wrapper (need to be improved)
chips/pn53x: remove almost all const arrays
chips/pn53x: use human readable defines for commands instead of hex values
chips/pn53x: in debug mode, the PN53x command is shown in human-readable string, awesome isn't it? ;-)
drivers: split transceive() into send() and receive() to be able to handle more cases (differed replies, abort commands, etc) later
drivers: use a const structure of functions instead of -dirty- callbacks array
drivers/pn532_uart: major improvement of UART handling
drivers/pn532_uart: check PN53x frames when received
buses/uart: receive() is now based on expected bytes instead of calculated timeouts..
buses/uart: use a smart way to determine available ports on POSIX systems (tested on Linux and FreeBSD)
2011-03-02 15:00:44 +00:00
Romuald Conty
979fc1b5f5 examples: fix broken internal pn53x API. 2011-03-01 11:26:00 +00:00