Giter VIP home page Giter VIP logo

libnfc's Introduction

*-
* Free/Libre Near Field Communication (NFC) library
*
* Libnfc historical contributors:
* Copyright (C) 2009      Roel Verdult
* Copyright (C) 2009-2015 Romuald Conty
* Copyright (C) 2010-2012 Romain Tartière
* Copyright (C) 2010-2013 Philippe Teuwen
* Copyright (C) 2012-2013 Ludovic Rousseau
* Additional contributors:
* See AUTHORS file
-*

General Information

libnfc is a library which allows userspace application access to NFC devices.

The official web site is: http://www.nfc-tools.org/

The official forum site is: http://www.libnfc.org/community/

The official development site is: https://github.com/nfc-tools/libnfc

Important note: this file covers POSIX systems, for Windows please read README-Windows.md

Requirements

Some NFC drivers depend on third party software:

  • pcsc:

    • Support build with pcsc driver, which can be using all compatible readers, Feitian R502 and bR500 already passed the test.

The regression test suite depends on the cutter framework: http://cutter.sf.net

Building

Note: If working directly from a git clone of the repository, some of the files need to be generated first. To do this run autoreconf -vis

Alternatively use a .tar.bz2 version of a packaged release (which already contains ./configure): https://github.com/nfc-tools/libnfc/releases/

The build should be as simple as running these commands:

./configure
make

To build with specific driver(s), see option --with-drivers=... detailed in ./configure --help.

Installation

make install

You may need to grant permissions to your user to drive your device. Under GNU/Linux systems, if you use udev, you could use the provided udev rules. e.g. under Debian, Ubuntu, etc.

sudo cp contrib/udev/93-pn53x.rules /lib/udev/rules.d/

Under FreeBSD, if you use devd, there is also a rules file: contrib/devd/pn53x.conf.

Configuration

In order to change the default behavior of the library, the libnfc uses a configuration file located in sysconfdir (as provided to ./configure).

A sample commented file is available in sources: libnfc.conf.sample

If you have compiled using:

./configure --prefix=/usr --sysconfdir=/etc

you can make configuration directory and copy the sample file:

sudo mkdir /etc/nfc
sudo cp libnfc.conf.sample /etc/nfc/libnfc.conf

To configure multiple devices, you can either modify libnfc.conf or create a file per device in a nfc/devices.d directory:

sudo mkdir -p /etc/nfc/devices.d
printf 'name = "My first device"\nconnstring = "pn532_uart:/dev/ttyACM0"\n' | sudo tee /etc/nfc/devices.d/first.conf
printf 'name = "My second device"\nconnstring = "pn532_uart:/dev/ttyACM1"\n' | sudo tee /etc/nfc/devices.d/second.conf

Environment Variables

You can override certain configuration options at runtime using the following environment variables:

  • LIBNFC_DEFAULT_DEVICE=<connstring>: LIBNFC_DEFAULT_DEVICE=pn532_uart:/dev/ttyACM0 will use pn532 on /dev/ttyACM0 as default device
  • LIBNFC_DEVICE=<connstring> will ignore all devices in the config files and use only the one defined in the variable
  • LIBNFC_AUTO_SCAN=<true|false> overrides allow_autoscan option in the config file
  • LIBNFC_INTRUSIVE_SCAN=<true|false> overrides allow_intrusive_scan option in the config file
  • LIBNFC_LOG_LEVEL=<0|1|2|3> overrides log_level option in the config file

To obtain the connstring of a recognized device, you can use nfc-scan-device: LIBNFC_AUTO_SCAN=true nfc-scan-device will show the names & connstrings of all found devices.

How to report bugs

To report a bug, visit https://github.com/nfc-tools/libnfc/issues and fill out a bug report form.

If you have questions, remarks, we encourage you to post this in the developers community: http://www.libnfc.org/community

Please make sure to include:

  • The version of libnfc

  • Information about your system. For instance:

    • What operating system and version
    • For Linux, what version of the C library

    And anything else you think is relevant.

  • A trace with debug activated.

    Reproduce the bug with debug, e.g. if it was:

      $ nfc-list -v
    

    run it as:

      $ LIBNFC_LOG_LEVEL=3 nfc-list -v
    
  • How to reproduce the bug.

    Please include a short test program that exhibits the behavior.

    As a last resort, you can also provide a pointer to a larger piece

    of software that can be downloaded.

  • If the bug was a crash, the exact text that was printed out

    when the crash occured.

  • Further information such as stack traces may be useful, but

    is not necessary.

