Or maybe I would rather have removed the const and called strdup(3)?
New issue
Summary: Sync code and comments
Owner: rconty@il4p.fr
Status: New
Romuald, can you please review this changeset and fix the code if I corrected
the wrong way (i.e. the comment was Okay and the code bogus while I fixed the
comment thinking the cod was right).
Thanks!
New issue
Summary: Make sending ACK on message transmission skipable.
Owner: rtartiere@il4p.fr
Cc: rtartiere@il4p.fr
Status: New
I guess that for performance reasons, some advance users would prefer to skip
sending the non-mandatory ACK on data transmission. They may also perform a
quicker check of the ACK returned by the chip after sending the command and
before receiving the response (not sure about this one).
It will probably be a ./configure option disabled by default that allows some "shortcuts" to perform NFC hacking.
It was obviously an April joke: iErrorCode which was renamed iPICCError is
indeed a PCD Error, so I renamed it to iLastError since communications errors are
also to handle at the device driver level (read chip level), although I guess
that some errors would be common to distinct devices.
PICC error are irrelevant because they can either be transmission error
detection (in which case the libnfc should retry the transmission) or
application-level errors the libnfc cannot be aware of.
- Rename the nfc_device_t's struct iErrorCode member to iPICCError (We are
likely to have both PICC and PCD errors fields to avoid unneeded complexity
at some point);
- Make the PN53x error descriptions static;
- Enhance some comments here and there.
Avoid redundant code in PN53x usb and uart drivers. Since it makes sense to
report errors at the nfc_device_t level, pass it directly to
pn53x_transceive().
Programs using the libnfc MAY use pn53x_transceive() to communicate with a NFC
device, and SHALL not use anymore pnd->pdc->transceive(). Code in the library
itself SHOULD avoid calling pnd->pdc->transceive(), so such construct have been
updated accordingly.
New issue
Summary: pn53x_transceive() workaround reverences in examples/nfc-poll.c comments
Status: New
Owner: rconty@il4p.fr
Cc: rtartiere@il4p.fr
The source code of nfc-poll has references to no using pn53x_transceive() for
the status-byte workaround reason in a comment. However this function is not
called in the code. While I guess that's some comment that should have been
removed and have never reached the svn repo, I prefer to be sure that it can be
removed. The comments where introduced at the same time of the file, at r353.
ISO C forbids empty source files. Instead of compiling possibly empty source
files depending on the compiler parameters, only compile required files to
build the library as requested at the ./configure stage.
Windows users (and more precisely non-autotools users), you may have to update
whatever you use to build the libnfc to fit your needs. The Makefile shipped
in the windows directory compiles all drivers as it is written so you should
not notice any difference, but if you don't use _that_ makefile, then you will
have to do some adjustment.
For now, keep the defines in CFLAGS just in case. Planned for removal in circa
one week.
While here, pet `./configure` output (--help format and summary).
I am sure we don't have /dev/ttyUSB*, and since I use /dev/cuau0 with a
cross-over cable to connect 2 machines and have a serial console, I guess
"/dev/cuau" is the SERIAL_STRING that's expected to work for me. A quick test
would be cool however, but I don't own a serial NFC device.
Within the ongoing effort to improve the NFC devices abstraction, and now that
pn53x_transceive() does not fail when it reads a response that has no
status-code, do not call directly pnd->pdc->transceive() from nfc.c. In a
mid-term future this will be changed again, and calling pn53x_transceive() from
nfc.c will be forbiden, in favor of colling some pnd->transceive() function,
but that's another part of the story.
Of course, it changes the API one more and it's not going to be the last time
in this branch.
New issue
Summary: Provide a target listing function
Labels: Milestone-1.4.x
Libnfc lacks of target listing function. Actually, applications or libraries based on libnfc have to wrote their own listing function which can provide side effect if two or more of theses libraries are used together in the same application. Plus, some kind of problem could appears during listing multiples targets (i.e. collisions) and this problem should be solved in libnfc (i.e. using NFC chip capabilities), not in applications based on libnfc.
New issue
Summary: Catch unsupported command before sending to chip
Labels: Milestone-1.6.x
Actually, libnfc support PN531, PN532 and PN533 NFC chips, but the devices does not the same features. e.g. PN531 does not support ISO14443B modulation.
It should great to catch theses unsuported commands before sending to chip in order to prevent a chip error.
- New API functions: nfc_strerror(), nfc_strerror_r() and nfc_perror();
- Drivers now have a reference to chips callback methods;
- Rename -pn53x_err2string to pn53x_strerror and add it to pn53x_callbacks_list.
As the documentation states, and as reported in isssue 81 (fixed in r421),
usb_reset()'s argument is invalid after the call and so usb_close(3) must be
called before usb_reset(3).
The doc says LCS (aka abtTx[4]) must be set so that the lower byte of LCS+LEN
(aka abtTx[3]) is 0x00. This has not to be related to the USB buffer size, so
that we can adjust it without breaking down the libnfc.