No description
Find a file
hongbin@ftsafe.com 8352c80679 Modify pcsc.c to have support for Mifare classic and Ultralight card
Modify pcsc.c and mifare.c files.
1. add code into pcsc.c to have support Mifare classic card.
2. The PCSC reader has SW value, add response data length for PCSC
reader
2020-05-13 12:15:28 +08:00
cmake added PC/SC driver to cmake 2019-09-03 15:50:28 +02:00
contrib Add missing files to autotools release process 2017-04-04 11:10:46 +02:00
examples first cut iClass support - get nfc-list to see UID 2020-05-11 11:45:28 +01:00
include rework NMT_END_ENUM 2020-05-11 20:00:04 +02:00
libnfc Modify pcsc.c to have support for Mifare classic and Ultralight card 2020-05-13 12:15:28 +08:00
m4 Add check for Libnfc-NCI before enabling pn71xx 2020-05-11 13:45:53 -05:00
test Add more missing files 2017-04-04 13:31:39 +02:00
utils Modify pcsc.c to have support for Mifare classic and Ultralight card 2020-05-13 12:15:28 +08:00
.gitignore Git: ignore generated files 2015-05-18 20:43:32 +02:00
.travis.yml remove libcutter from travis as it's not available anymore in the repos 2019-08-19 19:48:16 +02:00
AUTHORS Update changelog & authors 2017-03-02 16:00:51 +01:00
ChangeLog New NFC modulation type NMT_BARCODE 2017-05-17 13:58:16 +02:00
CMakeLists.txt cmake: fixed pcsc requirement for acr122_pcsc 2019-09-03 15:51:38 +02:00
configure.ac Add check for Libnfc-NCI before enabling pn71xx 2020-05-11 13:45:53 -05:00
COPYING Add LICENSE and README files to releases produce by make_release.sh script. 2009-06-26 09:22:26 +00:00
Doxyfile.in Remove last SVN cruft 2012-11-27 18:56:54 +01:00
HACKING.md typo 2017-02-18 13:05:02 +01:00
libnfc.conf.sample Fix typo in libnfc.conf.sample 2013-04-30 21:48:33 +02:00
libnfc.pc.in Sync libnfc.pc includedir with the rest of the project source files. 2009-12-22 21:02:19 +00:00
make_release.sh Fix version fetch using make_release.sh 2013-01-15 18:16:56 +01:00
Makefile.am Add more missing files 2017-04-04 13:31:39 +02:00
manual-test-results.txt add some manual test reports. 2011-05-05 16:03:09 +00:00
mingw-cross-compile.sh allow to cross-compile 32 and 64 bit versions of the library for windows 2017-01-25 18:44:44 +01:00
NEWS.md Fix typo in drivers blacklist, thanks Godfrey Chung 2017-03-07 10:49:25 +01:00
README-Windows.md Added Markdown to HACKING file 2016-04-08 11:02:40 +02:00
README.md Update readme and add Feitian R502 and bR500 support into pcsc driver 2020-04-09 11:29:11 +08:00

*-
* 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

Installation

See the file INSTALL for configure, build and install details.

Additionnally, 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

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".

Building

It should be as simple as running these three commands:

autoreconf -vis
./configure
make

Build with specific driver, like pcsc driver for compatible readers, go with below commands, tested on linux and macOS:

git clone --recursive https://github.com/nfc-tools/libnfc
autoreconf -vis
./configure --with-drivers=pcsc
make

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 through USB port, most linux already installed PCSC proprietary, then just plug in play, to have pcsc driver support, you may need build with "--with-drivers=pcsc" to re-build libnfc, below reader tested:

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

These reader support by CCID from 1.4.25, make sure your CCID driver version higher than 1.4.25.

Using macOS, use below command check your version, to 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

Using linux, use below command check your version, to 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.