Patches

Patches can be posted to https://github.com/nfc-tools/libnfc/issues

If the patch fixes a bug, it is usually a good idea to include all the information described in "How to Report Bugs".

Troubleshooting

Touchatag/ACR122:

If your Touchatag or ACR122 device fails being detected by libnfc, make sure that PCSC-lite daemon (pcscd) is installed and is running.

If your Touchatag or ACR122 device fails being detected by PCSC-lite daemon (pcsc_scan doesn't see anything) then try removing the bogus firmware detection of libccid: edit libccid_Info.plist configuration file (usually /etc/libccid_Info.plist) and locate <key>ifdDriverOptions</key>, turn <string>0x0000</string> value into 0x0004 to allow bogus devices and restart pcscd daemon.

ACR122:

Using an ACR122 device with libnfc and without tag (e.g. to use NFCIP modes or card emulation) needs yet another PCSC-lite tweak: You need to allow usage of CCID Exchange command. To do this, edit libccid_Info.plist configuration file (usually /etc/libccid_Info.plist) and locate <key>ifdDriverOptions</key>, turn <string>0x0000</string> value into 0x0001 to allow CCID exchange or 0x0005 to allow CCID exchange and bogus devices (cf previous remark) and restart pcscd daemon.

Warning: if you use ACS CCID drivers (acsccid), configuration file is located in something like: /usr/lib/pcsc/drivers/ifd-acsccid.bundle/Contents/Info.plist

SCL3711:

Libnfc cannot be used concurrently with the PCSC proprietary driver of SCL3711. Two possible solutions:

  • Either you don't install SCL3711 driver at all
  • Or you stop the PCSC daemon when you want to use libnfc-based tools

PN533 USB device on Linux >= 3.1:

Since Linux kernel version 3.1, a few kernel-modules must not be loaded in order to use libnfc : "nfc", "pn533" and "pn533_usb". To prevent kernel from loading automatically these modules, you can blacklist them in a modprobe conf file. This file is provided within libnfc archive:

sudo cp contrib/linux/blacklist-libnfc.conf /etc/modprobe.d/blacklist-libnfc.conf

FEITIAN bR500 and R502:

Libnfc can work with PCSC proprietary driver of bR500 and R502, which is already available on most Linux setups. To activate the PCSC support: ./configure --with-drivers=pcsc. Readers known to work:

  • Feitian bR500
  • Feitian R502 Dual interface reader
  • Feitian R502 CL(Contactless) reader

These readers are support by CCID since v1.4.25, make sure your CCID driver version higher or equal to 1.4.25.

On MacOS, you can check your CCID version with the following command, and if required, you can install latest CCID driver from https://github.com/martinpaljak/osx-ccid-installer/releases

grep -A 1 CFBundleShortVersionString /usr/local/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist

On Linux, you can check your CCID version with the following command, and if required, you can install latest CCID driver from https://ccid.apdu.fr/

grep -A 1 CFBundleShortVersionString /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist

Proprietary Notes

FeliCa is a registered trademark of the Sony Corporation. MIFARE is a trademark of NXP Semiconductors. Jewel Topaz is a trademark of Innovision Research & Technology. All other trademarks are the property of their respective owners.

libnfc's People

Contributors

adamlaurie avatar alexlian avatar axisray avatar c3be avatar centromere avatar daixtrose avatar doegox avatar feitiansmartcardreader avatar frankmorgner avatar gelotus avatar gentilkiwi avatar hiddewie avatar hph86 avatar iwamatsu avatar jgeslin avatar jiapengli avatar llorephie avatar ludovicrousseau avatar manu0401 avatar neomilium avatar oliv3r avatar pmeerw avatar puppywang avatar quantum-x avatar rstular avatar smortex avatar snowy13 avatar stean avatar xantares avatar zuck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libnfc's Issues

Using multiple readers can be confused

When you have more than one NFC device connected to the same computer, it's
a little confused to know which one you are using.
Due to readers auto-detection, we can't control which device you are using.
Things goes harder with program that need two devices like nfc-emulate or
nfc-relay.

Original issue reported on code.google.com by [email protected] on 26 Aug 2009 at 10:26

Added NFCIP support (NDEF)

I added NFCIP support to libnfc. It is a messy patch, but it works (see
included initiator and target example apps). You need two readers to test
this. The initiator and target send each other a simple "Hello World/Mars"
message.

Issues with the patch:
- I copied some functions and added "dep" in their name when the PN53x
instruction is different, this could be optimized a bit by having some kind
of configuration somewhere to indicate that DEP / NFCIP is used
- NFCIP needs to activate the target, which is something else than
selecting it apparently (different command)

The patch is against latest svn (r71).



Original issue reported on code.google.com by fkooman%[email protected] on 22 Aug 2009 at 4:31

Attachments:

Windows doesn't support getopt

There is no getopt in Windows afaik, so some of the tools are not going to
work there. Tried with Visual C++ 2008 Express.



Original issue reported on code.google.com by fkooman%[email protected] on 31 Aug 2009 at 9:28

PN532 UART support is broken

What steps will reproduce the problem?
1. Build libnfc trunk sources:

./configure --disable-pcsc-lite --disable-libusb
make
sudo make install

2. Run "nfc-list" or "nfc-anticol" tools.

What version of the product are you using? On what operating system?
Linux Ubuntu 9.10 - libnfc 1.3.0 r228.

The result is:

1. nfc-list:

nfc-list use libnfc 1.3.0 (r227)
INFO: No device found.

2. nfc-anticol:

Segmentation fault


Original issue reported on code.google.com by emanuele.bertoldi on 2 Dec 2009 at 11:43

r120 fails to compile

messages.h is not included in dev_pn531.c thus the use of DBG macro on line 125 
causes 
compilation to fail.

Original issue reported on code.google.com by [email protected] on 26 Sep 2009 at 1:26

nfc-mfclassic's output should be more clear

At r138, nfc-mftool have a nice feature: it could try to read a MIFARE card
using "defaults" keys.
But the output is not clear:

nfc-mftool r a dump.mfd

Checking arguments and settings
Succesful opened MIFARE the required files
Connected to NFC reader: ACR122U102 - PN532 v1.4 (0x07)
Found MIFARE Classic 1K card with uid: ec81d51a
Reading out 64 blocks |............xxxx|
Writing data to file: dump.mfd
Done, all bytes dumped to file!

What does mean dots '...' and crosses 'xxx" ? If crosses are failures, we
shouldn't have a "Done, all bytes dumped to file!" message.

Original issue reported on code.google.com by [email protected] on 5 Oct 2009 at 3:29

Add C++ compatibility

The library is not correctly linked in a C++ environment.

Reference:
http://www.dwheeler.com/program-library/Program-Library-HOWTO/x214.html

The solution is:

1) Define a macro in "defines.h" like this:

