Commit graph

21 commits

Author SHA1 Message Date
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
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
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
5e9e177319 Change examples license for the sake of consistency: LGPL covers library, re-usable examples code is now under BSD license. 2010-11-17 14:27:11 +00:00
Romuald Conty
6df612a364 Errors use #define instead of constant values.
Update Issue 84
Current 'ident' command breaks commit-concerned lines.
2010-11-15 18:50:53 +00:00
Philippe Teuwen
5a6bb0bbc5 examples: mifare.c fix potential bug when used in non-EasyFraming environment 2010-10-20 18:11:06 +00:00
Romuald Conty
c34be50ef1 For the sake of consistency, rename all szRxLen to szRx and szTxLen to szTx 2010-10-12 14:56:42 +00:00
Romuald Conty
18cc86a613 Indent whole code using make indent. (Fixes issue 84). 2010-09-07 17:51:03 +00:00
Romain Tartiere
81a1eb2c6c Don't display authentication errors in examples. 2010-09-07 13:34:48 +00:00
Romain Tartiere
a5676ecd94 Remove nfc_initiator_transceive_dep_bytes() and introduce NDO_EASY_FRAMING option.
Always use nfc_initiator_transceive_bytes(). If you where using advanced
features and already relying on nfc_initiator_transceive_bytes(), then your
code has to be updated to unset the NDO_EASY_FRAMING option.  See an example of
such a change in the libfreefare's repository:
http://code.google.com/p/nfc-tools/source/detail?r=566

Updates issue 106
Status: Feedback
Romuald: I am not sure about the option enum values.  I took 0x02 thinking it
would not hurt but am not really sure about that because I can see many 'holes'
in the sequence.
2010-09-03 16:13:36 +00:00
Romain Tartiere
eb90b92c12 Detect errors in examples. 2010-08-18 17:22:13 +00:00
Romain Tartiere
769eef20f7 Merge r520-546 from trunk. 2010-08-18 14:32:01 +00:00
Romuald Conty
6354e94657 mifare function improvement: it now failed when read command does not return a whole block (16 bytes). 2010-08-18 13:53:34 +00:00
Romain Tartiere
655fdb569a Fix nfc_initiator_mifare_cmd() in examples.
In r509, a direct call to pn53x_transceive() was changed into a call to nfc_initiator_transceive_dep_bytes() which is part of the public API. The command to send was updated accordingly, but the code that extracts the response have not.

Update issue 98
This should fix the problem: because the response was not the expected length, the actual card data was not copied to the buffer, so it was always the same 16 uninitialized bytes that where returned for any block.

PR:		Issue 98
Submitted by:	zamby.ing
Pointy hat to:  me
2010-08-13 19:53:13 +00:00
Romain Tartiere
4a5347e5ae Merge r512 from trunk. 2010-08-10 21:41:42 +00:00
Romain Tartiere
3ec0b9376c Make Mifare example use only the libnfc public API. 2010-08-10 21:36:57 +00:00
Romain Tartiere
dfb82f8893 Merge r499-510 from trunk. 2010-08-10 21:14:13 +00:00
Romain Tartiere
eece496351 Use nfc_initiator_transceive_dep_bytes() instead of pn53x_transceive() in example. 2010-08-10 21:00:08 +00:00
Romain Tartiere
9984e1bdcb Start of work on error handling. 2010-07-26 12:41:46 +00:00
Romuald Conty
f7c31885f5 Move all Mifare related code from libnfc API to examples: NFC is capable of Mifare, but Mifare is not NFC. 2010-06-15 15:33:22 +00:00