Giter VIP home page Giter VIP logo

libfprint-rs's Introduction

LIBFPRINT-RS

This crate provides a wrapper around the native libfprint library.

Dependencies

This package requires libfprint-2 to be installed in your system alongside libclang and pkg-config

Usage

Add libfprint-rs as a dependency in Cargo.toml

[dependencies]
libfprint-rs = "0.2.0"

Or using cargo

cargo add libfprint-rs

Import the libfprint_rs crate. The starting point for nearly all libfprint-rs functionality is to create a context object. With a context object, you can list devices, open them and execute their functionalities.

use libfprint_rs::FpContext;

fn main() {
    let ctx = FpContext::new();
    let devices = ctx.devices();
    let dev = devices.get(0).unwrap();

    dev.open_sync(None).unwrap();
}

License

Distributed under the MIT License.

Status

Currently libfprint-rs is WIP.

libfprint-rs's People

Contributors

alvaroparker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

libfprint-rs's Issues

Scanner times out after sometime

We are creating a fingerprint scanner for a client.
One of the things we noticed was that after opening the fingerprint scanner for some time without input, it automatically prints an error message and exits the application.
Fingerprint could not be identified due to an error: Error { domain: fp - device - error - quark, code: 257, message: "Device disabled to prevent overheating." }
Is there a way to disable this or prevent the scanner from timing out?

"Not initialized" keeps occuring even with a recognized fingerprint scanner

When trying to enroll a fingerprint using enroll_sync, the template fingerprint undergoes check_print which returns either a None or Some(false) value, instead of a Some(true). This is indicated by the logs saying "Not initialized".

let template = FpPrint::new(dev);    //&dev); //&dev because dev might be used later
template.set_finger(FpFinger::RightIndex);
template.set_username("test");  //&user);

println!("Username of the fingerprint: {}", template.username().expect("Fingerprint username could not be retrieved"));

let counter = Arc::new(Mutex::new(0));

let _new_print = dev
        .enroll_sync(template, None, Some(progress_cb), Some(counter.clone()))
        .unwrap();

I would like to know if this is normal behavior, or if I'm doing something wrong with my code.
The console logs when the program runs are listed below:

For whom will you scan the fingerprint?
t e
Username of the fingerprint: t e

Not initialized
Enroll stage: 1
Enroll stage: 2
Enroll stage: 3
Enroll stage: 4
Enroll stage: 5

(process:27588): libfprint-image_device-WARNING **: 20:20:37.966: Deactivating image device while it is not idle, this should not happen.
"t e\n"
Total enroll stages: 5
Hello, world!
Hello World

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.