// Linkage specification macro
#if defined __cplusplus 
    #define NFCAPI extern "C" 
#else
    #define NFCAPI
#endif

2) Add "NFCAPI" prefix before each API method signature:

/* libnfc.h */
NFCAPI dev_info* nfc_connect();

/* libnfc.c */
NFCAPI dev_info* nfc_connect()
{
    // ...
}


Original issue reported on code.google.com by emanuele.bertoldi on 3 Sep 2009 at 1:39

NDEF Mifare Ultralight URL tag parser

I created a NDEF parser example tool (nfc-ndef) that at this time can parse
a MFUL tag (among others the one from Tikitag/Touchatag) to extract the
NDEF URL stored in it. 

The code is universal in that it is easy to implement support for other
NDEF tags / message types as well, but it seems this one is best suited as
an example as most people will have the Tikitag tags lying around. In the
future a complete NDEF parser may be a possibility separate from this
project (as part of nfc-tools project?) 

Extending it to MIFARE Classic support (1k/4k) is trivial.

I didn't want to commit it just yet as the source style / copyright etc.
may not be what is required for this project :-) I used "indent -kr -i4" to
format the source. It's been a while since I was fluent in C :-)

The copyright owner can be changed if needed, as long as it remains GPLv3+ :)

Original issue reported on code.google.com by fkooman%[email protected] on 19 Oct 2009 at 4:06

Attachments:

initialisation of devices.h with address when struct is packed

During compilation of libnfc using Solaris SUNWspro compiler.

The struct dev_callbacks_list is initialised with addresses of functions 
in "devices.h". This is incompatible with the struct being "packed".

Move the pack pragma in "types.h" to around only those types that truely 
need to be packed.

