Skip to content

dsgriffin/nfc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NFC πŸ›œ

Crates.io

Rust bindings for the libnfc library.

For raw FFI bindings for libnfc, see nfc-sys.

Installation

Install libnfc (e.g. Debian/Ubuntu, brew install libnfc using Homebrew on Mac OSx, or on other systems).

Cargo.toml

[dependencies]
libc = "0.2.0"
nfc = "0.1.11"

Example Usage

// main.rs

extern crate nfc;

use nfc::context;
use nfc::misc;

fn main() {
    let mut context = context::new();

    if context.is_null() {
        println!("Unable to initialize new NFC context!");
    }

    // Initialize libnfc
    nfc::init(&mut context);
    
    // Print libnfc version
    println!("libnfc version: {}", misc::version());
}

TODO

  • Replace any raw pointers
  • Documentation + more in-depth examples

Contributing

If you've found a bug or have an idea, feel free to open an Issue. If you've got a fix or feature ready, open a PR. Thanks!

License

MIT

About

Safe Rust bindings to the libnfc library πŸ›œ

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages