https://github.com/dsgriffin/nfc
Safe Rust bindings to the libnfc library 🛜
https://github.com/dsgriffin/nfc
cargo libnfc nfc rust rust-bindings
Last synced: about 1 year ago
JSON representation
Safe Rust bindings to the libnfc library 🛜
- Host: GitHub
- URL: https://github.com/dsgriffin/nfc
- Owner: dsgriffin
- License: mit
- Created: 2016-05-29T23:19:18.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2024-12-29T21:06:03.000Z (over 1 year ago)
- Last Synced: 2025-03-18T05:51:13.255Z (about 1 year ago)
- Topics: cargo, libnfc, nfc, rust, rust-bindings
- Language: Rust
- Homepage: https://crates.io/crates/nfc
- Size: 27.3 KB
- Stars: 17
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: license.txt
Awesome Lists containing this project
README
# NFC 🛜
[](https://crates.io/crates/nfc)
Rust bindings for the [libnfc](https://github.com/nfc-tools/libnfc) library.
For raw FFI bindings for `libnfc`, see [nfc-sys](https://github.com/dsgriffin/nfc-sys).
## Installation
Install `libnfc` (e.g. [Debian/Ubuntu](http://nfc-tools.org/index.php?title=Libnfc#Debian_.2F_Ubuntu), `brew install libnfc` using Homebrew on Mac OSx, or on [other systems](http://nfc-tools.org/index.php?title=Libnfc#Installation)).
### Cargo.toml
[dependencies]
libc = "0.2.0"
nfc = "0.1.11"
## Example Usage
#### // main.rs
```rust
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