Original issue reported on code.google.com by [email protected] on 5 Oct 2009 at 12:47

Some NFC ARYGON readers doesn't work (APDB)

I actually own a APDB2UA33 OEM module. For my first try, I had used a 
USB-UART converter to connect the OEM module on a PC.
I had compiled libnfc 1.2.1 using --enable-debug flag (under GNU/Linux) 
and had executed nfc-list:
{{{
Trying to find ARYGON device on serial port: /dev/ttyUSB#
Succesfully connected to: /dev/ttyUSB0
Tx: 32  00  00  ff  04  fc  d4  06  00  00  26  00
Tx: 32  00  00  ff  02  fe  d4  02  2a  00
Error connecting NFC reader
}}}

Original issue reported on code.google.com by [email protected] on 3 Aug 2009 at 8:42

Include exports in header files to support DLL creation on Windows

The files libnfc.h and bitutils.h need the following in the header.

#ifdef _WIN32
#  ifdef nfc_EXPORTS
#    define NFC_LIB_EXPORT  __declspec( dllexport )
#  else
#    define NFC_LIB_EXPORT  __declspec( dllimport )
#  endif
#else
#  define NFC_LIB_EXPORT 
#endif

Furthermore, for every function that needs to be exported (i.e.: callable
from the outside world) should have "NFC_LIB_EXPORT" prepended.

Example:
NFC_LIB_EXPORT dev_info* nfc_connect(void);

In bitutils.h the functions "print_hex*" and "swap_endianess*" also need to
be "exported" because some tools use them.

These header modifications will be used by CMake to generate a DLL + LIB
file for libnfc.

Original issue reported on code.google.com by fkooman%[email protected] on 2 Sep 2009 at 10:18

Add complete support for NXP PN532(C106) chip

In the current version, there is not a complete support for the last
revision of NXP PN532 chip (C106).

It has two important features:

- It starts in "sleep mode" and needs a specific command to wake-up.
- It only works in handshake mode.

Reference: http://www.libnfc.org/community/topic/57/add-support-for-pn532-chip/


Original issue reported on code.google.com by emanuele.bertoldi on 3 Sep 2009 at 1:18

Disable serial auto-probing devices

With 1.2.0 version, some serial devices (ARYGON) are now supported. 
During nfc-list (for example), libnfc will probe serial port and this can 
be annoying if there are others devices plugged on serial port.

Original issue reported on code.google.com by [email protected] on 23 Jul 2009 at 1:58

nfc_target_init doesn't correctly reset the parity during initalization

The code currently contains:

if (!bPar) nfc_configure((dev_info*)pdi,DCO_HANDLE_CRC,true);

which sets the CRC property based on the bPar flag.  There's a section
further on that sets it back similarly.  This should probably set the
PARITY property instead.

I haven't created a test case from this, but it appeared pretty clear what
the code was intended to do, and what it actually does.  I've attached a
patch that should correct the issue.  This still applies to revision 163.

If you need any further information, do just ask.  Thanks...  5:)

Original issue reported on code.google.com by [email protected] on 2 Nov 2009 at 4:49

Attachments:

ARYGON ADRB-USB fails on MAC OS X

there seems to be a problem with delay_ms(), is this linux internal?

>nfc-list 
dyld: lazy symbol binding failed: Symbol not found: _delay_ms
  Referenced from: /usr/local/lib/libnfc.0.dylib
  Expected in: dynamic lookup

dyld: Symbol not found: _delay_ms
  Referenced from: /usr/local/lib/libnfc.0.dylib
  Expected in: dynamic lookup

Trace/BPT trap

Original issue reported on code.google.com by [email protected] on 31 Oct 2009 at 2:08

Use Doxygen to comment code and document API

Instead of using a wiki page to document API, it should be more easy for 
developers to write theses comment within source code. Using Doxygen, we 
will be able to produce an online documentation (html), an offline 
documentation (pdf) and have commented code.

Original issue reported on code.google.com by [email protected] on 3 Aug 2009 at 8:53

Fedora (RPM) packaging issues

There are two issues when packaging for Fedora:

1. The std=c99 CFLAGS should not be used on Fedora (Fedora 11, GCC 4.4),
with it the software won't compile, without it everything works fine (I
created a patch to fix this for Fedora). I'm not sure it compiles on
Debian/other systems without this CFLAGS?

