libnfc | allows userspace application access to NFC devices

 by   frankmorgner C Version: Current License: LGPL-3.0

kandi X-RAY | libnfc Summary

kandi X-RAY | libnfc Summary

libnfc is a C library. libnfc has no bugs, it has no vulnerabilities, it has a Weak Copyleft License and it has low support. You can download it from GitHub.

libnfc is a library which allows userspace application access to NFC devices. The official web site is: The official forum site is: The official development site is: Important note: this file covers POSIX systems, for Windows please read README-Windows.txt.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              libnfc has a low active ecosystem.
              It has 11 star(s) with 6 fork(s). There are 2 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              libnfc has no issues reported. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of libnfc is current.

            kandi-Quality Quality

              libnfc has no bugs reported.

            kandi-Security Security

              libnfc has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              libnfc is licensed under the LGPL-3.0 License. This license is Weak Copyleft.
              Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.

            kandi-Reuse Reuse

              libnfc releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of libnfc
            Get all kandi verified functions for this library.

            libnfc Key Features

            No Key Features are available at this moment for libnfc.

            libnfc Examples and Code Snippets

            No Code Snippets are available at this moment for libnfc.

            Community Discussions

            QUESTION

            Revolut visa Debit card not detected by libnfc6
            Asked 2021-Apr-08 at 08:03

            Trying to read various payment cards using PN532 NFC RFID Module. libnfc6 sucessfully polls most of the nfc cards and even mobile payment method is detected, but none of my Revolut cards are detected by nfc-poll app.

            libnfc was compiled locally from libnfc-1.8.0 git tag.

            My current polling setup:

            ...

            ANSWER

            Answered 2021-Apr-08 at 08:03

            Buying new PN532 NFC RFID Module solved the issue.

            Source https://stackoverflow.com/questions/66868180

            QUESTION

            Invalid pointer exception using pinvoke on libnfc for string values
            Asked 2021-Feb-23 at 09:39

            I am trying to communicate with an NFC reader/writer on a raspberry pi 3 using dotnet core.

            I have to say that the different libnfc command line tools I used are all working fine (aka I can read and poll my tags, no problem on this side).

            The idea is to use dotnet core and C# to orchestrate the libnfc library and it seems to work fine except as soon as the function I call returns a string, I get the following error message:

            ...

            ANSWER

            Answered 2021-Feb-23 at 09:39

            The comment from Matthew Watson and the link he shared had the correct answer!

            So I modified the pinvoke line like this:

            Source https://stackoverflow.com/questions/66330007

            QUESTION

            Reading from an NFC reader directly into a desktop web application?
            Asked 2021-Feb-22 at 14:36

            I have LibNFC working from the Linux terminal recognising my ACR122U Reader, and I wanted to know if there was a method for it to work through Chrome on a Linux Desktop as it is really similar to Android Support, with all the NFC device handling done by libnfc and the browser just has to know about this library instead of every type usb or other device than can do NFC.

            I have tried using the WebNFC API to connect it :

            ...

            ANSWER

            Answered 2021-Feb-10 at 06:54

            Web NFC is supported on Android only as of February 2021. See https://web.dev/nfc/

            The WebUSB error suggests you're requesting an interface that implements a protected class (among those below):

            Source https://stackoverflow.com/questions/66111078

            QUESTION

            Problem with detecting badge with PN532 and Raspberry Pi
            Asked 2020-Mar-30 at 01:55

            I have been trying to detect an tag using the PN532 module that I bought from amazon here:

            https://www.amazon.ca/ASHATA-Controller-Raspberry-Interface-Switching/dp/B07XFNDHNS

            I followed the tutorial here:

            http://wiki.sunfounder.cc/index.php?title=PN532_NFC_Module_for_Raspberry_Pi

            I tried using both I2C or SPI, but both results just give me the following when I run nfc-poll:

            ...

            ANSWER

            Answered 2020-Mar-30 at 01:55

            Answer

            Update 2020mar29hkt2040

            Part 1 - libnfc v1.17 I2C config tested OK

            The OP has no luck in testing libnfc I2C mode and SPI mode. I tried I2C mode and found everything OK. I guess the OP has not set the config file, or has not set "auto scan = true". See my example libnfc171 config file in Appendix A. PS - (1) My NFC reader can detect a tag without any problem. (2) I am using Rpi4B buster 2020mar13.

            Part 2 - Now testing SPI mode 2020mar29hkt2044

            Sunfounder config instructions recommends lowering SPI speed 50kHz. So I have changed the /bbo/config.txt file as shown in Appendix F.

            / to continue, ...

            References

            (1) The OP's NFC RFID Controller Module

            (2) SunFounder Rpi PN532 NFC Module Tutorial

            (3) Libnfc NFC Library

            (4) Libnfc Configuration Manual

            (5) Libnfc Main Page

            (6) Libnfc: configuration

            (7) Libnfc: nfc-list

            (8) MIFARE Card

            Appendices

            Appendix A - Installing libnfc 1.7.1

            Appendix B - Reading a tag

            Appendix C - NFC Reader Tested

            Appendix D - My NFC readers and tags

            Appendix E - PN532 NFC reader V3 Wiring

            Appendix F - SPI configuration for testing PN532 using libnfc 1.1.7

            Source https://stackoverflow.com/questions/60819793

            QUESTION

            NFC Reader ACR122U and libnfc.driver.acr122_usb Unable to write to USB (Result too large)
            Asked 2020-Feb-06 at 21:49

            I try to use an ACR122 USB NFC-Reader on Mac OSX Mojave 10.14.6 with libnfc and I've got a "Unable to write to USB (Result too large)" error when I try to use the command LIBNFC_LOG_LEVEL=3 nfc-list:

            ...

            ANSWER

            Answered 2020-Feb-06 at 21:49

            Your step 4, editing /usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist worked for me and it is the only clean solution I could find.

            Here a short description what you need to do:

            • disable 'System Integrity Protection'
            • removes 3 matching lines (with the same array index!) from the the 3 arrays ifdFriendlyName, ifdVendorID and ifdProductID of the plist /usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist
            • enable 'System Integrity Protection'

            The three lines in my case were the entry number 370:

            • ifdFriendlyName="ACS ACR122U PICC Interface"
            • ifdVendorID=0x072F
            • ifdProductID=0x2200

            Detailed step by step description:

            1. unplug your NFC card reader
            2. shut down OSX
            3. hold down the keys + on the keyboard while starting your Mac to enter recovery mode
            4. in the recovery mode open a Terminal Window using the 'Utility' menu
            5. execute the command csrutil disable
            6. reboot your Mac normally
            7. open a Terminal window and execute the following commands:

            Source https://stackoverflow.com/questions/57876097

            QUESTION

            Force PC/SC driver on ACR122U NFC reader
            Asked 2019-Apr-10 at 16:34

            I have trouble with using my ACR122U RFID card reader form ACS. I need to connect it to my Mac using the PC/SC driver. I installed the driver from the ACS website and confirmed that it's running.

            However, whenever I test using the nfc-list command, I get the following error:

            ...

            ANSWER

            Answered 2017-Aug-11 at 10:19

            You seem to be mixing two different options for connecting the ACR122U to libnfc:

            1. You can either use the direct USB driver for the ACR122U, libnfc.driver.acr122_usb (which is what you are currently using). In this case, you need to make sure that the PC/SC daemon does not take over control of the reader (since only one instance can access the USB interface of the reader at a time).

              • The quick-and-dirty fix is to disable the PC/SC daemon that takes control over the ACR122U. Though this is not straight forward on Mac OS X, a detailed explanation can be found in Ludovic's blog.
              • Alternatively, you could prevent the PC/SC daemon from taking control over that specific reader by editing /usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist. You would need search for the entry

            Source https://stackoverflow.com/questions/45508174

            QUESTION

            libnfc: unable to open NFC device
            Asked 2019-Mar-25 at 04:54

            I have a problem with libnfc on a Raspberry Pi 3B trying to read data from a PN532 card reader. I installed libnfc as the official site suggest to do and in fact it all worked this morning. I was able to detect my device using the nfc-list and nfc-scan-device commands.

            Then I tried to run a C program (not done by me, but done by a person here in the company) and it worked. Did it again and it didn't work, but returned an error. Tried to run the nfc-list command and it returned the same error. Since then, it looks like the libnfc library stopped working properly.

            These are the errors I get when I try to run some commands:

            nfc-list:

            ...

            ANSWER

            Answered 2019-Mar-25 at 04:54

            Have the same problem it was a problem on the circuit I believe. Taking it off and re putting it back solved the problem for me.

            Source https://stackoverflow.com/questions/54674335

            QUESTION

            Why is the length byte of this ATS so large?
            Asked 2019-Feb-13 at 09:35

            Testing with a DESFire, I picked up the following ATS: 0x75 0x77 0x81 0x02 0x80.

            From what I can tell, ISO/IEC 14443-4 says that the first byte should be the "length byte" and should indicate the total number of bytes sent as part of the ATS. Why, then, is the first byte 0x75? If you ignore the first nibble, the value is correct, but is there any reason I should actually have to do that, or is there no relation between this byte and the length value?

            Note: The ATS was obtained via libnfc through nfc_initiator_select_passive_target.

            ...

            ANSWER

            Answered 2019-Feb-13 at 09:33

            The ATS is perfectly fine. libnfc does not include the length byte in the value stored in nt.nti.nai.abtAts. Instead, the length of the ATS is stored in nt.nti.nai.szAtsLen. Consequently, the first byte is not the length byte but the format byte. It indicates that TA(1), TB(1), and TC(1) are present (Y(1) = 7h), and that the FSC is 64 bytes (FSCI = 5h). The remaining bytes then decode as:

            • TA(1) = 77h: all three divisors supported for both directions
            • TB(1) = 81h: FWT = 256 * 16 / f_c * 2^8 = 77 ms, SFGT = 256 * 16 / f_c * 2^1 = 600 us
            • TC(1) = 02h: CID supported, NAD not supported
            • Historical bytes: 80h

            Source https://stackoverflow.com/questions/54659239

            QUESTION

            What does Linux GKI stand for?
            Asked 2018-Oct-28 at 18:21

            What do they refer to with GKI here? What does it abbreviate?

            ...

            ANSWER

            Answered 2018-Oct-28 at 18:21

            It seems to stand for General Kernel Interface, not that it is much useful as itself.

            For example:

            The libnfc-nci implementation uses a reliable mechanism of queues and message passing named General Kernel Interface (GKI) to easily communicate between layers and modules: Each task is isolated, owning a buffer (or inbox) where messages are queued and processed on arrival. This mechanism is used to send messages from the DH to the NFCC chip, and vice versa.

            (Radio Frequency Identification: 11th International Workshop, RFIDsec 2015)

            Source https://stackoverflow.com/questions/53034649

            QUESTION

            ctypes: structure, size_t field
            Asked 2018-Aug-17 at 09:29

            I am trying to implement python-to-c binding via ctypes for libnfc. I have a structure, here is a wrong variant:

            ...

            ANSWER

            Answered 2018-Mar-27 at 22:44

            The issue here is that the C struct you're trying to map is packed, as (tersely) explained in the Structure/union alignment and byte order section of the docs:

            By default, Structure and Union fields are aligned in the same way the C compiler does it. It is possible to override this behavior be specifying a _pack_ class attribute in the subclass definition. This must be set to a positive integer and specifies the maximum alignment for the fields. This is what #pragma pack(n) also does in MSVC.

            That only makes sense if you already know about packing and alignment in C, but it's not that complicated.

            By default, C structure elements are aligned to start on nice boundaries. For example, a 32-bit int following an 8-bit int doesn't run from bytes 1-4, it runs from bytes 4-7 (and bytes 1-3 are unused padding). So, ctypes follows the same rules.

            That means that, while szUidLen runs from bytes 3-10 when it's defined as an array of 8-bit ints, it gets aligned to bytes 8-15 (or 4-11, depending on your compiler) when it's defined as a 64-bit int. You can see this by printing out nfc_iso14443a_info.szUidLen.offset.

            So, the first one gets the bytes 7, 0, 0, 0, 0, 0, 0, 0, which is little-endian int64 for 7, while the second one gets the bytes 0, 0, 0, a, b, c, d, e, where abcde are the first 5 bytes of the next field, which is little-endian int64 for some huge number (unless the next field happens to be 0).

            Of course you don't want to just guess that this is the problem. If you based your Structure on a struct from a C header, this can only be true if the header or the compile flags specify some non-default packing, like the #pragma pack(1) used by MSVC. If you based your Structure on something like an RFC packet description, the alignment is not even according to C rules, but is defined somewhere in the documentation you're reading (although protocol RFCs almost always use 1-byte alignment).

            Anyway, the docs don't explain the problem very well, but they explain the solution:

            Source https://stackoverflow.com/questions/49502707

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install libnfc

            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. Under FreeBSD, if you use devd, there is also a rules file: contrib/devd/pn53x.conf.

            Support

            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.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/frankmorgner/libnfc.git

          • CLI

            gh repo clone frankmorgner/libnfc

          • sshUrl

            git@github.com:frankmorgner/libnfc.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular C Libraries

            linux

            by torvalds

            scrcpy

            by Genymobile

            netdata

            by netdata

            redis

            by redis

            git

            by git

            Try Top Libraries by frankmorgner

            vsmartcard

            by frankmorgnerC

            openpace

            by frankmorgnerC

            eid-pam

            by frankmorgnerC

            tikz

            by frankmorgnerPython

            fdroiddata

            by frankmorgnerShell