Giter Club home page Giter Club logo

nfc-bindings's Introduction

Build Status

nfc-bindings

Introduction

The project goal is to provide scripting language bindings for libnfc (http://www.libnfc.org/) through swig.

For now only Python bindings are supported (2.x and 3.x), with full docstrings.

Alternative Python bindings are provided by PyNFC (https://github.com/ikelos/pynfc), which is somewhat higher-level, while the API does not seem to be fully covered.

Requirements

  • libnfc >= 1.7.1
  • cmake
  • swig
  • python

Quickstart

git clone https://github.com/xantares/nfc-bindings.git
cd nfc-bindings
cmake -DCMAKE_INSTALL_PREFIX=~/.local .
make install
python python/examples/quick_start_example.py

Specify Python stack

To manually choose the Python libraries other than the default, you can specify the locations of the interpreter, library and include dir, eg:

cmake -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_LIBRARY=/usr/lib/libpython3.so -DPYTHON_INCLUDE_DIR=/usr/include/python3.6 .

Example

from __future__ import print_function
import nfc
context = nfc.init()
pnd = nfc.open(context)
if pnd is not None:
    if nfc.initiator_init(pnd) < 0:
        print('NFC reader: %s opened' % nfc.device_get_name(pnd))
nfc.close(pnd)
nfc.exit(context)

Find more examples in https://github.com/xantares/nfc-bindings/tree/master/python/examples

nfc-bindings's People

Contributors

xantares avatar regnarg avatar

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.