2. The use of rpath. This is deprecated, also on Debian, but by default
rpath is included. I "fixed" this by re-running libtoolize on Fedora which
takes care of this, it does not seem to be possible to just modify the
libtool script ./configure generates.


Is it possible to remove the "std=c99" or will this be a problem for other
platforms? 

It it possible to "fix" libtool to not include rpath by default? Or have
some configure parameter for ./configure which takes care of this? (e.g.:
--disable-rpath)

The Fedora package (srpm and spec file) can be found at
http://fkooman.fedorapeople.org/libnfc/

Original issue reported on code.google.com by fkooman%[email protected] on 21 Aug 2009 at 6:31

Remove global variables

We should remove [dirty] global variables if we want to be 
more "thread-safe".

http://www.libnfc.org/community/topic/45/code-review-of-libnfc/

(Thanks to snapdev)

Original issue reported on code.google.com by [email protected] on 23 Jul 2009 at 1:42

Allow to specify speed in NFC device description

Current svn trunk (r99) can now handle a NFC connection to a specified
device. For ARYGON readers (and PN532 using UART) serial port can be
specified but not serial speed.
Actually speed is hardcoded (in rs232.c) and can become a problem if a
serial NFC reader doesn't use 115200 bauds.

Original issue reported on code.google.com by [email protected] on 8 Sep 2009 at 8:05

Combine transceive() functionality

We may want to consider nfc_initiator_select_tag() to be renamed to
nfc_initiator_select_target(). Where we use the "pbtInitData" parameter for 
(structs & unions) that corresponds to the active "init_modulation" type.

For DEP transactions this could hold pbtPidData/pbtNFCID3i/pbtGbData (using
structs & unions). This may improve the understanding of "pbtInitData" for
developers, since they are guided by a struct to supply additional info.

Furthermore this will bring down the total amount of "similar-code", plus
it will keep the API tight and clean.

Last but not least, we could save the current used "init_modulation", to
cut down the extra "tranceive()" functionality, since this only differs in
the command for the PN53X chipset.

Original issue reported on code.google.com by [email protected] on 30 Sep 2009 at 9:58

CMake pkg-config & misc update

- fix CMake pkg-config generation because the list of "Requires:" is dynamic
- fix devices.h, #endif should not be followed by the name of the block
- fix CMake libnfc_usb compilation, dev_pn531 and dev_pn533 are two files
- rename tools to examples in CMake file

Original issue reported on code.google.com by fkooman%[email protected] on 12 Sep 2009 at 6:59

Attachments:

Make a Windows installable binary

Thanks to Fkooman, libnfc have now CMake files. That allow us to provide an
automatically generated archive like "make dist" with autotools but also
for Windows.
As suggested by Fkooman, CMake can produce an installable binary too: "That
should be no problem now with this CMake/MSVC/NSIS stuff."

Original issue reported on code.google.com by [email protected] on 8 Sep 2009 at 8:28

Add auto-auth option to mftool

It would be nice to have an "auto-authentication" option in "mftool".

Usage example:

mftool r a dump.mfd
(this is the new usage form)

mftool r a dump.mfd keys.mfd
(please, note the switch between dump and keys for the old usage form)

If no "keys" dump file is specified, the tool tries to authenticate with a
standard key list:

byte_t keys[] = {
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
    0xd3,0xf7,0xd3,0xf7,0xd3,0xf7,
    0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,
    0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,
    0x4d,0x3a,0x99,0xc3,0x51,0xdd,
    0x1a,0x98,0x2c,0x7e,0x45,0x9a,
    0xaa,0xbb,0xcc,0xdd,0xee,0xff
};

Pseudo code:

// Set the authentication information (uid)
memcpy(mp.mpa.abtUid,ti.tia.abtUid,4);

// Determin if we should use the a or the b key
mc = (bUseKeyA) ? MC_AUTH_A : MC_AUTH_B;

int num_keys = sizeof(keys) / 6;

for (int i = 0; i < num_keys; i++)
{
    memcpy(mp.mpa.abtKey, keys + (i*6), 6);
    if (nfc_initiator_mifare_cmd(device, mc, block, &mp))
        return true;

    nfc_initiator_select_tag(device, IM_ISO14443A_106, mp.mpa.abtUid, 4, NULL);
}

return false;

Original issue reported on code.google.com by emanuele.bertoldi on 28 Sep 2009 at 1:57

"Error connecting NFC reader" using ACS ACR122U PICC

When libnfc is used with ACR122 device, a tag need to be present to be 
able to see the reader.
If you try to use this reader with nfc-list without tag you will 
see "Error connecting NFC reader" exactly the same message when you 
haven't any readers connected.

Original issue reported on code.google.com by [email protected] on 3 Aug 2009 at 3:29

Merge MIFARE tools

Actually, we have one tool to manipulate MIFARE Classic, and another one
for MIFARE Ultralight, it should be cleaner if we merge them.

Original issue reported on code.google.com by [email protected] on 24 Jul 2009 at 4:43

Alternative build system (CMake)

I've created a few CMake build system files for libnfc as an experiment.
There are still some issues on Windows, and windows support is not part of
the current CMake scripts, but on Linux it seems to work great (tested with
Fedora 11 and Ubuntu 9.04).

On Windows I get a bit confused about the winscard.DLL/winscard.LIB files
etc and how to generate a LIB file from a DLL file. CMake can automatically
generate Visual Studio project files for any version, so that would be a
nice benefit! 

Although when using the winscard.LIB file that is now part of the SVN repo
it all seems to work, but it is not really nice to have a blob in the
source repo.

I attach two files, CMakeList.txt which should be placed in the project
root and CMakeListSRC.txt which should be placed in the "src" directory and
also have the name CMakeList.txt. To compile the whole stuff (out of src
tree) create for example a directory "bin" in the project root:

$ cd /path/to/libnfc-1.2.2/
$ mkdir bin
$ cd bin
$ cmake ..
$ make
$ sudo make install  (installs in /usr/local/*)

Maybe at some point (when the Windows issues are resolved) it can be
considered a replacement for Autotools.

Original issue reported on code.google.com by fkooman%[email protected] on 31 Aug 2009 at 9:37

Attachments:

CMake updates

- make disable serial probe configurable in GUI, default to off
- add sources of getopt tools to all builds except windows

Original issue reported on code.google.com by fkooman%[email protected] on 4 Sep 2009 at 9:18

Attachments:

nfc_target_receive_bytes compilation error

What steps will reproduce the problem?

1. Compilation on PowerPC MacOSX 10.4.11, gcc -Wall -Werror

What is the expected output? What do you see instead?

../../libnfc/src/libnfc.c:876: warning: passing argument 5 
of 'pn53x_transceive' from incompatible pointer type

In function  nfc_target_receive_bytes szRxLen was uint32_t

should be size_t szRxLen=sizeof(abtRx);


Original issue reported on code.google.com by [email protected] on 5 Oct 2009 at 1:46

Remove PN532 UART transceive delay

Currently, the PN532 UART driver seems to be very slow compared with a
Nokia NFC phone (read and write actions on Mifare tags).

The main cause seems to be the 50ms delay added to the "transceive"
function for stability needs. So, I've tried to remove it and...surprise!
It works! :)

With the delay I need 18~20s to read/write a Mifare Classic 1K tag. Without
it the tag is written/read in ~10s. It's still slower than the Nokia phone
(which reads a vCard from a Mifare 1K in only 1~2s), but surely more
acceptable.

Probably the magic is done by recent changes to UART read/write functions
(r183, r184).

So, in my opinion, we can remove it if the situation is confirmed by more
accurate tests and benchmarks.

Original issue reported on code.google.com by emanuele.bertoldi on 8 Dec 2009 at 3:53

RS232/UART communication problems using ARYGON µC equipped readers (APDB2UA33)

Since r105, PN532 UART based NFC devices can be used with libnfc without
any stability issue... But we have to use a delay in dev_arygon.c (around
50ms to be stable).
This delay is needed to receive a full TAMA frame for PN532.
Unfortunately, if we use a slower transmission like 9600 baud, this delay
have to be extended or it appends this:

 TX: 32  00  00  ff  04  fc  d4  4a  01  00  e1  00
 RX: 00  00  ff  00  ff  00
 TX: 32  00  00  ff  04  fc  d4  4a  01  00  e1  00
 RX: 00  00  ff  0f  f1  d5  4b  01  01  00  44  00  07  04  a3  12  61  ee
 02  80  09  00  00  00  ff  00  ff  00
 TX: 32  00  00  ff  04  fc  d4  4a  01  00  e1  00
 RX: 00  00  ff  0f  f1  d5  4b  01  01  00  44  00  07  04  a3  12  61  ee
 02  80  09  00  00  00  ff  00  ff  00  00  00  ff  0f  f1
 TX: 32  00  00  ff  04  fc  d4  4a  01  00  e1  00
 RX: d5  4b  01  01  00  44  00  07  04  a3  12  61  ee  02  80  09  00  00
 00  ff  00  ff  00
 TX: 32  00  00  ff  04  fc  d4  4a  01  00  e1  00
 RX: 00  00  ff  0f  f1  d5  4b  01  01  00  44  00  07  04  a3  12  61  ee
 02  80  09  00  00  00  ff  00  ff  00  00

If you take care: RX start doesn't and TAMA start does match each time.

The cleanest way, IMHO, is to retrieve TAMA frame from RS232/UART using a
circular buffer which is able to keep all received bytes in a buffer and
export only full TAMA frame.
Using this way, we will be able to check TAMA frame struct (length and
checksum).

Original issue reported on code.google.com by [email protected] on 14 Sep 2009 at 4:40

nfc-mfultralight's output should be more clear

If crosses are failures, we
shouldn't have a "Done, all bytes dumped to file!" message.

See:

http://code.google.com/p/libnfc/issues/detail?id=38


Original issue reported on code.google.com by emanuele.bertoldi on 19 Nov 2009 at 10:53

Auth error in "mftool"

I think there is an error in mftool code at line 107:

if (!nfc_initiator_mifare_cmd(pdi,MC_AUTH_A,iBlock,&mp))

should be:

if (!nfc_initiator_mifare_cmd(pdi,mc,iBlock,&mp))

Original issue reported on code.google.com by emanuele.bertoldi on 18 Sep 2009 at 3:07

Get library version at execute time

It should be helpful to have a little function to get library version at
runtime.
This can be done using config.h generated by Autotools under POSIX.

Original issue reported on code.google.com by [email protected] on 6 Oct 2009 at 4:44

Fix the rs232 receive function

With the current rs232 receive function, I experimented some buffer
synchronization problems during the pn532C106 support implementation
process (see: http://code.google.com/p/libnfc/issues/detail?id=15).

With my patch (Linux only), the function reads exactly the number of bytes
currently in the buffer:



bool rs232_receive(const serial_port sp, byte_t* pbtRx, uint32_t* puiRxLen)
{
  int iResult;
  int byteCount;
  fd_set rfds;

  // Reset file descriptor
  FD_ZERO(&rfds);
  FD_SET(((serial_port_unix*)sp)->fd,&rfds);
  iResult = select(((serial_port_unix*)sp)->fd+1, &rfds, NULL, NULL, &tv);

  // Read error
  if (iResult < 0) return false;

  // Number of bytes in the input buffer
  ioctl(((serial_port_unix*)sp)->fd, FIONREAD, &byteCount);

  // Read time-out or empty buffer
  if (iResult == 0 || byteCount == 0) return false;

  // There is something available, read the data
  *puiRxLen = read(((serial_port_unix*)sp)->fd,pbtRx,byteCount);

  return (*puiRxLen > 0);
}

Original issue reported on code.google.com by emanuele.bertoldi on 4 Sep 2009 at 10:25

swap_endian64 non-portable implementation

What steps will reproduce the problem?
1. compilation with Microsoft Visual C++ 6.0
2.
3.

What is the expected output? What do you see instead?

swap_endian64()

bitutils.c(120) : error C2059: syntax error : 'bad suffix on number'
bitutils.c(120) : error C2146: syntax error : missing ')' before 
identifier 'l'
bitutils.c(120) : error C2059: syntax error : 'bad suffix on number'
bitutils.c(120) : error C2059: syntax error : 'bad suffix on number'
bitutils.c(120) : error C2059: syntax error : 'bad suffix on number'

What version of the product are you using? On what operating system?

Windows XP

Please provide any additional information below.

I got around this by commeting out the whole function. I did not need it 
for pn531.

Original issue reported on code.google.com by [email protected] on 4 Oct 2009 at 10:35

DOS line endings in README file

The README file has DOS line endings, this is inconsistent with the rest of
the text files in the distribution.

Fix:
sed -i 's/\r$//' README


Original issue reported on code.google.com by fkooman%[email protected] on 21 Aug 2009 at 4:09

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.