Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88cd932203 | ||
|
|
e85b607965 | ||
|
|
40a298f43b | ||
|
|
f8eb329a65 | ||
|
|
eb7edc43b8 | ||
|
|
ebff2518ad | ||
|
|
445d46fb6f | ||
|
|
477df2a861 | ||
|
|
e4bac112aa | ||
|
|
4c42a090f7 | ||
|
|
65483d51b7 | ||
|
|
e513848871 |
@@ -1,113 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
|
||||
import argparse
|
||||
import contextlib
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def format_title(title):
|
||||
box = {
|
||||
'tl': '╔', 'tr': '╗', 'bl': '╚', 'br': '╝', 'h': '═', 'v': '║',
|
||||
}
|
||||
hline = box['h'] * (len(title) + 2)
|
||||
|
||||
return '\n'.join([
|
||||
f"{box['tl']}{hline}{box['tr']}",
|
||||
f"{box['v']} {title} {box['v']}",
|
||||
f"{box['bl']}{hline}{box['br']}",
|
||||
])
|
||||
|
||||
|
||||
def rm_rf(path):
|
||||
try:
|
||||
shutil.rmtree(path)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
|
||||
def sanitize_path(name):
|
||||
return name.replace('/', '-')
|
||||
|
||||
|
||||
def get_current_revision():
|
||||
revision = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'],
|
||||
encoding='utf-8').strip()
|
||||
|
||||
if revision == 'HEAD':
|
||||
# This is a detached HEAD, get the commit hash
|
||||
revision = subprocess.check_output(['git', 'rev-parse', 'HEAD']).strip().decode('utf-8')
|
||||
|
||||
return revision
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def checkout_git_revision(revision):
|
||||
current_revision = get_current_revision()
|
||||
subprocess.check_call(['git', 'checkout', '-q', revision])
|
||||
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
subprocess.check_call(['git', 'checkout', '-q', current_revision])
|
||||
|
||||
|
||||
def build_install(revision):
|
||||
build_dir = '_build'
|
||||
dest_dir = os.path.abspath(sanitize_path(revision))
|
||||
print(format_title(f'# Building and installing {revision} in {dest_dir}'),
|
||||
end='\n\n', flush=True)
|
||||
|
||||
with checkout_git_revision(revision):
|
||||
rm_rf(build_dir)
|
||||
rm_rf(revision)
|
||||
|
||||
subprocess.check_call(['meson', build_dir,
|
||||
'--prefix=/usr', '--libdir=lib',
|
||||
'-Dx11-examples=false', '-Ddoc=false', '-Dgtk-examples=false'])
|
||||
subprocess.check_call(['ninja', '-v', '-C', build_dir])
|
||||
subprocess.check_call(['ninja', '-v', '-C', build_dir, 'install'],
|
||||
env={'DESTDIR': dest_dir})
|
||||
|
||||
return dest_dir
|
||||
|
||||
|
||||
def compare(old_tree, new_tree):
|
||||
print(format_title(f'# Comparing the two ABIs'), end='\n\n', flush=True)
|
||||
|
||||
old_headers = os.path.join(old_tree, 'usr', 'include')
|
||||
old_lib = os.path.join(old_tree, 'usr', 'lib', 'libfprint.so')
|
||||
|
||||
new_headers = os.path.join(new_tree, 'usr', 'include')
|
||||
new_lib = os.path.join(new_tree, 'usr', 'lib', 'libfprint.so')
|
||||
|
||||
subprocess.check_call([
|
||||
'abidiff', '--headers-dir1', old_headers, '--headers-dir2', new_headers,
|
||||
'--drop-private-types', '--fail-no-debug-info', '--no-added-syms', old_lib, new_lib])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
parser.add_argument('old', help='the previous revision, considered the reference')
|
||||
parser.add_argument('new', help='the new revision, to compare to the reference')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.old == args.new:
|
||||
print("Let's not waste time comparing something to itself")
|
||||
sys.exit(0)
|
||||
|
||||
old_tree = build_install(args.old)
|
||||
new_tree = build_install(args.new)
|
||||
|
||||
try:
|
||||
compare(old_tree, new_tree)
|
||||
|
||||
except Exception:
|
||||
sys.exit(1)
|
||||
|
||||
print(f'Hurray! {args.old} and {args.new} are ABI-compatible!')
|
||||
@@ -1,10 +0,0 @@
|
||||
# The commits that did automated reformatting. You can ignore them
|
||||
# during git-blame with `--ignore-rev` or `--ignore-revs-file`.
|
||||
#
|
||||
# $ git config --add 'blame.ignoreRevsFile' '.git-blame-ignore-revs'
|
||||
#
|
||||
|
||||
d1fb1e26f3b79e54febc94496c1184763cf2af3d
|
||||
e4f9935706be4c0e3253afe251c182019ff7ccef
|
||||
65e602d8c72baa7020efb62d10bf28e621feb05d
|
||||
4115ae7ced77d392ee11ea55212206d9404356f0
|
||||
@@ -1,3 +1,24 @@
|
||||
ltmain.sh
|
||||
missing
|
||||
stamp-h1
|
||||
libtool
|
||||
*.la
|
||||
*.lo
|
||||
*.o
|
||||
*.swp
|
||||
_build
|
||||
Makefile
|
||||
Makefile.in
|
||||
config.h*
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
config.guess
|
||||
config.log
|
||||
config.status
|
||||
config.sub
|
||||
configure
|
||||
depcomp
|
||||
install-sh
|
||||
.deps
|
||||
.libs
|
||||
compile
|
||||
ChangeLog
|
||||
|
||||
@@ -1,259 +1,64 @@
|
||||
include:
|
||||
- local: '.gitlab-ci/libfprint-image-variables.yaml'
|
||||
- local: '.gitlab-ci/libfprint-templates.yaml'
|
||||
- project: 'freedesktop/ci-templates'
|
||||
ref: master
|
||||
file: '/templates/fedora.yml'
|
||||
- remote: 'https://gitlab.gnome.org/GNOME/citemplates/-/raw/master/flatpak/flatpak_ci_initiative.yml'
|
||||
|
||||
default:
|
||||
# Auto-retry jobs in case of infra failures
|
||||
retry:
|
||||
max: 1
|
||||
when:
|
||||
- 'runner_system_failure'
|
||||
- 'stuck_or_timeout_failure'
|
||||
- 'scheduler_failure'
|
||||
- 'api_failure'
|
||||
|
||||
variables:
|
||||
extends: .libfprint_common_variables
|
||||
FDO_DISTRIBUTION_TAG: $LIBFPRINT_IMAGE_TAG
|
||||
FDO_DISTRIBUTION_VERSION: rawhide
|
||||
FDO_UPSTREAM_REPO: "libfprint/$CI_PROJECT_NAME"
|
||||
FEDORA_IMAGE: "$CI_REGISTRY/libfprint/$CI_PROJECT_NAME/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG"
|
||||
LAST_ABI_BREAK: "056ea541ddc97f5806cffbd99a12dc87e4da3546"
|
||||
|
||||
workflow:
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
||||
- if: $CI_PIPELINE_SOURCE == 'push'
|
||||
|
||||
image: fedora:rawhide
|
||||
stages:
|
||||
- image-build
|
||||
- check-source
|
||||
- build
|
||||
- test
|
||||
- flatpak
|
||||
|
||||
image: $FEDORA_IMAGE
|
||||
variables:
|
||||
DEPENDENCIES: libusb1-devel glib2-devel nss-devel pixman-devel systemd meson gtk-doc
|
||||
gcc gcc-c++ glibc-devel libX11-devel libXv-devel gtk3-devel flatpak-builder
|
||||
BUNDLE: "org.freedesktop.libfprint.Demo.flatpak"
|
||||
|
||||
.build_one_driver_template: &build_one_driver
|
||||
script:
|
||||
- dnf update -y --nogpgcheck && dnf install -y --nogpgcheck $DEPENDENCIES
|
||||
# Build with a driver that doesn't need imaging, or nss
|
||||
- meson setup _build --werror -Ddrivers=$driver
|
||||
- meson compile -C _build
|
||||
- meson -Ddrivers=elan . _build
|
||||
- ninja -C _build
|
||||
- rm -rf _build/
|
||||
|
||||
.build_template: &build
|
||||
script:
|
||||
- dnf update -y --nogpgcheck && dnf install -y --nogpgcheck $DEPENDENCIES
|
||||
# And build with everything
|
||||
- meson setup _build --werror -Ddrivers=all
|
||||
- meson compile -C _build
|
||||
- meson install -C _build
|
||||
|
||||
.build_template: &check_abi
|
||||
script:
|
||||
- ./.ci/check-abi ${LAST_ABI_BREAK} $(git rev-parse HEAD)
|
||||
- meson -Ddrivers=all . _build
|
||||
- ninja -C _build
|
||||
- ninja -C _build install
|
||||
|
||||
build:
|
||||
stage: build
|
||||
except:
|
||||
variables:
|
||||
- $CI_PIPELINE_SOURCE == "schedule"
|
||||
variables:
|
||||
driver: virtual_image
|
||||
<<: *build_one_driver
|
||||
<<: *build
|
||||
# <<: *check_abi
|
||||
artifacts:
|
||||
expose_as: "HTML Documentation"
|
||||
paths:
|
||||
- _build/doc/html
|
||||
- _build/doc/html/index.html
|
||||
expire_in: 1 week
|
||||
|
||||
test:
|
||||
stage: test
|
||||
except:
|
||||
variables:
|
||||
- $CI_PIPELINE_SOURCE == "schedule"
|
||||
.flatpak_script_template: &flatpak_script
|
||||
script:
|
||||
- meson setup _build --werror -Ddrivers=all -Db_coverage=true
|
||||
- meson test -C _build --print-errorlogs --no-stdsplit --timeout-multiplier 3
|
||||
- ninja -C _build coverage
|
||||
- cat _build/meson-logs/coverage.txt || true
|
||||
- flatpak-builder --stop-at=${FLATPAK_MODULE} app ${MANIFEST_PATH}
|
||||
# Make sure to keep this in sync with the Flatpak manifest, all arguments
|
||||
# are passed except the config-args because we build it ourselves
|
||||
- flatpak build app meson --prefix=/app --libdir=lib ${MESON_ARGS} _build
|
||||
- flatpak build app ninja -C _build install
|
||||
- flatpak build app rm -rf /app/include/ /app/lib/pkgconfig/
|
||||
- flatpak-builder --finish-only --repo=repo app ${MANIFEST_PATH}
|
||||
# Generate a Flatpak bundle
|
||||
- flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${DBUS_ID}
|
||||
|
||||
.flatpak_artifacts_template: &flatpak_artifacts
|
||||
artifacts:
|
||||
reports:
|
||||
junit: "_build/meson-logs/testlog.junit.xml"
|
||||
coverage_report:
|
||||
coverage_format: cobertura
|
||||
path: _build/meson-logs/coverage.xml
|
||||
expose_as: 'Coverage Report'
|
||||
paths:
|
||||
- ${BUNDLE}
|
||||
when: always
|
||||
paths:
|
||||
- _build/meson-logs
|
||||
- _build/meson-logs/coveragereport/index.html
|
||||
expire_in: 1 week
|
||||
coverage: '/^TOTAL.*\s+(\d+\%)$/'
|
||||
expire_in: 30 days
|
||||
|
||||
test_valgrind:
|
||||
.flatpak_template: &flatpak
|
||||
<<: *flatpak_script
|
||||
<<: *flatpak_artifacts
|
||||
|
||||
flatpak master:
|
||||
image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master
|
||||
stage: test
|
||||
allow_failure: true
|
||||
except:
|
||||
variables:
|
||||
- $CI_PIPELINE_SOURCE == "schedule"
|
||||
script:
|
||||
- meson setup _build -Ddrivers=all
|
||||
- meson compile -C _build
|
||||
- meson test -C _build --print-errorlogs --no-stdsplit --setup=valgrind
|
||||
artifacts:
|
||||
reports:
|
||||
junit: "_build/meson-logs/testlog-valgrind.junit.xml"
|
||||
expose_as: 'Valgrind test logs'
|
||||
when: always
|
||||
paths:
|
||||
- _build/meson-logs
|
||||
- _build/meson-logs/testlog-valgrind.txt
|
||||
expire_in: 1 week
|
||||
|
||||
test_installed:
|
||||
stage: test
|
||||
except:
|
||||
variables:
|
||||
- $CI_PIPELINE_SOURCE == "schedule"
|
||||
script:
|
||||
- meson setup _build --prefix=/usr -Ddrivers=all
|
||||
- meson install -C _build
|
||||
- mv _build _build_dir
|
||||
- rm -rf tests
|
||||
- gnome-desktop-testing-runner --list libfprint-2
|
||||
- gnome-desktop-testing-runner libfprint-2
|
||||
--report-directory=_installed-tests-report/failed/
|
||||
--log-directory=_installed-tests-report/logs/
|
||||
--parallel=0
|
||||
artifacts:
|
||||
expose_as: 'GNOME Tests Runner logs'
|
||||
when: always
|
||||
paths:
|
||||
- _build_dir/meson-logs
|
||||
- _installed-tests-report
|
||||
expire_in: 1 week
|
||||
|
||||
|
||||
test_scan_build:
|
||||
stage: test
|
||||
except:
|
||||
variables:
|
||||
- $CI_PIPELINE_SOURCE == "schedule"
|
||||
allow_failure: true
|
||||
script:
|
||||
- meson setup _build -Ddrivers=all
|
||||
# Wrapper to add --status-bugs and disable malloc checker
|
||||
- SCANBUILD=$CI_PROJECT_DIR/.gitlab-ci/scan-build
|
||||
ninja -C _build scan-build
|
||||
artifacts:
|
||||
when: on_failure
|
||||
paths:
|
||||
- _build/meson-logs
|
||||
expire_in: 1 week
|
||||
|
||||
test_indent:
|
||||
stage: check-source
|
||||
except:
|
||||
variables:
|
||||
- $CI_PIPELINE_SOURCE == "schedule"
|
||||
script:
|
||||
- scripts/uncrustify.sh
|
||||
- git diff
|
||||
- git diff-index --name-only --exit-code HEAD
|
||||
|
||||
test_unsupported_list:
|
||||
stage: check-source
|
||||
except:
|
||||
variables:
|
||||
- $CI_PIPELINE_SOURCE == "schedule"
|
||||
allow_failure: true
|
||||
script:
|
||||
- tests/hwdb-check-unsupported.py
|
||||
|
||||
flatpak:
|
||||
stage: flatpak
|
||||
extends: .flatpak@x86_64
|
||||
variables:
|
||||
MANIFEST_PATH: "demo/org.freedesktop.libfprint.Demo.json"
|
||||
# From demo/org.freedesktop.libfprint.Demo.json
|
||||
MESON_ARGS: "-Dudev_rules=false -Dx11-examples=false -Dgtk-examples=true"
|
||||
FLATPAK_MODULE: "libfprint"
|
||||
APP_ID: "org.freedesktop.libfprint.Demo"
|
||||
BUNDLE: "org.freedesktop.libfprint.Demo.flatpak"
|
||||
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
|
||||
# Build with any builder
|
||||
tags: []
|
||||
rules:
|
||||
- if: '$CI_PROJECT_PATH != "libfprint/libfprint"'
|
||||
when: manual
|
||||
allow_failure: true
|
||||
- if: '$CI_PIPELINE_SOURCE == "schedule"'
|
||||
when: never
|
||||
- if: '$CI_COMMIT_BRANCH == "master"'
|
||||
allow_failure: true
|
||||
when: always
|
||||
- if: '$CI_COMMIT_TAG'
|
||||
allow_failure: true
|
||||
when: always
|
||||
# For any other (commit), allow manual run.
|
||||
# This excludes MRs which would create a duplicate pipeline
|
||||
- if: '$CI_COMMIT_BRANCH'
|
||||
when: manual
|
||||
allow_failure: true
|
||||
- if: '$CI_MERGE_REQUEST_ID'
|
||||
when: manual
|
||||
allow_failure: true
|
||||
|
||||
# CONTAINERS creation stage
|
||||
.container_fedora_build_base:
|
||||
extends: .fdo.container-build@fedora
|
||||
stage: image-build
|
||||
only:
|
||||
variables:
|
||||
- $CI_PIPELINE_SOURCE == "never"
|
||||
variables:
|
||||
GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
|
||||
# a list of packages to install
|
||||
FDO_DISTRIBUTION_PACKAGES:
|
||||
$LIBFPRINT_DEPENDENCIES
|
||||
vala
|
||||
libpcap-devel
|
||||
libudev-devel
|
||||
FDO_DISTRIBUTION_EXEC: |
|
||||
$LIBFPRINT_EXEC
|
||||
|
||||
.container_fedora_build_forced:
|
||||
variables:
|
||||
FDO_FORCE_REBUILD: 1
|
||||
|
||||
container_fedora_build_schedule:
|
||||
extends:
|
||||
- .container_fedora_build_base
|
||||
- .container_fedora_build_forced
|
||||
only:
|
||||
variables:
|
||||
- $CI_PIPELINE_SOURCE == "schedule" && $CRON_TASK == "BUILD_CI_IMAGES"
|
||||
|
||||
container_fedora_build_manual:
|
||||
extends:
|
||||
- .container_fedora_build_base
|
||||
- .container_fedora_build_forced
|
||||
only:
|
||||
variables:
|
||||
- $LIBFPRINT_CI_ACTION == "build-image"
|
||||
|
||||
container_fedora_build_on_deps_changed:
|
||||
extends: .container_fedora_build_base
|
||||
only:
|
||||
variables:
|
||||
- $CI_PROJECT_NAMESPACE == "libfprint" && $CI_PIPELINE_SOURCE != "schedule"
|
||||
refs:
|
||||
- branches
|
||||
- merge_requests
|
||||
changes:
|
||||
- .gitlab-ci/libfprint-image-variables.yaml
|
||||
DBUS_ID: "org.freedesktop.libfprint.Demo"
|
||||
<<: *flatpak
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
variables:
|
||||
LIBFPRINT_IMAGE_TAG: v3
|
||||
@@ -1,49 +0,0 @@
|
||||
# Bump image version on .gitlab-ci/libfprint-image-variables.yaml to trigger
|
||||
# a rebuild on changes to this file
|
||||
|
||||
.libfprint_common_variables:
|
||||
LIBFPRINT_DEPENDENCIES:
|
||||
doxygen
|
||||
dnf-plugins-core
|
||||
flatpak-builder
|
||||
gcc
|
||||
gcc-c++
|
||||
gcovr
|
||||
git
|
||||
glib2-devel
|
||||
glibc-devel
|
||||
gobject-introspection-devel
|
||||
gnome-desktop-testing
|
||||
gtk-doc
|
||||
gtk3-devel
|
||||
libabigail
|
||||
libgusb-devel
|
||||
libgudev-devel
|
||||
libX11-devel
|
||||
libXv-devel
|
||||
meson
|
||||
nss-devel
|
||||
pixman-devel
|
||||
python3-cairo
|
||||
python3-gobject
|
||||
systemd
|
||||
umockdev
|
||||
uncrustify
|
||||
valgrind
|
||||
clang-analyzer
|
||||
diffutils
|
||||
|
||||
LIBFPRINT_EXEC: |
|
||||
dnf -y install dnf-utils
|
||||
debuginfo-install -y \
|
||||
glib2 \
|
||||
glibc \
|
||||
libgusb \
|
||||
libusb \
|
||||
nss \
|
||||
pixman
|
||||
|
||||
git clone https://github.com/martinpitt/umockdev.git && \
|
||||
cd umockdev && \
|
||||
meson _build --prefix=/usr && \
|
||||
ninja -C _build && ninja -C _build install
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This wrapper just disables the malloc checker
|
||||
exec /usr/bin/scan-build --status-bugs -disable-checker unix.Malloc "$@"
|
||||
@@ -3,29 +3,8 @@
|
||||
## GLib
|
||||
|
||||
Although the library uses GLib internally, libfprint is designed to provide
|
||||
a completely neutral interface to its application users. So, the public
|
||||
APIs should never return GLib data types.
|
||||
|
||||
## License clarification
|
||||
|
||||
Although this library's license could allow for shims that hook up into
|
||||
proprietary blobs to add driver support for some unsupported devices, the
|
||||
intent of the original authors, and of current maintainers of the library,
|
||||
was for this license to allow _integration into_ proprietary stacks, not
|
||||
_integration of_ proprietary code in the library.
|
||||
|
||||
As such, no code to integrate proprietary drivers will be accepted in libfprint
|
||||
upstream. Proprietary drivers would make it impossible to debug problems in
|
||||
libfprint, as we wouldn't know what the proprietary driver does behind the
|
||||
library's back. The closed source nature of drivers is usually used to hide
|
||||
parts of the hardware setup, such as encryption keys, or protocols, in order
|
||||
to protect the hardware's integrity. Unfortunately, this is only [security through
|
||||
obscurity](https://en.wikipedia.org/wiki/Security_through_obscurity).
|
||||
|
||||
We however encourage potential contributors to take advantage of libfprint's
|
||||
source availability to create such shims to make it easier to reverse-engineer
|
||||
proprietary drivers in order to create new free software drivers, to the extent
|
||||
permitted by local laws.
|
||||
a completely neutral interface to it's application users. So, the public
|
||||
APIs should never return GLib data types or anything like that.
|
||||
|
||||
## Two-faced-ness
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
Current maintainers of libfprint are:
|
||||
|
||||
* Benjamin Berg <bberg@redhat.com>
|
||||
* Marco Trevisan (Treviño) <mail@3v1n0.net>
|
||||
|
||||
Many drivers are not actively maintained and may not be fully functional.
|
||||
We are happy to receive contributions, but the support we can give is
|
||||
limitted unfortunately. For many drivers we may not even have test devices.
|
||||
|
||||
Maintained drivers are:
|
||||
* synaptics:
|
||||
Contributed and maintained by Synaptics Inc.
|
||||
Contact: Vincent Huang <vincent.huang@tw.synaptics.com>
|
||||
@@ -1,322 +1,6 @@
|
||||
This file lists notable changes in each release. For the full history of all
|
||||
changes, see ChangeLog.
|
||||
|
||||
2024-02-20: v1.94.7 release
|
||||
|
||||
Highlights:
|
||||
* synaptics: fix enroll identify problem after user reset database.
|
||||
* synaptics: New PIDs 0x0173, 0x0106, 0x0124.
|
||||
* goodixmoc: New PID 0x6582.
|
||||
* build: Do not require bash to build, only posix sh.
|
||||
* fp-image: Simplify minutiae detection tasks.
|
||||
* GLib 2.68 is now required to build libfprint.
|
||||
|
||||
New drivers:
|
||||
* realtek (PID 0x5813).
|
||||
* focaltech_moc (PIDs 0x9E48, 0xD979, 0xA959).
|
||||
* egismoc (PIDs 0x0582, 0x05a1).
|
||||
|
||||
2023-08-17: v1.94.6 release
|
||||
|
||||
Highlights:
|
||||
* goodixmoc: New PIDs 0x60A4, 0x60BC, 0x6092, 0x633C and 0x6304.
|
||||
* goodixmoc: Fix missing "enroll create" state.
|
||||
* elanmoc: New PID 0x0C99.
|
||||
* upektc: Improve compatibility with sensors 147e:2016.
|
||||
* aes4000: Actually support 08FF:5501 devices.
|
||||
* virtual-device-listener: Fix failing tests with GLib 2.76
|
||||
* tests: Add installed tests
|
||||
|
||||
Bugs fixed:
|
||||
* #526 libfprint: fpcmoc: use after free if enrollment or identification is
|
||||
cancelled (Vasily Khoruzhick)
|
||||
|
||||
2022-10-13: v1.94.5 release
|
||||
|
||||
Highlights:
|
||||
* New driver: fpcmoc, supporting various FPC MOC Fingerprint Sensors
|
||||
* goodixmoc: New PIDs 0x6014, 0x6094, 0x631C, 0x634C, 0x6384, 0x659A.
|
||||
* goodixmoc: Support resetting device on firmware failure due to corrupted DB.
|
||||
* elanmoc: New PIDs 0x0c88, 0x0c8c, 0x0c8d.
|
||||
* synaptics: New PID 0x0104.
|
||||
* upektc: New PID 0x2017.
|
||||
* Fixed various memory leaks
|
||||
* More tests
|
||||
|
||||
2022-05-24: v1.94.4 release
|
||||
|
||||
Highlights:
|
||||
* synaptics: New PIDs 0x0168, 0x015f
|
||||
* elan: New PID 0x0c4b
|
||||
* elanspi: New PID 0x241f
|
||||
* synaptics: Minor fix to interrupt transfer resubmission
|
||||
* Avoid sysfs writes if value is already expected
|
||||
* Improvements to the testing setup
|
||||
* Fixes to the internal critical section API
|
||||
|
||||
2021-11-02: v1.94.3 release
|
||||
|
||||
Highlights:
|
||||
* Ensure idle mainloop before completing enumeration (fprintd#119)
|
||||
* It is now possible to extend already enrolled prints
|
||||
* elanspi: Fix timeout error with some hardware (#438)
|
||||
* elanspi: Fix cancellation issues
|
||||
* goodixmoc: Return matching device print; fixes duplicate checking (#444)
|
||||
* goodixmoc: Support clearing the storage (usually unused)
|
||||
|
||||
2021-11-02: v1.94.2 release
|
||||
|
||||
Highlights:
|
||||
* goodixmoc: Fix protocol error with certain username lengths
|
||||
* elanmoc: New PID 0x0c7d
|
||||
* goodixmoc: New PID 0x63cc
|
||||
|
||||
2021-09-24: v1.94.1 release
|
||||
|
||||
Highlights:
|
||||
* Ship a simple script to create new CI tests using tshark
|
||||
* Added CI tests for elan, uru4000, aes2501
|
||||
* goodixmoc: Remove duplicate checking during enroll and let fprintd handle it
|
||||
* uru4000: Fix USB transfer type
|
||||
* synaptics: Support for new PIDs
|
||||
* goodixmoc: Support for new PIDs
|
||||
|
||||
2021-08-20: v1.94.0 release
|
||||
|
||||
Highlights:
|
||||
* Implement suspend/resume handling including USB wakeup configuration.
|
||||
This requires writing the "persist" and "wakeup" sysfs attributes.
|
||||
* Add simple temperature module to prevent devices from becoming too hot
|
||||
* Add feature for continuous scanning
|
||||
* New internal "critical section" API to simplify driver development
|
||||
* elan: new PID 0x0c58
|
||||
* elanmoc: Fixes for multi-user handling and FW changes
|
||||
* virtual-device: Do not time out for SCAN command
|
||||
|
||||
2021-06-30: v1.92.1 release
|
||||
|
||||
Highlights:
|
||||
* elanmoc: New driver for ELAN match-on-chip devices
|
||||
* egis0570: New driver for some Egis Technology devices
|
||||
* synaptics: Fix empty identify causing enroll issues
|
||||
* elan: Support more PIDs
|
||||
* misc: Architecture related bugfixes
|
||||
|
||||
2021-06-30: v1.92.0 release
|
||||
|
||||
Highlights:
|
||||
* Support for SPI devices was added together with the elanspi driver
|
||||
* Generate hwdb for autosuspend (which is now pulled by systemd)
|
||||
* An API was added to clear the device storage.
|
||||
Note: Devices may not implement the "list" API anymore.
|
||||
* Device features can now be queried using a common API
|
||||
|
||||
New drivers:
|
||||
* vfs7552
|
||||
* nb1010
|
||||
* elanspi
|
||||
|
||||
Driver changes:
|
||||
* uru4000: Fix deactivation when unplugged unexpectedly
|
||||
* goodixmoc: Correctly complete verify/identify after retry condition
|
||||
* goodixmoc: Support power shield feature
|
||||
* goodixmoc: Support new PIDs
|
||||
* synaptics: Fix driver lockup when sequence counter overflows (#358)
|
||||
* synaptics: Remove unnecessary device reset
|
||||
* synaptics: Support new PIDs
|
||||
* synaptics: Add clear_storage and remove list support
|
||||
* synaptics: Fix initialization if the device is still busy when opening
|
||||
* upeksonly: Fix double free in USB transfer callbacks
|
||||
* elan: Support new PIDs
|
||||
* vfs301: Fix leak of USB transfer
|
||||
* uru4000: Silence warning happening during startup
|
||||
|
||||
Internal API changes:
|
||||
* ssm: Add getter for the device
|
||||
* ssm: Add cleanup state feature
|
||||
* image-device: Allow overriding number of enroll stages
|
||||
* context: Support udev based device discovery
|
||||
* spi-transfer: Add SPI transfer helper routines
|
||||
|
||||
Other:
|
||||
* Use pcap based USB replay for CI
|
||||
* New virtual drivers for more advanced testing
|
||||
* Ensure async operations are run in the thread local main context
|
||||
* Disable drivers on big-endian unless they are verified to work
|
||||
* Add missing gobject-introspection dependency
|
||||
|
||||
|
||||
2020-12-01: v1.90.7 release
|
||||
|
||||
Highlights:
|
||||
* vfs5011: Fix possible use-after-free
|
||||
* goodixmoc: Add two new PIDs (0x63AC, 0x639C)
|
||||
* goodixmoc: Support finger status API
|
||||
* synaptics: Only identify within provided prints
|
||||
* synaptics: Reject devices with old firmware during probe (#239)
|
||||
|
||||
|
||||
2020-12-01: v1.90.6 release
|
||||
|
||||
This release is primarily a bugfix release for some older issues.
|
||||
|
||||
The major change is that fp_print_deserialize will now correctly return a
|
||||
sunken reference rather than a floating one. Most API users will have
|
||||
assumed this was true, and issues could happen at a later point.
|
||||
If any API user worked around this libfprint bug, they will now leak the
|
||||
returned print.
|
||||
|
||||
Highlights:
|
||||
* Object reference management fixes for FpPrint and identify
|
||||
* Fixed issues that caused problem on non-x86 machines (#236)
|
||||
* Fix building with older GLib versions
|
||||
* synaptics: Support PID 00e7
|
||||
* goodix: Fix issue with long USB packages
|
||||
|
||||
|
||||
2020-12-01: v1.90.5 release
|
||||
|
||||
The 1.90.4 release caused a major regression, as it included a USB hub in
|
||||
UDEV the autosupend rule list.
|
||||
|
||||
Highlights:
|
||||
* Remove USB hub from udev autosupend rules
|
||||
* synaptics: Add PID 0x00c9 which is used in some HP laptops
|
||||
|
||||
|
||||
2020-11-27: v1.90.4 release
|
||||
|
||||
This release contains a number of important bugfixes. On the feature side,
|
||||
the USB hotplug support was improved. A lot of drivers received fixes and
|
||||
improvements.
|
||||
|
||||
Highlights:
|
||||
* Work around GUsb cancellation issue
|
||||
* Redefine internal image device state machine for more robustness
|
||||
* Add public finger-status reporting to FpDevice
|
||||
* Rework device removal API to be convenient (#330)
|
||||
* Enable powersave for unsupported USB devices
|
||||
* Improvements to examples
|
||||
* synaptics: Support identify operation
|
||||
* synaptics: Fix possible crash when the interrupt transfer is resubmitted
|
||||
* synaptics: Add support for PIDs 0x00f9, 0x00fc and 0x00c2
|
||||
* elan: Add PID 0x0c4d to supported device list
|
||||
* aes3k: Fix driver and add CI test (#306)
|
||||
* uru4000: Fix reference counting of image transfer
|
||||
* vfs301: Fix driver and add CI test (#320)
|
||||
|
||||
2020-06-08: v1.90.3 release
|
||||
|
||||
This release mostly contains support for a number of new match-on-chip
|
||||
devices. Most notable is the addition of the new goodixmoc driver.
|
||||
Currently the driver has the small caveat that we have no strategy to
|
||||
garbage collect old prints yet (a simple strategy could be implemented
|
||||
in fprintd).
|
||||
|
||||
Highlights:
|
||||
* New goodixmoc driver supporting Goodix USB devices:
|
||||
27C6:5840
|
||||
27C6:6496
|
||||
27C6:60A2
|
||||
* Newly added support for Synaptics device:
|
||||
06CB:00E9
|
||||
06CB:00DF
|
||||
* Fixed an issue with Synaptics devices sometimes not working at boot
|
||||
* Fix issue with aes3k driver (#306)
|
||||
|
||||
2020-06-08: v1.90.2 release
|
||||
|
||||
This release contains a large amount of bug and regression fixes. These
|
||||
are not listed explicitly, but affect the majority of drivers.
|
||||
|
||||
Highlights:
|
||||
* A patch for nbis required for some sensors was accidentally dropped in
|
||||
an earlier release. Users of these sensors/drivers (aes1610, aes2501,
|
||||
aes2550, aes1660, aes2660, elan, upektc_img) need to re-enroll (#142).
|
||||
|
||||
2019-11-20: v1.90.1 release
|
||||
|
||||
This release fixes a lot of the regressions introduced in 1.90.0. Please note
|
||||
that both the driver and external APIs have changed, as both the verify and
|
||||
the identify functions now have early reporting mechanisms.
|
||||
The soname for the library, as well as a number of file locations have also
|
||||
changed. While this allows installation in parallel with the 1.0 version of
|
||||
libfprint, we recommend installing only one, and migrating from version 1.0 to
|
||||
version 2.0 alongside its main consumer (fprintd).
|
||||
|
||||
Only major changes are listed below. A lot of other cleanup work and small
|
||||
fixes have also been merged.
|
||||
|
||||
* Library:
|
||||
- Add support to run tests in gdb/valgrind
|
||||
- Allow testing on all architectures
|
||||
- Avoid image device AWAIT_FINGER_ON to deactivate state transitions
|
||||
- Fix verify/identify error propagation to library user
|
||||
- Correctly read image device information from class data
|
||||
- Continue enroll after an image driver reported a retry error
|
||||
- Change external API to allow reporting match results early
|
||||
- A lot of new unit tests and integration tests have been added
|
||||
|
||||
* Drivers API
|
||||
- Support variadic arguments in error functions
|
||||
- Various re-definitions of ownership handling
|
||||
- Add convenience API to change state after a timeout
|
||||
- Add unit tests for all the drivers API
|
||||
|
||||
* Drivers:
|
||||
- elan: Ensure correct deactivation of device
|
||||
- uru4000: Fix IRQ handler registration and internal state handling
|
||||
- uru4000: Fix control transfer request type
|
||||
- synaptics: Ensure errors are only reported after finger removal
|
||||
|
||||
2019-11-20: v1.90.0 release
|
||||
|
||||
This release updates the core of the library to use GLib routines and Gio
|
||||
style APIs. While the API both for library users remain similar in most
|
||||
ways, there are some changes and all users will need to be ported.
|
||||
|
||||
A large motivation for the in-depth changes was the requirement to add
|
||||
new API to support sensors that store the prints on the sensor. This
|
||||
support is already used by the new synaptics driver, which will support
|
||||
the current generation of the Prometheus MIS (match-in-sensor) chipset
|
||||
by Synaptics (USB ID 06cb:00bd).
|
||||
|
||||
The current codebase is considered stable at this point. However, due to
|
||||
the lack of wider testing it is only released as a 1.90.0 release which
|
||||
can be considered a beta-release for 2.0.
|
||||
|
||||
With the rewrite, it is now also possible to support devices that are not
|
||||
connected through USB (e.g. I2C). Another major improvement is that the
|
||||
library has now a test suite, testing both the library core and allowing
|
||||
tests of the drivers using umockdev.
|
||||
|
||||
2019-08-08: v1.0 release
|
||||
* Library:
|
||||
- Add guards to the public API and require GLib 2.50
|
||||
- Deprecate print storage API
|
||||
- Better documentation for fp_discover_devs()
|
||||
- Remove unused internal fpi_timeout_cancel_for_dev()
|
||||
- Remove state from fp_img_driver activate handler
|
||||
- Bug fixes related to restarting a failed verification immediately
|
||||
|
||||
* Drivers:
|
||||
- The Elan driver received a lot of bug fixes including a fix for a
|
||||
hang when verifying prints with fprintd, quirks for some devices,
|
||||
a memory leak fix and support for 04f3:0c42
|
||||
- Fix a probable crash in all the AES drivers
|
||||
- Add support for Lenovo Preferred Pro Keyboard (KUF1256) to vfs5011
|
||||
- Prevent hang during enroll process in etes603 driver
|
||||
- Fix possible integer overflow in uru4000
|
||||
- Work-around SELinux AVC warnings when uru4000 driver starts
|
||||
- Remove long-unmaintained and broken fdu2000 driver
|
||||
|
||||
* Tools/Examples:
|
||||
- Fix examples not working due to an overly strict check
|
||||
- Fix crash in GTK demo when there's no supported devices
|
||||
- Disable GTK demo until we have a USB Flatpak portal
|
||||
- Remove sleep() in enroll example which caused a crash in some drivers
|
||||
- Add a simple storage implementation example
|
||||
|
||||
2018-12-14: v0.99.0 release
|
||||
* Library:
|
||||
- All the internal API for device driver writers is now covered by the
|
||||
@@ -372,7 +56,7 @@ tests of the drivers using umockdev.
|
||||
- Mark fp_dscv_print functions as deprecated
|
||||
|
||||
* Udev rules:
|
||||
- Add some unsupported devices to the allowlist
|
||||
- Add some unsupported devices to the whitelist
|
||||
|
||||
2017-05-14: v0.7.0 release
|
||||
* Drivers:
|
||||
@@ -422,7 +106,7 @@ tests of the drivers using umockdev.
|
||||
- Fix possible race condition, and cancellation in uru4000 driver
|
||||
|
||||
* Udev rules:
|
||||
- Add Microsoft keyboard to the suspend denylist
|
||||
- Add Microsoft keyboard to the suspend blacklist
|
||||
|
||||
* Plenty of build fixes
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
### libfprint-TOD v1
|
||||
|
||||
- First public release
|
||||
- Based on [libfprint 1.90.1](https://gitlab.freedesktop.org/libfprint/libfprint/-/releases#v1.90.1)
|
||||
- Bumped TOD version to 1
|
||||
|
||||
### Highlights of the Drivers API changes
|
||||
|
||||
Both the driver and external APIs have changed, as both the verify and the identify functions now have early reporting mechanisms.
|
||||
|
||||
- Added API for early report of matching results or retry errors
|
||||
- Verify and identification completion functions have been simplified
|
||||
- Support variadic arguments in error functions
|
||||
- Various re-definitions of ownership handling
|
||||
- Add convenience API to change state after a timeout
|
||||
- Add unit tests for all the drivers API
|
||||
|
||||
### Drivers required changes
|
||||
As per the early report mechanism, drivers need to adapt, in particular:
|
||||
- New pkg-config dependency name is `libfprint-2-tod-1`
|
||||
- Verification and Identification API for non-image drivers has changed and drivers need to both `report` the result of the action and complete it:
|
||||
- `fpi_device_{verify,identify}_report` must inform whether a match/no-match or identification happened or report a *retry error*.
|
||||
- `fpi_device_{verify,identify}_complete` must be called once the device has completed the verification / identification process, in case reporting device errors (not retry ones!)
|
||||
|
||||
You can see examples of changes needed in the [reference example driver](https://gitlab.freedesktop.org/3v1n0/libfprint-tod-example-driver/-/commit/8308f84f7d1cfd1b9ed0936c13c73b43a4a46772) or the [upstream synaptics driver](https://gitlab.freedesktop.org/libfprint/libfprint/-/merge_requests/112/diffs)
|
||||
@@ -0,0 +1,51 @@
|
||||
libfprint
|
||||
=========
|
||||
|
||||
libfprint is part of the fprint project:
|
||||
https://fprint.freedesktop.org/
|
||||
|
||||
libfprint was originally developed as part of an academic project at the
|
||||
University of Manchester with the aim of hiding differences between different
|
||||
consumer fingerprint scanners and providing a single uniform API to application
|
||||
developers. The ultimate goal of the fprint project is to make fingerprint
|
||||
scanners widely and easily usable under common Linux environments.
|
||||
|
||||
The academic university project runs off a codebase maintained separately
|
||||
from this one, although I try to keep them as similar as possible (I'm not
|
||||
hiding anything in the academic branch, it's just the open source release
|
||||
contains some commits excluded from the academic project).
|
||||
|
||||
THE UNIVERSITY OF MANCHESTER DOES NOT ENDORSE THIS THIS SOFTWARE RELEASE AND
|
||||
IS IN NO WAY RESPONSIBLE FOR THE CODE CONTAINED WITHIN, OR ANY DAMAGES CAUSED
|
||||
BY USING OR DISTRIBUTING THE SOFTWARE. Development does not happen on
|
||||
university computers and the project is not hosted at the university either.
|
||||
|
||||
For more information on libfprint, supported devices, API documentation, etc.,
|
||||
see the homepage:
|
||||
https://fprint.freedesktop.org/
|
||||
|
||||
libfprint is licensed under the GNU LGPL version 2.1. See the COPYING file
|
||||
for the license text.
|
||||
|
||||
Section 6 of the license states that for compiled works that use this
|
||||
library, such works must include libfprint copyright notices alongside the
|
||||
copyright notices for the other parts of the work. We have attempted to
|
||||
make this process slightly easier for you by grouping these all in one place:
|
||||
the AUTHORS file.
|
||||
|
||||
libfprint includes code from NIST's NBIS software distribution:
|
||||
http://fingerprint.nist.gov/NBIS/index.html
|
||||
We include bozorth3 from the US export controlled distribution. We have
|
||||
determined that it is fine to ship bozorth3 in an open source project,
|
||||
see https://fprint.freedesktop.org/us-export-control.html
|
||||
|
||||
## Historical links
|
||||
|
||||
Older versions of libfprint are available at:
|
||||
https://sourceforge.net/projects/fprint/files/
|
||||
|
||||
Historical mailing-list archives:
|
||||
http://www.reactivated.net/fprint_list_archives/
|
||||
|
||||
Historical website:
|
||||
http://web.archive.org/web/*/https://www.freedesktop.org/wiki/Software/fprint/
|
||||
@@ -1,90 +0,0 @@
|
||||
|
||||
|
||||
<div align="center">
|
||||
|
||||
# LibFPrint
|
||||
|
||||
*LibFPrint is part of the **[FPrint][Website]** project.*
|
||||
|
||||
<br/>
|
||||
|
||||
[![Button Website]][Website]
|
||||
[![Button Documentation]][Documentation]
|
||||
|
||||
[![Button Supported]][Supported]
|
||||
[![Button Unsupported]][Unsupported]
|
||||
|
||||
[![Button Contribute]][Contribute]
|
||||
[![Button Contributors]][Contributors]
|
||||
|
||||
</div>
|
||||
|
||||
## TOD Informations
|
||||
|
||||
See https://gitlab.freedesktop.org/3v1n0/libfprint/-/blob/tod/README.tod.md
|
||||
|
||||
## History
|
||||
|
||||
**LibFPrint** was originally developed as part of an
|
||||
academic project at the **[University Of Manchester]**.
|
||||
|
||||
It aimed to hide the differences between consumer
|
||||
fingerprint scanners and provide a single uniform
|
||||
API to application developers.
|
||||
|
||||
## Goal
|
||||
|
||||
The ultimate goal of the **FPrint** project is to make
|
||||
fingerprint scanners widely and easily usable under
|
||||
common Linux environments.
|
||||
|
||||
## License
|
||||
|
||||
`Section 6` of the license states that for compiled works that use
|
||||
this library, such works must include **LibFPrint** copyright notices
|
||||
alongside the copyright notices for the other parts of the work.
|
||||
|
||||
**LibFPrint** includes code from **NIST's** **[NBIS]** software distribution.
|
||||
|
||||
We include **Bozorth3** from the **[US Export Controlled]**
|
||||
distribution, which we have determined to be fine
|
||||
being shipped in an open source project.
|
||||
|
||||
<br/>
|
||||
|
||||
<div align="right">
|
||||
|
||||
[![Badge License]][License]
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!----------------------------------------------------------------------------->
|
||||
|
||||
[Documentation]: https://fprint.freedesktop.org/libfprint-dev/
|
||||
[Contributors]: https://gitlab.freedesktop.org/libfprint/libfprint/-/graphs/master
|
||||
[Unsupported]: https://gitlab.freedesktop.org/libfprint/wiki/-/wikis/Unsupported-Devices
|
||||
[Supported]: https://fprint.freedesktop.org/supported-devices.html
|
||||
[Website]: https://fprint.freedesktop.org/
|
||||
|
||||
[Contribute]: ./HACKING.md
|
||||
[License]: ./COPYING
|
||||
|
||||
[University Of Manchester]: https://www.manchester.ac.uk/
|
||||
[US Export Controlled]: https://fprint.freedesktop.org/us-export-control.html
|
||||
[NBIS]: http://fingerprint.nist.gov/NBIS/index.html
|
||||
|
||||
|
||||
<!---------------------------------[ Badges ]---------------------------------->
|
||||
|
||||
[Badge License]: https://img.shields.io/badge/License-LGPL2.1-015d93.svg?style=for-the-badge&labelColor=blue
|
||||
|
||||
|
||||
<!---------------------------------[ Buttons ]--------------------------------->
|
||||
|
||||
[Button Documentation]: https://img.shields.io/badge/Documentation-04ACE6?style=for-the-badge&logoColor=white&logo=BookStack
|
||||
[Button Contributors]: https://img.shields.io/badge/Contributors-FF4F8B?style=for-the-badge&logoColor=white&logo=ActiGraph
|
||||
[Button Unsupported]: https://img.shields.io/badge/Unsupported_Devices-EF2D5E?style=for-the-badge&logoColor=white&logo=AdBlock
|
||||
[Button Contribute]: https://img.shields.io/badge/Contribute-66459B?style=for-the-badge&logoColor=white&logo=Git
|
||||
[Button Supported]: https://img.shields.io/badge/Supported_Devices-428813?style=for-the-badge&logoColor=white&logo=AdGuard
|
||||
[Button Website]: https://img.shields.io/badge/Homepage-3B80AE?style=for-the-badge&logoColor=white&logo=freedesktopDotOrg
|
||||
@@ -1,9 +0,0 @@
|
||||
### libfprint-TOD - libfprint for Touch OEM Drivers
|
||||
|
||||
This is a light fork of libfprint to expose internal Drivers API in order to
|
||||
create drivers as shared libraries.
|
||||
|
||||
Fork is hosted at: https://gitlab.freedesktop.org/3v1n0/libfprint/tree/tod
|
||||
|
||||
An example driver implementation is available:
|
||||
- https://gitlab.freedesktop.org/3v1n0/libfprint-tod-example-driver
|
||||
@@ -0,0 +1,30 @@
|
||||
LIBRARY
|
||||
=======
|
||||
test suite against NFIQ compliance set
|
||||
make library optionally asynchronous and maybe thread-safe
|
||||
nbis cleanups
|
||||
API function to determine if img device supports uncond. capture
|
||||
race-free way of saying "save this print but don't overwrite"
|
||||
|
||||
NEW DRIVERS
|
||||
===========
|
||||
Sunplus 895 driver
|
||||
AES3400/3500 driver
|
||||
ID Mouse driver
|
||||
Support for 2nd generation MS devices
|
||||
Support for 2nd generation UPEK devices
|
||||
|
||||
IMAGING
|
||||
=======
|
||||
ignore first frame or two with aes2501
|
||||
aes2501: increase threshold "sum" for end-of-image detection
|
||||
aes2501 gain calibration
|
||||
aes4000 gain calibration
|
||||
aes4000 resampling
|
||||
PPMM parameter to get_minutiae seems to have no effect
|
||||
nbis minutiae should be stored in endian-independent format
|
||||
|
||||
PORTABILITY
|
||||
===========
|
||||
OpenBSD can't do -Wshadow or visibility
|
||||
OpenBSD: add compat codes for ENOTSUP ENODATA and EPROTO
|
||||
@@ -1,3 +0,0 @@
|
||||
This project and its community follow the [Freedesktop.org code of conduct]
|
||||
|
||||
[Freedesktop.org code of conduct]: https://www.freedesktop.org/wiki/CodeOfConduct/
|
||||
@@ -1,416 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# This file has been generated using fprint-list-udev-hwdb with all drivers enabled
|
||||
|
||||
# Supported by libfprint driver aes1610
|
||||
usb:v08FFp1600*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver aes1660
|
||||
usb:v08FFp1660*
|
||||
usb:v08FFp1680*
|
||||
usb:v08FFp1681*
|
||||
usb:v08FFp1682*
|
||||
usb:v08FFp1683*
|
||||
usb:v08FFp1684*
|
||||
usb:v08FFp1685*
|
||||
usb:v08FFp1686*
|
||||
usb:v08FFp1687*
|
||||
usb:v08FFp1688*
|
||||
usb:v08FFp1689*
|
||||
usb:v08FFp168A*
|
||||
usb:v08FFp168B*
|
||||
usb:v08FFp168C*
|
||||
usb:v08FFp168D*
|
||||
usb:v08FFp168E*
|
||||
usb:v08FFp168F*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver aes2501
|
||||
usb:v08FFp2500*
|
||||
usb:v08FFp2580*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver aes2550
|
||||
usb:v08FFp2550*
|
||||
usb:v08FFp2810*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver aes2660
|
||||
usb:v08FFp2660*
|
||||
usb:v08FFp2680*
|
||||
usb:v08FFp2681*
|
||||
usb:v08FFp2682*
|
||||
usb:v08FFp2683*
|
||||
usb:v08FFp2684*
|
||||
usb:v08FFp2685*
|
||||
usb:v08FFp2686*
|
||||
usb:v08FFp2687*
|
||||
usb:v08FFp2688*
|
||||
usb:v08FFp2689*
|
||||
usb:v08FFp268A*
|
||||
usb:v08FFp268B*
|
||||
usb:v08FFp268C*
|
||||
usb:v08FFp268D*
|
||||
usb:v08FFp268E*
|
||||
usb:v08FFp268F*
|
||||
usb:v08FFp2691*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver aes3500
|
||||
usb:v08FFp5731*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver aes4000
|
||||
usb:v08FFp5501*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver egis0570
|
||||
usb:v1C7Ap0570*
|
||||
usb:v1C7Ap0571*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver egismoc
|
||||
usb:v1C7Ap0582*
|
||||
usb:v1C7Ap05A1*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver elan
|
||||
usb:v04F3p0903*
|
||||
usb:v04F3p0907*
|
||||
usb:v04F3p0C01*
|
||||
usb:v04F3p0C02*
|
||||
usb:v04F3p0C03*
|
||||
usb:v04F3p0C04*
|
||||
usb:v04F3p0C05*
|
||||
usb:v04F3p0C06*
|
||||
usb:v04F3p0C07*
|
||||
usb:v04F3p0C08*
|
||||
usb:v04F3p0C09*
|
||||
usb:v04F3p0C0A*
|
||||
usb:v04F3p0C0B*
|
||||
usb:v04F3p0C0C*
|
||||
usb:v04F3p0C0D*
|
||||
usb:v04F3p0C0E*
|
||||
usb:v04F3p0C0F*
|
||||
usb:v04F3p0C10*
|
||||
usb:v04F3p0C11*
|
||||
usb:v04F3p0C12*
|
||||
usb:v04F3p0C13*
|
||||
usb:v04F3p0C14*
|
||||
usb:v04F3p0C15*
|
||||
usb:v04F3p0C16*
|
||||
usb:v04F3p0C17*
|
||||
usb:v04F3p0C18*
|
||||
usb:v04F3p0C19*
|
||||
usb:v04F3p0C1A*
|
||||
usb:v04F3p0C1B*
|
||||
usb:v04F3p0C1C*
|
||||
usb:v04F3p0C1D*
|
||||
usb:v04F3p0C1E*
|
||||
usb:v04F3p0C1F*
|
||||
usb:v04F3p0C20*
|
||||
usb:v04F3p0C21*
|
||||
usb:v04F3p0C22*
|
||||
usb:v04F3p0C23*
|
||||
usb:v04F3p0C24*
|
||||
usb:v04F3p0C25*
|
||||
usb:v04F3p0C26*
|
||||
usb:v04F3p0C27*
|
||||
usb:v04F3p0C28*
|
||||
usb:v04F3p0C29*
|
||||
usb:v04F3p0C2A*
|
||||
usb:v04F3p0C2B*
|
||||
usb:v04F3p0C2C*
|
||||
usb:v04F3p0C2D*
|
||||
usb:v04F3p0C2E*
|
||||
usb:v04F3p0C2F*
|
||||
usb:v04F3p0C30*
|
||||
usb:v04F3p0C31*
|
||||
usb:v04F3p0C32*
|
||||
usb:v04F3p0C33*
|
||||
usb:v04F3p0C3D*
|
||||
usb:v04F3p0C42*
|
||||
usb:v04F3p0C4B*
|
||||
usb:v04F3p0C4D*
|
||||
usb:v04F3p0C4F*
|
||||
usb:v04F3p0C63*
|
||||
usb:v04F3p0C6E*
|
||||
usb:v04F3p0C58*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver elanmoc
|
||||
usb:v04F3p0C7D*
|
||||
usb:v04F3p0C7E*
|
||||
usb:v04F3p0C82*
|
||||
usb:v04F3p0C88*
|
||||
usb:v04F3p0C8C*
|
||||
usb:v04F3p0C8D*
|
||||
usb:v04F3p0C99*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver etes603
|
||||
usb:v1C7Ap0603*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver focaltech_moc
|
||||
usb:v2808p9E48*
|
||||
usb:v2808pD979*
|
||||
usb:v2808pA959*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver fpcmoc
|
||||
usb:v10A5pFFE0*
|
||||
usb:v10A5pA305*
|
||||
usb:v10A5pDA04*
|
||||
usb:v10A5pD805*
|
||||
usb:v10A5pD205*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver goodixmoc
|
||||
usb:v27C6p5840*
|
||||
usb:v27C6p6014*
|
||||
usb:v27C6p6092*
|
||||
usb:v27C6p6094*
|
||||
usb:v27C6p609C*
|
||||
usb:v27C6p60A2*
|
||||
usb:v27C6p60A4*
|
||||
usb:v27C6p60BC*
|
||||
usb:v27C6p6304*
|
||||
usb:v27C6p631C*
|
||||
usb:v27C6p633C*
|
||||
usb:v27C6p634C*
|
||||
usb:v27C6p6384*
|
||||
usb:v27C6p639C*
|
||||
usb:v27C6p63AC*
|
||||
usb:v27C6p63BC*
|
||||
usb:v27C6p63CC*
|
||||
usb:v27C6p6496*
|
||||
usb:v27C6p6582*
|
||||
usb:v27C6p6584*
|
||||
usb:v27C6p658C*
|
||||
usb:v27C6p6592*
|
||||
usb:v27C6p6594*
|
||||
usb:v27C6p659A*
|
||||
usb:v27C6p659C*
|
||||
usb:v27C6p6A94*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver nb1010
|
||||
usb:v298Dp1010*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver realtek
|
||||
usb:v0BDAp5813*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver synaptics
|
||||
usb:v06CBp00BD*
|
||||
usb:v06CBp00DF*
|
||||
usb:v06CBp00F9*
|
||||
usb:v06CBp00FC*
|
||||
usb:v06CBp00C2*
|
||||
usb:v06CBp0100*
|
||||
usb:v06CBp00F0*
|
||||
usb:v06CBp0103*
|
||||
usb:v06CBp0123*
|
||||
usb:v06CBp0124*
|
||||
usb:v06CBp0126*
|
||||
usb:v06CBp0129*
|
||||
usb:v06CBp0168*
|
||||
usb:v06CBp015F*
|
||||
usb:v06CBp0104*
|
||||
usb:v06CBp0173*
|
||||
usb:v06CBp0106*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver upeksonly
|
||||
usb:v147Ep2016*
|
||||
usb:v147Ep1000*
|
||||
usb:v147Ep1001*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver upektc
|
||||
usb:v0483p2015*
|
||||
usb:v0483p2017*
|
||||
usb:v147Ep3001*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver upektc_img
|
||||
usb:v147Ep2020*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver uru4000
|
||||
usb:v045Ep00BC*
|
||||
usb:v045Ep00BD*
|
||||
usb:v045Ep00CA*
|
||||
usb:v05BAp0007*
|
||||
usb:v05BAp0008*
|
||||
usb:v05BAp000A*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver vcom5s
|
||||
usb:v061Ap0110*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver vfs0050
|
||||
usb:v138Ap0050*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver vfs101
|
||||
usb:v138Ap0001*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver vfs301
|
||||
usb:v138Ap0005*
|
||||
usb:v138Ap0008*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver vfs5011
|
||||
usb:v138Ap0010*
|
||||
usb:v138Ap0011*
|
||||
usb:v138Ap0015*
|
||||
usb:v138Ap0017*
|
||||
usb:v138Ap0018*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver vfs7552
|
||||
usb:v138Ap0091*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Known unsupported devices
|
||||
usb:v047Dp00F2*
|
||||
usb:v04E8p730B*
|
||||
usb:v04F3p036B*
|
||||
usb:v04F3p0C00*
|
||||
usb:v04F3p0C4C*
|
||||
usb:v04F3p0C57*
|
||||
usb:v04F3p0C5E*
|
||||
usb:v04F3p0C5A*
|
||||
usb:v04F3p0C6C*
|
||||
usb:v04F3p0C70*
|
||||
usb:v04F3p0C72*
|
||||
usb:v04F3p0C77*
|
||||
usb:v04F3p2706*
|
||||
usb:v04F3p3032*
|
||||
usb:v04F3p3057*
|
||||
usb:v04F3p3104*
|
||||
usb:v04F3p310D*
|
||||
usb:v04F3p3128*
|
||||
usb:v06CBp0081*
|
||||
usb:v06CBp0088*
|
||||
usb:v06CBp008A*
|
||||
usb:v06CBp009A*
|
||||
usb:v06CBp009B*
|
||||
usb:v06CBp00A2*
|
||||
usb:v06CBp00A8*
|
||||
usb:v06CBp00B7*
|
||||
usb:v06CBp00BB*
|
||||
usb:v06CBp00BE*
|
||||
usb:v06CBp00C4*
|
||||
usb:v06CBp00CB*
|
||||
usb:v06CBp00C9*
|
||||
usb:v06CBp00D8*
|
||||
usb:v06CBp00DA*
|
||||
usb:v06CBp00DC*
|
||||
usb:v06CBp00E4*
|
||||
usb:v06CBp00E7*
|
||||
usb:v06CBp00E9*
|
||||
usb:v06CBp00FD*
|
||||
usb:v0A5Cp5801*
|
||||
usb:v0A5Cp5805*
|
||||
usb:v0A5Cp5834*
|
||||
usb:v0A5Cp5840*
|
||||
usb:v0A5Cp5841*
|
||||
usb:v0A5Cp5842*
|
||||
usb:v0A5Cp5843*
|
||||
usb:v0A5Cp5844*
|
||||
usb:v0A5Cp5845*
|
||||
usb:v0BDAp5812*
|
||||
usb:v10A5p0007*
|
||||
usb:v10A5p9200*
|
||||
usb:v10A5p9800*
|
||||
usb:v10A5pE340*
|
||||
usb:v1188p9545*
|
||||
usb:v138Ap0007*
|
||||
usb:v138Ap003A*
|
||||
usb:v138Ap003C*
|
||||
usb:v138Ap003D*
|
||||
usb:v138Ap003F*
|
||||
usb:v138Ap0090*
|
||||
usb:v138Ap0092*
|
||||
usb:v138Ap0094*
|
||||
usb:v138Ap0097*
|
||||
usb:v138Ap009D*
|
||||
usb:v138Ap00AB*
|
||||
usb:v138Ap00A6*
|
||||
usb:v147Ep1002*
|
||||
usb:v1491p0088*
|
||||
usb:v16D1p1027*
|
||||
usb:v1C7Ap0300*
|
||||
usb:v1C7Ap0575*
|
||||
usb:v1C7Ap0576*
|
||||
usb:v1C7Ap0577*
|
||||
usb:v27C6p5042*
|
||||
usb:v27C6p5110*
|
||||
usb:v27C6p5117*
|
||||
usb:v27C6p5120*
|
||||
usb:v27C6p5125*
|
||||
usb:v27C6p5201*
|
||||
usb:v27C6p521D*
|
||||
usb:v27C6p5301*
|
||||
usb:v27C6p530C*
|
||||
usb:v27C6p532D*
|
||||
usb:v27C6p5335*
|
||||
usb:v27C6p533C*
|
||||
usb:v27C6p5381*
|
||||
usb:v27C6p5385*
|
||||
usb:v27C6p538C*
|
||||
usb:v27C6p538D*
|
||||
usb:v27C6p5395*
|
||||
usb:v27C6p5503*
|
||||
usb:v27C6p550A*
|
||||
usb:v27C6p550C*
|
||||
usb:v27C6p5584*
|
||||
usb:v27C6p55A2*
|
||||
usb:v27C6p55A4*
|
||||
usb:v27C6p55B4*
|
||||
usb:v27C6p5740*
|
||||
usb:v27C6p5E0A*
|
||||
usb:v27C6p581A*
|
||||
usb:v27C6p589A*
|
||||
usb:v27C6p6382*
|
||||
usb:v2808p9338*
|
||||
usb:v2808p93A9*
|
||||
usb:v298Dp2020*
|
||||
usb:v298Dp2033*
|
||||
usb:v3538p0930*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
@@ -1,11 +0,0 @@
|
||||
if udev_hwdb_dir != ''
|
||||
# This file has to be updated using
|
||||
# ninja -C <builddir> libfprint/sync-udev-hwdb
|
||||
# Note that the unsupported device list needs to be manually synced from
|
||||
# the wiki. See comment in libfprint/fprint-list-uev-hwdb.c
|
||||
|
||||
install_data('autosuspend.hwdb',
|
||||
rename: '60-autosuspend-@0@.hwdb'.format(versioned_libname),
|
||||
install_dir: udev_hwdb_dir,
|
||||
)
|
||||
endif
|
||||
@@ -1,10 +0,0 @@
|
||||
The libfprint-2-2 postinst script calls udevadmin trigger for all the supported
|
||||
USB readers. The list of readers used in that file is generated using the gbp
|
||||
import hook when `gbp import-orig` (via --uscan or with a tarball) is used.
|
||||
|
||||
Alternatively it can be called manually by using:
|
||||
|
||||
GBP_SOURCES_DIR=. debian/update-udev-triggers.sh
|
||||
|
||||
When preparing a new upstream release, this script should be called against the
|
||||
upstream provided .hwdb file.
|
||||
@@ -1,14 +0,0 @@
|
||||
### libfprint-TOD - libfprint for Touch OEM Drivers
|
||||
|
||||
This is a light fork of libfprint to expose internal Drivers API in order to
|
||||
create drivers as shared libraries.
|
||||
|
||||
Fork is hosted at: https://gitlab.freedesktop.org/3v1n0/libfprint/tree/tod
|
||||
|
||||
Packaging for this is handled via gbp, so you need to make sure that you have
|
||||
added the remote:
|
||||
|
||||
git remote add origin-tod https://gitlab.freedesktop.org/3v1n0/libfprint.git
|
||||
git fetch origin-tod --tags
|
||||
|
||||
To get the latest tod release, just use `gbp import-orig --uscan`.
|
||||
@@ -1,203 +0,0 @@
|
||||
Source: libfprint
|
||||
Priority: optional
|
||||
Section: libs
|
||||
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
|
||||
XSBC-Original-Maintainer: FingerForce Team <fingerforce-devel@lists.alioth.debian.org>
|
||||
Uploaders: Marco Trevisan <marco@ubuntu.com>
|
||||
Build-Depends: debhelper-compat (= 13),
|
||||
gir1.2-gobject-2.0-dev <!nogir>,
|
||||
gir1.2-gio-2.0-dev <!nogir>,
|
||||
gobject-introspection,
|
||||
gtk-doc-tools,
|
||||
libcairo-dev <!nocheck>,
|
||||
libgirepository1.0-dev,
|
||||
libglib2.0-dev,
|
||||
libgudev-1.0-dev,
|
||||
libgusb-dev,
|
||||
libnss3-dev,
|
||||
libpixman-1-dev,
|
||||
meson,
|
||||
python3 <!nocheck>,
|
||||
python3-cairo <!nocheck>,
|
||||
python3-gi <!nocheck>,
|
||||
systemd-dev,
|
||||
umockdev <!nocheck>
|
||||
Build-Depends-Indep: libglib2.0-doc <!nodoc>, libgusb-doc <!nodoc>
|
||||
Standards-Version: 4.6.2
|
||||
Homepage: https://www.freedesktop.org/wiki/Software/fprint/libfprint
|
||||
Vcs-Browser: https://salsa.debian.org/ubuntu-dev-team/libfprint/tree/noble
|
||||
Vcs-Git: https://salsa.debian.org/ubuntu-dev-team/libfprint.git -b noble
|
||||
|
||||
Package: libfprint-2-2
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Pre-Depends: ${misc:Pre-Depends}
|
||||
Description: async fingerprint library of fprint project, shared libraries
|
||||
The fprint project aims to support for consumer fingerprint reader devices.
|
||||
.
|
||||
Previously, Linux support for such devices has been scattered amongst different
|
||||
projects (many incomplete) and inconsistent in that application developers
|
||||
would have to implement support for each type of fingerprint reader separately.
|
||||
The idea is to change that by providing a central system to support all the
|
||||
fingerprint readers as it's possible to get hands on.
|
||||
.
|
||||
libfprint is the centre of efforts, this component does the dirty job of
|
||||
talking to fingerprint reading devices, and processing fingerprint data.
|
||||
.
|
||||
This library depends on the new libusb, which performs asynchronous callbacks,
|
||||
allowing fprint to perform non-blocking device tasks.
|
||||
.
|
||||
This package provides shared libraries.
|
||||
|
||||
Package: libfprint-2-dev
|
||||
Section: libdevel
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends: gir1.2-fprint-2.0 (= ${binary:Version}),
|
||||
libfprint-2-2 (= ${binary:Version}),
|
||||
${misc:Depends},
|
||||
${gir:Depends},
|
||||
Provides: ${gir:Provides},
|
||||
Suggests: libfprint-2-doc
|
||||
Description: async fingerprint library of fprint project, development headers
|
||||
The fprint project aims to support for consumer fingerprint reader devices.
|
||||
.
|
||||
Previously, Linux support for such devices has been scattered amongst different
|
||||
projects (many incomplete) and inconsistent in that application developers
|
||||
would have to implement support for each type of fingerprint reader separately.
|
||||
The idea is to change that by providing a central system to support all the
|
||||
fingerprint readers as it's possible to get hands on.
|
||||
.
|
||||
libfprint is the centre of efforts, this component does the dirty job of
|
||||
talking to fingerprint reading devices, and processing fingerprint data.
|
||||
.
|
||||
This library depends on the new libusb, which performs asynchronous callbacks,
|
||||
allowing fprint to perform non-blocking device tasks.
|
||||
.
|
||||
This package provides development headers.
|
||||
|
||||
Package: libfprint-2-doc
|
||||
Section: doc
|
||||
Architecture: all
|
||||
Multi-Arch: foreign
|
||||
Depends: ${misc:Depends}
|
||||
Description: async fingerprint library of fprint project, API documentation
|
||||
The fprint project aims to support for consumer fingerprint reader devices.
|
||||
.
|
||||
Previously, Linux support for such devices has been scattered amongst different
|
||||
projects (many incomplete) and inconsistent in that application developers
|
||||
would have to implement support for each type of fingerprint reader separately.
|
||||
The idea is to change that by providing a central system to support all the
|
||||
fingerprint readers as it's possible to get hands on.
|
||||
.
|
||||
libfprint is the centre of efforts, this component does the dirty job of
|
||||
talking to fingerprint reading devices, and processing fingerprint data.
|
||||
.
|
||||
This library depends on the new libusb, which performs asynchronous callbacks,
|
||||
allowing fprint to perform non-blocking device tasks.
|
||||
.
|
||||
This package provides the API documentation.
|
||||
|
||||
Package: gir1.2-fprint-2.0
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Section: introspection
|
||||
Depends: ${gir:Depends}, ${misc:Depends}, ${shlibs:Depends}
|
||||
Pre-Depends: ${misc:Pre-Depends}
|
||||
Description: async fingerprint library of fprint project, gir bindings
|
||||
The fprint project aims to support for consumer fingerprint reader devices.
|
||||
.
|
||||
Previously, Linux support for such devices has been scattered amongst different
|
||||
projects (many incomplete) and inconsistent in that application developers
|
||||
would have to implement support for each type of fingerprint reader separately.
|
||||
The idea is to change that by providing a central system to support all the
|
||||
fingerprint readers as it's possible to get hands on.
|
||||
.
|
||||
libfprint is the centre of efforts, this component does the dirty job of
|
||||
talking to fingerprint reading devices, and processing fingerprint data.
|
||||
.
|
||||
This library depends on the new libusb, which performs asynchronous callbacks,
|
||||
allowing fprint to perform non-blocking device tasks.
|
||||
.
|
||||
This package can be used by other packages using the GIRepository format to
|
||||
generate dynamic bindings.
|
||||
|
||||
Package: libfprint-2-tod1
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Pre-Depends: ${misc:Pre-Depends}
|
||||
Description: async fingerprint library of fprint project, drivers shared libraries
|
||||
The fprint project aims to support for consumer fingerprint reader devices.
|
||||
.
|
||||
Previously, Linux support for such devices has been scattered amongst different
|
||||
projects (many incomplete) and inconsistent in that application developers
|
||||
would have to implement support for each type of fingerprint reader separately.
|
||||
The idea is to change that by providing a central system to support all the
|
||||
fingerprint readers as it's possible to get hands on.
|
||||
.
|
||||
libfprint is the centre of efforts, this component does the dirty job of
|
||||
talking to fingerprint reading devices, and processing fingerprint data.
|
||||
.
|
||||
This library depends on the new libusb, which performs asynchronous callbacks,
|
||||
allowing fprint to perform non-blocking device tasks.
|
||||
.
|
||||
This package provides shared libraries for the TOD drivers.
|
||||
|
||||
Package: libfprint-2-tod-dev
|
||||
Section: libdevel
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends: libfprint-2-tod1 (= ${binary:Version}),
|
||||
libfprint-2-dev (= ${binary:Version}),
|
||||
libglib2.0-dev (>= 2.56),
|
||||
libgudev-1.0-dev,
|
||||
libgusb-dev (>= 0.2.0),
|
||||
libpixman-1-dev,
|
||||
libnss3-dev,
|
||||
${misc:Depends}
|
||||
Description: async fingerprint library of fprint project, drivers development headers
|
||||
The fprint project aims to support for consumer fingerprint reader devices.
|
||||
.
|
||||
Previously, Linux support for such devices has been scattered amongst different
|
||||
projects (many incomplete) and inconsistent in that application developers
|
||||
would have to implement support for each type of fingerprint reader separately.
|
||||
The idea is to change that by providing a central system to support all the
|
||||
fingerprint readers as it's possible to get hands on.
|
||||
.
|
||||
libfprint is the centre of efforts, this component does the dirty job of
|
||||
talking to fingerprint reading devices, and processing fingerprint data.
|
||||
.
|
||||
This library depends on the new libusb, which performs asynchronous callbacks,
|
||||
allowing fprint to perform non-blocking device tasks.
|
||||
.
|
||||
This package provides development headers for creating device drivers.
|
||||
An example driver is available at:
|
||||
https://gitlab.freedesktop.org/3v1n0/libfprint-tod-example-driver
|
||||
|
||||
Package: libfprint-2-tests
|
||||
Architecture: any
|
||||
Depends: gir1.2-fprint-2.0 (= ${binary:Version}),
|
||||
libfprint-2-2 (= ${binary:Version}),
|
||||
python3,
|
||||
python3-cairo,
|
||||
python3-gi,
|
||||
umockdev,
|
||||
${misc:Depends}, ${shlibs:Depends}
|
||||
Description: Tests for async fingerprint library of fprint project
|
||||
The fprint project aims to support for consumer fingerprint reader devices.
|
||||
.
|
||||
Previously, Linux support for such devices has been scattered amongst different
|
||||
projects (many incomplete) and inconsistent in that application developers
|
||||
would have to implement support for each type of fingerprint reader separately.
|
||||
The idea is to change that by providing a central system to support all the
|
||||
fingerprint readers as it's possible to get hands on.
|
||||
.
|
||||
libfprint is the centre of efforts, this component does the dirty job of
|
||||
talking to fingerprint reading devices, and processing fingerprint data.
|
||||
.
|
||||
This library depends on the new libusb, which performs asynchronous callbacks,
|
||||
allowing fprint to perform non-blocking device tasks.
|
||||
.
|
||||
This package contains test programs, designed to be run as part of a
|
||||
regression testsuite.
|
||||
@@ -1,45 +0,0 @@
|
||||
This package was debianized by Ulises Vitulli <uvitulli@fi.uba.ar> on
|
||||
Fri, 19 Sep 2008 05:14:30 -0300.
|
||||
|
||||
It was downloaded from <http://reactivated.net/fprint/wiki/Libfprint>
|
||||
|
||||
Upstream Authors, and Copyright:
|
||||
|
||||
Copyright © 2007 Daniel Drake <dsd@gentoo.org>
|
||||
Copyright © 2006-2007 Timo Hoenig <thoenig@suse.de>
|
||||
Copyright © 2006 Pavel Machek <pavel@suse.cz>
|
||||
Copyright © 1999 Erik Walthinsen <omega@cse.ogi.edu>
|
||||
Copyright © 2004,2006 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
Copyright © 2007 Cyrille Bagard
|
||||
Copyright © 2007 Vasily Khoruzhick
|
||||
Copyright © 2007 Jan-Michael Brummer <buzz2@gmx.de>
|
||||
Copyright © 2007 Anthony Bretaudeau <wxcover@users.sourceforge.net>
|
||||
|
||||
|
||||
License:
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The files under libfprint/nbis directory has this license:
|
||||
|
||||
This software was developed at the National Institute of Standards and
|
||||
Technology (NIST) by employees of the Federal Government in the course
|
||||
of their official duties. Pursuant to title 17 Section 105 of the
|
||||
United States Code, this software is not subject to copyright protection
|
||||
and is in the public domain. NIST assumes no responsibility whatsoever for
|
||||
its use by other parties, and makes no guarantees, expressed or implied,
|
||||
about its quality, reliability, or any other characteristic.
|
||||
|
||||
The Debian packaging is © 2008, Ulises Vitulli <uvitulli@fi.uba.ar> and is
|
||||
licensed under the LGPL v2.1, see `/usr/share/common-licenses/LGPL-2.1'.
|
||||
@@ -1,2 +0,0 @@
|
||||
NEWS
|
||||
README.md
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
dch -v"$GBP_DEBIAN_VERSION" "New upstream release"
|
||||
git add debian/changelog
|
||||
debcommit
|
||||
|
||||
debian/update-udev-triggers.sh
|
||||
@@ -1,19 +0,0 @@
|
||||
[DEFAULT]
|
||||
pristine-tar = True
|
||||
debian-branch = noble
|
||||
upstream-vcs-tag = v%(version)s
|
||||
upstream-branch = upstream-tod
|
||||
debian-tag=ubuntu/%(version)s
|
||||
|
||||
[buildpackage]
|
||||
sign-tags = True
|
||||
|
||||
[dch]
|
||||
multimaint-merge = True
|
||||
|
||||
[import-orig]
|
||||
postimport = debian/gbp-post-import-hook.sh
|
||||
|
||||
[pq]
|
||||
patch-numbers = False
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
usr/lib/${DEB_HOST_MULTIARCH}/girepository-1.0/FPrint-*.typelib
|
||||
@@ -1,3 +0,0 @@
|
||||
usr/lib/udev/hwdb.d/
|
||||
usr/lib/udev/rules.d/
|
||||
usr/lib/${DEB_HOST_MULTIARCH}/libfprint-[0-9].so.*
|
||||
@@ -1,3 +0,0 @@
|
||||
# For security reasons, we don't want the fingerprint readers to be accessible
|
||||
# by unprivileged users
|
||||
udev-rule-missing-uaccess
|
||||
@@ -1,315 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
if [ "$1" = "configure" -o "$1" = "upgrade" ] && command -V udevadm >/dev/null 2>&1; then
|
||||
# apply hwdb rules at package installation, see
|
||||
# <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683863#27>
|
||||
# NOTA BENE: after the DEBHELPER section since dh_installudev
|
||||
# adds stuff there
|
||||
# The devices ID list is auto-generated using the gbp postimport hook
|
||||
# see debian/README.sources for more details.
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=1600 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=1660 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=1680 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=1681 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=1682 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=1683 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=1684 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=1685 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=1686 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=1687 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=1688 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=1689 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=168a || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=168b || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=168c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=168d || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=168e || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=168f || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2500 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2580 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2550 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2810 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2660 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2680 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2681 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2682 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2683 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2684 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2685 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2686 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2687 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2688 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2689 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=268a || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=268b || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=268c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=268d || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=268e || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=268f || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=2691 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=5731 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=08ff --attr-match=idProduct=5501 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=1c7a --attr-match=idProduct=0570 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=1c7a --attr-match=idProduct=0571 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=1c7a --attr-match=idProduct=0582 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=1c7a --attr-match=idProduct=05a1 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0903 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0907 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c01 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c02 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c03 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c04 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c05 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c06 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c07 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c08 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c09 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c0a || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c0b || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c0c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c0d || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c0e || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c0f || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c10 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c11 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c12 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c13 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c14 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c15 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c16 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c17 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c18 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c19 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c1a || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c1b || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c1c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c1d || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c1e || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c1f || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c20 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c21 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c22 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c23 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c24 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c25 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c26 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c27 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c28 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c29 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c2a || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c2b || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c2c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c2d || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c2e || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c2f || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c30 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c31 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c32 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c33 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c3d || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c42 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c4b || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c4d || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c4f || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c63 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c6e || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c58 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c7d || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c7e || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c82 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c88 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c8c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c8d || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c99 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=1c7a --attr-match=idProduct=0603 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=2808 --attr-match=idProduct=9e48 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=2808 --attr-match=idProduct=d979 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=2808 --attr-match=idProduct=a959 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=10a5 --attr-match=idProduct=ffe0 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=10a5 --attr-match=idProduct=a305 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=10a5 --attr-match=idProduct=da04 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=10a5 --attr-match=idProduct=d805 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=10a5 --attr-match=idProduct=d205 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=5840 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=6014 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=6092 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=6094 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=609c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=60a2 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=60a4 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=60bc || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=6304 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=631c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=633c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=634c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=6384 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=639c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=63ac || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=63bc || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=63cc || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=6496 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=6582 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=6584 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=658c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=6592 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=6594 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=659a || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=659c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=6a94 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=298d --attr-match=idProduct=1010 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=0bda --attr-match=idProduct=5813 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00bd || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00df || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00f9 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00fc || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00c2 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=0100 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00f0 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=0103 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=0123 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=0124 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=0126 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=0129 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=0168 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=015f || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=0104 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=0173 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=0106 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=147e --attr-match=idProduct=2016 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=147e --attr-match=idProduct=1000 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=147e --attr-match=idProduct=1001 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=0483 --attr-match=idProduct=2015 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=0483 --attr-match=idProduct=2017 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=147e --attr-match=idProduct=3001 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=147e --attr-match=idProduct=2020 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=045e --attr-match=idProduct=00bc || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=045e --attr-match=idProduct=00bd || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=045e --attr-match=idProduct=00ca || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=05ba --attr-match=idProduct=0007 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=05ba --attr-match=idProduct=0008 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=05ba --attr-match=idProduct=000a || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=061a --attr-match=idProduct=0110 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=0050 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=0001 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=0005 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=0008 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=0010 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=0011 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=0015 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=0017 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=0018 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=0091 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=047d --attr-match=idProduct=00f2 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04e8 --attr-match=idProduct=730b || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=036b || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c00 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c4c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c57 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c5e || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c5a || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c6c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c70 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c72 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=0c77 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=2706 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=3032 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=3057 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=3104 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=310d || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=04f3 --attr-match=idProduct=3128 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=0081 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=0088 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=008a || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=009a || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=009b || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00a2 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00a8 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00b7 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00bb || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00be || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00c4 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00cb || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00c9 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00d8 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00da || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00dc || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00e4 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00e7 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00e9 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=06cb --attr-match=idProduct=00fd || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=0a5c --attr-match=idProduct=5801 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=0a5c --attr-match=idProduct=5805 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=0a5c --attr-match=idProduct=5834 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=0a5c --attr-match=idProduct=5840 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=0a5c --attr-match=idProduct=5841 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=0a5c --attr-match=idProduct=5842 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=0a5c --attr-match=idProduct=5843 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=0a5c --attr-match=idProduct=5844 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=0a5c --attr-match=idProduct=5845 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=0bda --attr-match=idProduct=5812 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=10a5 --attr-match=idProduct=0007 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=10a5 --attr-match=idProduct=9200 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=10a5 --attr-match=idProduct=9800 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=10a5 --attr-match=idProduct=e340 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=1188 --attr-match=idProduct=9545 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=0007 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=003a || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=003c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=003d || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=003f || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=0090 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=0092 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=0094 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=0097 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=009d || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=00ab || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=138a --attr-match=idProduct=00a6 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=147e --attr-match=idProduct=1002 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=1491 --attr-match=idProduct=0088 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=16d1 --attr-match=idProduct=1027 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=1c7a --attr-match=idProduct=0300 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=1c7a --attr-match=idProduct=0575 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=1c7a --attr-match=idProduct=0576 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=1c7a --attr-match=idProduct=0577 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=5042 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=5110 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=5117 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=5120 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=5125 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=5201 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=521d || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=5301 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=530c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=532d || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=5335 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=533c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=5381 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=5385 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=538c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=538d || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=5395 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=5503 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=550a || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=550c || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=5584 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=55a2 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=55a4 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=55b4 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=5740 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=5e0a || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=581a || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=589a || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=27c6 --attr-match=idProduct=6382 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=2808 --attr-match=idProduct=9338 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=2808 --attr-match=idProduct=93a9 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=298d --attr-match=idProduct=2020 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=298d --attr-match=idProduct=2033 || true
|
||||
udevadm trigger --action=add --attr-match=idVendor=3538 --attr-match=idProduct=0930 || true
|
||||
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
if [ "$1" = "configure" -o "$1" = "upgrade" ] && command -V udevadm >/dev/null 2>&1; then
|
||||
# apply hwdb rules at package installation, see
|
||||
# <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683863#27>
|
||||
# NOTA BENE: after the DEBHELPER section since dh_installudev
|
||||
# adds stuff there
|
||||
# The devices ID list is auto-generated using the gbp postimport hook
|
||||
# see debian/README.sources for more details.
|
||||
@UDEVADM_TRIGGERS@
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -1,94 +0,0 @@
|
||||
libfprint-2.so.2 libfprint-2-2 #MINVER#
|
||||
* Build-Depends-Package: libfprint-2-dev
|
||||
LIBFPRINT_2.0.0@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_context_enumerate@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_context_get_devices@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_context_get_type@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_context_new@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_capture@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_capture_finish@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_capture_sync@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_clear_storage@LIBFPRINT_2.0.0 1:1.94.1
|
||||
fp_device_clear_storage_finish@LIBFPRINT_2.0.0 1:1.94.1
|
||||
fp_device_clear_storage_sync@LIBFPRINT_2.0.0 1:1.94.1
|
||||
fp_device_close@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_close_finish@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_close_sync@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_delete_print@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_delete_print_finish@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_delete_print_sync@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_enroll@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_enroll_finish@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_enroll_sync@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_error_get_type@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_error_quark@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_feature_get_type@LIBFPRINT_2.0.0 1:1.94.1
|
||||
fp_device_get_device_id@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_get_driver@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_get_features@LIBFPRINT_2.0.0 1:1.94.1
|
||||
fp_device_get_finger_status@LIBFPRINT_2.0.0 1:1.90.4
|
||||
fp_device_get_name@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_get_nr_enroll_stages@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_get_scan_type@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_get_temperature@LIBFPRINT_2.0.0 1:1.94.1
|
||||
fp_device_get_type@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_has_feature@LIBFPRINT_2.0.0 1:1.94.1
|
||||
fp_device_has_storage@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_identify@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_identify_finish@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_identify_sync@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_is_open@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_list_prints@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_list_prints_finish@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_list_prints_sync@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_open@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_open_finish@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_open_sync@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_resume@LIBFPRINT_2.0.0 1:1.94.1
|
||||
fp_device_resume_finish@LIBFPRINT_2.0.0 1:1.94.1
|
||||
fp_device_resume_sync@LIBFPRINT_2.0.0 1:1.94.1
|
||||
fp_device_retry_get_type@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_retry_quark@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_supports_capture@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_supports_identify@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_suspend@LIBFPRINT_2.0.0 1:1.94.1
|
||||
fp_device_suspend_finish@LIBFPRINT_2.0.0 1:1.94.1
|
||||
fp_device_suspend_sync@LIBFPRINT_2.0.0 1:1.94.1
|
||||
fp_device_type_get_type@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_verify@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_verify_finish@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_device_verify_sync@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_finger_get_type@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_finger_status_flags_get_type@LIBFPRINT_2.0.0 1:1.90.4
|
||||
fp_image_detect_minutiae@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_image_detect_minutiae_finish@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_image_device_get_type@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_image_get_binarized@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_image_get_data@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_image_get_height@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_image_get_minutiae@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_image_get_ppmm@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_image_get_type@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_image_get_width@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_image_new@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_minutia_get_coords@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_print_compatible@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_print_deserialize@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_print_equal@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_print_get_description@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_print_get_device_id@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_print_get_device_stored@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_print_get_driver@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_print_get_enroll_date@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_print_get_finger@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_print_get_image@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_print_get_type@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_print_get_username@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_print_new@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_print_serialize@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_print_set_description@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_print_set_enroll_date@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_print_set_finger@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_print_set_username@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_scan_type_get_type@LIBFPRINT_2.0.0 1:1.90.1
|
||||
fp_temperature_get_type@LIBFPRINT_2.0.0 1:1.94.1
|
||||
@@ -1,4 +0,0 @@
|
||||
usr/include/libfprint-[0-9]/*.h
|
||||
usr/lib/${DEB_HOST_MULTIARCH}/libfprint-[0-9].so
|
||||
usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/libfprint-[0-9].pc
|
||||
usr/share/gir-1.0/FPrint-*.gir
|
||||
@@ -1 +0,0 @@
|
||||
usr/share/gtk-doc/*/libfprint-*
|
||||
@@ -1,2 +0,0 @@
|
||||
usr/libexec/installed-tests/libfprint-[0-9]
|
||||
usr/share/installed-tests/libfprint-[0-9]
|
||||
@@ -1,3 +0,0 @@
|
||||
usr/include/libfprint-[0-9]/tod-[0-9]/*
|
||||
usr/lib/${DEB_HOST_MULTIARCH}/libfprint-[0-9]-tod.so
|
||||
usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/libfprint-[0-9]-tod-[0-9].pc
|
||||
@@ -1 +0,0 @@
|
||||
usr/lib/${DEB_HOST_MULTIARCH}/libfprint-[0-9]-tod.so.*
|
||||
@@ -1,239 +0,0 @@
|
||||
libfprint-2-tod.so.1 libfprint-2-tod1 #MINVER#
|
||||
LIBFPRINT_TOD_1.0.0@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
LIBFPRINT_TOD_1_1.92@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
LIBFPRINT_TOD_1_1.94@LIBFPRINT_TOD_1_1.94 1:1.94.1+tod1
|
||||
fpi_assemble_frames@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_assemble_lines@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_dup_data@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_dup_string_utf16@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_dup_string_utf32@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_dup_string_utf8@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_free@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_data@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_float32_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_float32_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_float64_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_float64_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_int16_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_int16_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_int24_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_int24_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_int32_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_int32_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_int64_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_int64_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_int8@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_pos@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_remaining@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_size@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_string_utf8@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_sub_reader@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_uint16_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_uint16_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_uint24_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_uint24_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_uint32_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_uint32_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_uint64_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_uint64_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_get_uint8@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_init@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_masked_scan_uint32@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_masked_scan_uint32_peek@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_new@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_data@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_float32_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_float32_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_float64_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_float64_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_int16_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_int16_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_int24_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_int24_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_int32_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_int32_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_int64_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_int64_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_int8@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_string_utf8@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_sub_reader@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_uint16_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_uint16_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_uint24_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_uint24_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_uint32_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_uint32_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_uint64_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_uint64_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_peek_uint8@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_set_pos@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_skip@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_skip_string_utf16@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_skip_string_utf32@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_reader_skip_string_utf8@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_ensure_free_space@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_fill@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_free@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_free_and_get_data@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_get_remaining@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_init@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_init_with_data@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_init_with_size@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_new@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_new_with_data@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_new_with_size@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_data@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_float32_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_float32_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_float64_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_float64_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_int16_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_int16_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_int24_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_int24_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_int32_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_int32_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_int64_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_int64_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_int8@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_string_utf16@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_string_utf32@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_string_utf8@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_uint16_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_uint16_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_uint24_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_uint24_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_uint32_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_uint32_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_uint64_be@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_uint64_le@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_put_uint8@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_reset@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_byte_writer_reset_and_get_data@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_action_error@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_action_get_type@LIBFPRINT_TOD_1.0.0 1:1.90.3+tod1
|
||||
fpi_device_action_is_cancelled@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_add_timeout@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_capture_complete@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_class_auto_initialize_features@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_device_clear_storage_complete@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_device_close_complete@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_configure_wakeup@LIBFPRINT_TOD_1.0.0 1:1.94.1+tod1
|
||||
fpi_device_critical_enter@LIBFPRINT_TOD_1_1.94 1:1.94.1+tod1
|
||||
fpi_device_critical_leave@LIBFPRINT_TOD_1_1.94 1:1.94.1+tod1
|
||||
fpi_device_delete_complete@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_enroll_complete@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_enroll_progress@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_error_new@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_error_new_msg@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_get_cancellable@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_get_capture_data@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_get_current_action@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_get_delete_data@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_get_driver_data@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_get_enroll_data@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_get_identify_data@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_get_udev_data@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_device_get_usb_device@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_get_verify_data@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_get_virtual_env@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_identify_complete@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_identify_report@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_list_complete@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_open_complete@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_probe_complete@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_remove@LIBFPRINT_TOD_1.0.0 1:1.90.5+tod1
|
||||
fpi_device_report_finger_status@LIBFPRINT_TOD_1.0.0 1:1.90.5+tod1
|
||||
fpi_device_report_finger_status_changes@LIBFPRINT_TOD_1.0.0 1:1.90.5+tod1
|
||||
fpi_device_resume@LIBFPRINT_TOD_1_1.94 1:1.94.5+tod1
|
||||
fpi_device_resume_complete@LIBFPRINT_TOD_1_1.94 1:1.94.1+tod1
|
||||
fpi_device_retry_new@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_retry_new_msg@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_set_nr_enroll_stages@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_set_scan_type@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_suspend@LIBFPRINT_TOD_1_1.94 1:1.94.5+tod1
|
||||
fpi_device_suspend_complete@LIBFPRINT_TOD_1_1.94 1:1.94.1+tod1
|
||||
fpi_device_udev_subtype_flags_get_type@LIBFPRINT_TOD_1.0.0 1:1.94.1+tod1
|
||||
fpi_device_update_features@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_device_update_temp@LIBFPRINT_TOD_1.0.0 1:1.94.1+tod1
|
||||
fpi_device_verify_complete@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_device_verify_report@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_do_movement_estimation@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_image_device_activate@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_image_device_activate_complete@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_image_device_close_complete@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_image_device_deactivate@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_image_device_deactivate_complete@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_image_device_image_captured@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_image_device_open_complete@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_image_device_report_finger_status@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_image_device_retry_scan@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_image_device_session_error@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_image_device_set_bz3_threshold@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_image_device_state_get_type@LIBFPRINT_TOD_1.0.0 1:1.90.3+tod1
|
||||
fpi_image_flags_get_type@LIBFPRINT_TOD_1.0.0 1:1.90.3+tod1
|
||||
fpi_image_resize@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_match_result_get_type@LIBFPRINT_TOD_1.0.0 1:1.90.3+tod1
|
||||
fpi_mean_sq_diff_norm@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_print_add_from_image@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_print_add_print@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_print_bz3_match@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_print_fill_from_user_id@LIBFPRINT_TOD_1.0.0 1:1.90.2+tod1
|
||||
fpi_print_generate_user_id@LIBFPRINT_TOD_1.0.0 1:1.90.2+tod1
|
||||
fpi_print_set_device_stored@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_print_set_type@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_print_type_get_type@LIBFPRINT_TOD_1.0.0 1:1.90.3+tod1
|
||||
fpi_spi_transfer_get_type@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_spi_transfer_new@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_spi_transfer_read@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_spi_transfer_read_full@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_spi_transfer_ref@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_spi_transfer_submit@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_spi_transfer_submit_sync@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_spi_transfer_unref@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_spi_transfer_write@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_spi_transfer_write_full@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_ssm_cancel_delayed_state_change@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_ssm_dup_error@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_ssm_free@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_ssm_get_cur_state@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_ssm_get_data@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_ssm_get_device@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_ssm_get_error@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_ssm_jump_to_state@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_ssm_jump_to_state_delayed@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_ssm_jump_to_state_delayed@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_ssm_jump_to_state_delayed_1_90@LIBFPRINT_TOD_1.0.0 1:1.94.1+tod1
|
||||
fpi_ssm_mark_completed@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_ssm_mark_completed_delayed@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_ssm_mark_completed_delayed@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_ssm_mark_completed_delayed_1_90@LIBFPRINT_TOD_1.0.0 1:1.94.1+tod1
|
||||
fpi_ssm_mark_failed@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_ssm_new_full@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_ssm_new_full@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_ssm_new_full_1_90@LIBFPRINT_TOD_1.0.0 1:1.94.1+tod1
|
||||
fpi_ssm_next_state@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_ssm_next_state_delayed@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_ssm_next_state_delayed@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_ssm_next_state_delayed_1_90@LIBFPRINT_TOD_1.0.0 1:1.94.1+tod1
|
||||
fpi_ssm_set_data@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_ssm_silence_debug@LIBFPRINT_TOD_1_1.94 1:1.94.3+tod1
|
||||
fpi_ssm_spi_transfer_cb@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_ssm_spi_transfer_with_weak_pointer_cb@LIBFPRINT_TOD_1_1.92 1:1.94.1+tod1
|
||||
fpi_ssm_start@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_ssm_start_subsm@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_ssm_usb_transfer_cb@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_ssm_usb_transfer_with_weak_pointer_cb@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_std_sq_dev@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_transfer_type_get_type@LIBFPRINT_TOD_1.0.0 1:1.90.3+tod1
|
||||
fpi_usb_transfer_fill_bulk@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_usb_transfer_fill_bulk_full@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_usb_transfer_fill_control@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_usb_transfer_fill_interrupt@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_usb_transfer_fill_interrupt_full@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_usb_transfer_get_type@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_usb_transfer_new@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_usb_transfer_ref@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_usb_transfer_submit@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_usb_transfer_submit_sync@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
fpi_usb_transfer_unref@LIBFPRINT_TOD_1.0.0 1:1.90.1+tod1
|
||||
@@ -1,37 +0,0 @@
|
||||
From a603b95786836d27679301ecd4e68e4227ab4c82 Mon Sep 17 00:00:00 2001
|
||||
From: herman lin <herman.lin@emc.com.tw>
|
||||
Date: Thu, 8 May 2025 15:34:37 +0800
|
||||
Subject: [PATCH] elanmoc: Add new PID 0x0CA8
|
||||
|
||||
---
|
||||
data/autosuspend.hwdb | 1 +
|
||||
libfprint/drivers/elanmoc/elanmoc.c | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/data/autosuspend.hwdb b/data/autosuspend.hwdb
|
||||
index 39dd316..43190cb 100644
|
||||
--- a/data/autosuspend.hwdb
|
||||
+++ b/data/autosuspend.hwdb
|
||||
@@ -157,6 +157,7 @@ usb:v04F3p0C8C*
|
||||
usb:v04F3p0C8D*
|
||||
usb:v04F3p0C99*
|
||||
usb:v04F3p0C9F*
|
||||
+usb:v04F3p0CA8*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
diff --git a/libfprint/drivers/elanmoc/elanmoc.c b/libfprint/drivers/elanmoc/elanmoc.c
|
||||
index 42a84a6..0e99e57 100644
|
||||
--- a/libfprint/drivers/elanmoc/elanmoc.c
|
||||
+++ b/libfprint/drivers/elanmoc/elanmoc.c
|
||||
@@ -33,6 +33,7 @@ static const FpIdEntry id_table[] = {
|
||||
{ .vid = 0x04f3, .pid = 0x0c8d, },
|
||||
{ .vid = 0x04f3, .pid = 0x0c99, },
|
||||
{ .vid = 0x04f3, .pid = 0x0c9f, },
|
||||
+ { .vid = 0x04f3, .pid = 0x0ca8, },
|
||||
{ .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */
|
||||
};
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
Subject: elanmoc: Add new PID 0x0C9F
|
||||
Origin: upstream, https://gitlab.freedesktop.org/libfprint/libfprint/-/merge_requests/501
|
||||
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfprint/+bug/2089367
|
||||
|
||||
diff --git a/data/autosuspend.hwdb b/data/autosuspend.hwdb
|
||||
index 8e0e6eab12e772058a8957a2b9f2d39e0bdc8e11..342c6d0e6538028d90a11d1607cd9e07086aeb8c 100644
|
||||
--- a/data/autosuspend.hwdb
|
||||
+++ b/data/autosuspend.hwdb
|
||||
@@ -156,6 +156,7 @@ usb:v04F3p0C88*
|
||||
usb:v04F3p0C8C*
|
||||
usb:v04F3p0C8D*
|
||||
usb:v04F3p0C99*
|
||||
+usb:v04F3p0C9F*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
diff --git a/libfprint/drivers/elanmoc/elanmoc.c b/libfprint/drivers/elanmoc/elanmoc.c
|
||||
index e86b79a28ec2240a303ad602b567d10447e3b09b..42a84a627e68020bb070bce1a6cffa669cffe9ed 100644
|
||||
--- a/libfprint/drivers/elanmoc/elanmoc.c
|
||||
+++ b/libfprint/drivers/elanmoc/elanmoc.c
|
||||
@@ -32,6 +32,7 @@ static const FpIdEntry id_table[] = {
|
||||
{ .vid = 0x04f3, .pid = 0x0c8c, },
|
||||
{ .vid = 0x04f3, .pid = 0x0c8d, },
|
||||
{ .vid = 0x04f3, .pid = 0x0c99, },
|
||||
+ { .vid = 0x04f3, .pid = 0x0c9f, },
|
||||
{ .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */
|
||||
};
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
From 763b6830006ca88bced7744c219c9a961d1637f4 Mon Sep 17 00:00:00 2001
|
||||
From: jialei <jialei@egoodix.com>
|
||||
Date: Wed, 29 Oct 2025 14:32:54 +0800
|
||||
Subject: [PATCH] goodixmoc:add new PID 0x66A9
|
||||
|
||||
---
|
||||
data/autosuspend.hwdb | 1 +
|
||||
libfprint/drivers/goodixmoc/goodix.c | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/data/autosuspend.hwdb b/data/autosuspend.hwdb
|
||||
index 74ac65b..df18494 100644
|
||||
--- a/data/autosuspend.hwdb
|
||||
+++ b/data/autosuspend.hwdb
|
||||
@@ -207,6 +207,7 @@ usb:v27C6p6594*
|
||||
usb:v27C6p659A*
|
||||
usb:v27C6p659C*
|
||||
usb:v27C6p6A94*
|
||||
+usb:v27C6p66A9*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
diff --git a/libfprint/drivers/goodixmoc/goodix.c b/libfprint/drivers/goodixmoc/goodix.c
|
||||
index 5a3ffac..8aea175 100644
|
||||
--- a/libfprint/drivers/goodixmoc/goodix.c
|
||||
+++ b/libfprint/drivers/goodixmoc/goodix.c
|
||||
@@ -1632,6 +1632,7 @@ static const FpIdEntry id_table[] = {
|
||||
{ .vid = 0x27c6, .pid = 0x659A, },
|
||||
{ .vid = 0x27c6, .pid = 0x659C, },
|
||||
{ .vid = 0x27c6, .pid = 0x6A94, },
|
||||
+ { .vid = 0x27c6, .pid = 0x66A9, },
|
||||
{ .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */
|
||||
};
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
|
||||
Date: Wed, 22 May 2024 17:08:19 +0200
|
||||
Subject: libfprint-fprint-list-udev-hwdb: Add new broadcom device IDs
|
||||
|
||||
(cherry picked from commit eaec2339ccaee64b2bdb1d1e27f51ada673e4087)
|
||||
---
|
||||
data/autosuspend.hwdb | 6 ++++++
|
||||
libfprint/fprint-list-udev-hwdb.c | 6 ++++++
|
||||
2 files changed, 12 insertions(+)
|
||||
|
||||
diff --git a/data/autosuspend.hwdb b/data/autosuspend.hwdb
|
||||
index 74ac65b..cb3e74b 100644
|
||||
--- a/data/autosuspend.hwdb
|
||||
+++ b/data/autosuspend.hwdb
|
||||
@@ -353,6 +353,12 @@ usb:v0A5Cp5842*
|
||||
usb:v0A5Cp5843*
|
||||
usb:v0A5Cp5844*
|
||||
usb:v0A5Cp5845*
|
||||
+usb:v0A5Cp5860*
|
||||
+usb:v0A5Cp5863*
|
||||
+usb:v0A5Cp5864*
|
||||
+usb:v0A5Cp5865*
|
||||
+usb:v0A5Cp5866*
|
||||
+usb:v0A5Cp5867*
|
||||
usb:v0BDAp5812*
|
||||
usb:v10A5p0007*
|
||||
usb:v10A5p9200*
|
||||
diff --git a/libfprint/fprint-list-udev-hwdb.c b/libfprint/fprint-list-udev-hwdb.c
|
||||
index bace9f9..4d056ae 100644
|
||||
--- a/libfprint/fprint-list-udev-hwdb.c
|
||||
+++ b/libfprint/fprint-list-udev-hwdb.c
|
||||
@@ -76,6 +76,12 @@ static const FpIdEntry allowlist_id_table[] = {
|
||||
{ .vid = 0x0a5c, .pid = 0x5843 },
|
||||
{ .vid = 0x0a5c, .pid = 0x5844 },
|
||||
{ .vid = 0x0a5c, .pid = 0x5845 },
|
||||
+ { .vid = 0x0a5c, .pid = 0x5860 },
|
||||
+ { .vid = 0x0a5c, .pid = 0x5863 },
|
||||
+ { .vid = 0x0a5c, .pid = 0x5864 },
|
||||
+ { .vid = 0x0a5c, .pid = 0x5865 },
|
||||
+ { .vid = 0x0a5c, .pid = 0x5866 },
|
||||
+ { .vid = 0x0a5c, .pid = 0x5867 },
|
||||
{ .vid = 0x0bda, .pid = 0x5812 },
|
||||
{ .vid = 0x10a5, .pid = 0x0007 },
|
||||
{ .vid = 0x10a5, .pid = 0x9200 },
|
||||
@@ -1,7 +0,0 @@
|
||||
libfprint-fprint-list-udev-hwdb-Add-new-broadcom-device-I.patch
|
||||
elanmoc-add-new-pid-0x0c9f.patch
|
||||
synaptics-Add-new-PID-0x0107-and-0x108.patch
|
||||
synaptics-Add-new-PID-0x019D.patch
|
||||
synaptics-add-new-PID-0x019F-0x109-and-0x10A.patch
|
||||
goodixmoc-add-new-PID-0x66A9.patch
|
||||
elanmoc-Add-new-PID-0x0CA8.patch
|
||||
@@ -1,39 +0,0 @@
|
||||
From a8ef1672a4ca7e60760349ce320a8f5b778244d5 Mon Sep 17 00:00:00 2001
|
||||
From: Aris Lin <aris.lin@synaptics.com>
|
||||
Date: Mon, 18 Nov 2024 11:18:29 +0800
|
||||
Subject: [PATCH] synaptics: Add new PID 0x0107 and 0x108
|
||||
|
||||
---
|
||||
data/autosuspend.hwdb | 2 ++
|
||||
libfprint/drivers/synaptics/synaptics.c | 2 ++
|
||||
2 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/data/autosuspend.hwdb b/data/autosuspend.hwdb
|
||||
index 74ac65b..386d8bd 100644
|
||||
--- a/data/autosuspend.hwdb
|
||||
+++ b/data/autosuspend.hwdb
|
||||
@@ -229,6 +229,8 @@ usb:v06CBp00C2*
|
||||
usb:v06CBp0100*
|
||||
usb:v06CBp00F0*
|
||||
usb:v06CBp0103*
|
||||
+usb:v06CBp0107*
|
||||
+usb:v06CBp0108*
|
||||
usb:v06CBp0123*
|
||||
usb:v06CBp0124*
|
||||
usb:v06CBp0126*
|
||||
diff --git a/libfprint/drivers/synaptics/synaptics.c b/libfprint/drivers/synaptics/synaptics.c
|
||||
index 138e734..a5d2990 100644
|
||||
--- a/libfprint/drivers/synaptics/synaptics.c
|
||||
+++ b/libfprint/drivers/synaptics/synaptics.c
|
||||
@@ -39,6 +39,8 @@ static const FpIdEntry id_table[] = {
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0100, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x00F0, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0103, },
|
||||
+ { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0107, },
|
||||
+ { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0108, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0123, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0124, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0126, },
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
From 2e766904f0250873aaa2133f5d0e84440843ec8b Mon Sep 17 00:00:00 2001
|
||||
From: Aris Lin <aris.lin@synaptics.com>
|
||||
Date: Mon, 13 May 2024 16:21:57 +0800
|
||||
Subject: [PATCH] synaptics: Add new PID 0x019D
|
||||
Origin: upstream, https://gitlab.freedesktop.org/libfprint/libfprint/-/commit/2e766904f0250873aaa2133f5d0e84440843ec8b
|
||||
Bug-Ubuntu: https://bugs.launchpad.net/bugs/2114712
|
||||
Signed-off-by: Atlas Yu <atlas.yu@canonical.com>
|
||||
|
||||
---
|
||||
data/autosuspend.hwdb | 1 +
|
||||
libfprint/drivers/synaptics/synaptics.c | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/data/autosuspend.hwdb b/data/autosuspend.hwdb
|
||||
index 342c6d0..ef81674 100644
|
||||
--- a/data/autosuspend.hwdb
|
||||
+++ b/data/autosuspend.hwdb
|
||||
@@ -243,6 +243,7 @@ usb:v06CBp015F*
|
||||
usb:v06CBp0104*
|
||||
usb:v06CBp0173*
|
||||
usb:v06CBp0106*
|
||||
+usb:v06CBp019D*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
diff --git a/libfprint/drivers/synaptics/synaptics.c b/libfprint/drivers/synaptics/synaptics.c
|
||||
index 138e734..7b7bf73 100644
|
||||
--- a/libfprint/drivers/synaptics/synaptics.c
|
||||
+++ b/libfprint/drivers/synaptics/synaptics.c
|
||||
@@ -48,6 +48,7 @@ static const FpIdEntry id_table[] = {
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0104, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0173, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0106, },
|
||||
+ { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x019D, },
|
||||
{ .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */
|
||||
};
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
From: Aris Lin <aris.lin@synaptics.com>
|
||||
Date: Mon, 14 Jul 2025 11:52:56 +0800
|
||||
Subject: [PATCH] synaptics: add new PID 0x019F, 0x109 and 0x10A
|
||||
|
||||
Origin: upstream, https://gitlab.freedesktop.org/libfprint/libfprint/-/commit/7f5304d6eec37955c8d462e571c3d72af0be4684
|
||||
Bug-Ubuntu: https://bugs.launchpad.net/bugs/2133704
|
||||
Signed-off-by: Bin Li <binli@ubuntu.com>
|
||||
---
|
||||
data/autosuspend.hwdb | 3 +++
|
||||
libfprint/drivers/synaptics/synaptics.c | 3 +++
|
||||
2 files changed, 6 insertions(+)
|
||||
|
||||
diff --git a/data/autosuspend.hwdb b/data/autosuspend.hwdb
|
||||
index 7a1759e..10e643c 100644
|
||||
--- a/data/autosuspend.hwdb
|
||||
+++ b/data/autosuspend.hwdb
|
||||
@@ -232,6 +232,8 @@ usb:v06CBp00F0*
|
||||
usb:v06CBp0103*
|
||||
usb:v06CBp0107*
|
||||
usb:v06CBp0108*
|
||||
+usb:v06CBp0109*
|
||||
+usb:v06CBp010A*
|
||||
usb:v06CBp0123*
|
||||
usb:v06CBp0124*
|
||||
usb:v06CBp0126*
|
||||
@@ -242,6 +244,7 @@ usb:v06CBp0104*
|
||||
usb:v06CBp0173*
|
||||
usb:v06CBp0106*
|
||||
usb:v06CBp019D*
|
||||
+usb:v06CBp019F*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
diff --git a/libfprint/drivers/synaptics/synaptics.c b/libfprint/drivers/synaptics/synaptics.c
|
||||
index d272421..29fb5f1 100644
|
||||
--- a/libfprint/drivers/synaptics/synaptics.c
|
||||
+++ b/libfprint/drivers/synaptics/synaptics.c
|
||||
@@ -41,6 +41,8 @@ static const FpIdEntry id_table[] = {
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0103, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0107, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0108, },
|
||||
+ { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0109, },
|
||||
+ { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x010A, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0123, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0124, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0126, },
|
||||
@@ -51,6 +53,7 @@ static const FpIdEntry id_table[] = {
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0173, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0106, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x019D, },
|
||||
+ { .vid = SYNAPTICS_VENDOR_ID, .pid = 0x019F, },
|
||||
{ .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */
|
||||
};
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
export DEB_BUILD_MAINT_OPTIONS = optimize=-lto
|
||||
export DPKG_GENSYMBOLS_CHECK_LEVEL = 2
|
||||
|
||||
BUILDDIR = $(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)
|
||||
|
||||
# Configuration arguments
|
||||
CONFIG_ARGS = \
|
||||
-Dudev_hwdb=enabled \
|
||||
-Dudev_rules=enabled \
|
||||
-Ddrivers=all \
|
||||
-Dgtk-examples=false
|
||||
|
||||
%:
|
||||
dh $@ --with gir
|
||||
|
||||
override_dh_auto_configure:
|
||||
dh_auto_configure -- $(CONFIG_ARGS)
|
||||
|
||||
override_dh_auto_test:
|
||||
dh_auto_test -- -C $(BUILDDIR) --timeout-multiplier 5
|
||||
|
||||
override_dh_auto_clean:
|
||||
rm -rf tests/__pycache__
|
||||
dh_auto_clean
|
||||
@@ -1 +0,0 @@
|
||||
3.0 (quilt)
|
||||
@@ -1,3 +0,0 @@
|
||||
# This TOD driver binary is built using sources inside this package
|
||||
# but at previous version, see tests/tod-drivers/README.md for more information
|
||||
libfprint source: source-is-missing [tests/tod-drivers/tod-*.so]
|
||||
@@ -1,6 +0,0 @@
|
||||
Test-Command: gnome-desktop-testing-runner libfprint-2
|
||||
Features: test-name=installed-tests
|
||||
Classes: desktop
|
||||
Depends: gnome-desktop-testing,
|
||||
libfprint-2-tests
|
||||
Restrictions: allow-stderr
|
||||
@@ -1,32 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
srcdir="${GBP_SOURCES_DIR:-.}"
|
||||
debpath="$(dirname "$0")"
|
||||
autosuspend_file="$srcdir/data/autosuspend.hwdb"
|
||||
commands_lines=()
|
||||
|
||||
while IFS= read -r line; do
|
||||
if [[ $line =~ ^usb:v([A-Fa-f0-9]{4})p([A-Fa-f0-9]{4}) ]]; then
|
||||
vendor="$(echo "${BASH_REMATCH[1]}" | tr '[:upper:]' '[:lower:]')"
|
||||
product="$(echo "${BASH_REMATCH[2]}" | tr '[:upper:]' '[:lower:]')"
|
||||
commands_lines+=("\tudevadm trigger --action=add --attr-match=idVendor=$vendor --attr-match=idProduct=$product || true")
|
||||
fi
|
||||
done < "$autosuspend_file"
|
||||
|
||||
UDEVADM_TRIGGERS=$( IFS=$'\n'; echo -e "${commands_lines[*]}" )
|
||||
export UDEVADM_TRIGGERS
|
||||
|
||||
for i in "$debpath"/libfprint-*.post*.in; do
|
||||
out="${i%.in}"
|
||||
perl -pe 's/\@UDEVADM_TRIGGERS\@/`printenv UDEVADM_TRIGGERS`/e' "$i" > "$out"
|
||||
|
||||
if [ -n "$GBP_BRANCH" ]; then
|
||||
if ! git diff-index --quiet HEAD -- "$out"; then
|
||||
git add "$out"
|
||||
dch "${out#$srcdir}: Devices triggers updated"
|
||||
git add debian/changelog
|
||||
debcommit
|
||||
fi
|
||||
fi
|
||||
done
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
Bug-Database: https://gitlab.freedesktop.org/3v1n0/libfprint/-/issues
|
||||
Bug-Submit: https://gitlab.freedesktop.org/3v1n0/libfprint/-/issues/new
|
||||
Repository-Browse: https://gitlab.freedesktop.org/3v1n0/libfprint/tree/tod
|
||||
@@ -1,5 +0,0 @@
|
||||
version=4
|
||||
|
||||
opts=versionmangle=s/_/./g \
|
||||
https://gitlab.freedesktop.org/3v1n0/@PACKAGE@/tags \
|
||||
.*\/archive\/[Vv]_?([\d_\+\.]+(?:\+git[0-9]+)?\+tod[0-9]+)\/@PACKAGE@-.*@ARCHIVE_EXT@
|
||||
@@ -22,11 +22,11 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include <libfprint/fprint.h>
|
||||
|
||||
struct _LibfprintDemo
|
||||
{
|
||||
GtkApplication parent;
|
||||
};
|
||||
G_DECLARE_FINAL_TYPE (LibfprintDemo, libfprint_demo, FP, DEMO, GtkApplication)
|
||||
#include "loop.h"
|
||||
|
||||
typedef GtkApplication LibfprintDemo;
|
||||
typedef GtkApplicationClass LibfprintDemoClass;
|
||||
|
||||
G_DEFINE_TYPE (LibfprintDemo, libfprint_demo, GTK_TYPE_APPLICATION)
|
||||
|
||||
typedef enum {
|
||||
@@ -35,28 +35,25 @@ typedef enum {
|
||||
IMAGE_DISPLAY_BINARY = 1 << 1
|
||||
} ImageDisplayFlags;
|
||||
|
||||
struct _LibfprintDemoWindow
|
||||
{
|
||||
typedef struct {
|
||||
GtkApplicationWindow parent_instance;
|
||||
|
||||
GtkWidget *header_bar;
|
||||
GtkWidget *mode_stack;
|
||||
GtkWidget *capture_button;
|
||||
GtkWidget *cancel_button;
|
||||
GtkWidget *capture_image;
|
||||
GtkWidget *spinner;
|
||||
GtkWidget *instructions;
|
||||
|
||||
GCancellable *cancellable;
|
||||
struct fp_dscv_dev *ddev;
|
||||
struct fp_dev *dev;
|
||||
|
||||
gboolean opened;
|
||||
FpDevice *dev;
|
||||
|
||||
FpImage *img;
|
||||
struct fp_img *img;
|
||||
ImageDisplayFlags img_flags;
|
||||
};
|
||||
} LibfprintDemoWindow;
|
||||
|
||||
typedef GtkApplicationWindowClass LibfprintDemoWindowClass;
|
||||
|
||||
G_DECLARE_FINAL_TYPE (LibfprintDemoWindow, libfprint_demo_window, FP, DEMO_WINDOW, GtkApplicationWindow)
|
||||
G_DEFINE_TYPE (LibfprintDemoWindow, libfprint_demo_window, GTK_TYPE_APPLICATION_WINDOW)
|
||||
|
||||
typedef enum {
|
||||
@@ -64,26 +61,33 @@ typedef enum {
|
||||
NOIMAGING_MODE,
|
||||
CAPTURE_MODE,
|
||||
SPINNER_MODE,
|
||||
ERROR_MODE,
|
||||
RETRY_MODE
|
||||
ERROR_MODE
|
||||
} LibfprintDemoMode;
|
||||
|
||||
static void libfprint_demo_set_mode (LibfprintDemoWindow *win,
|
||||
LibfprintDemoMode mode);
|
||||
|
||||
static void
|
||||
pixbuf_destroy (guchar *pixels, gpointer data)
|
||||
{
|
||||
if (pixels == NULL)
|
||||
return;
|
||||
g_free (pixels);
|
||||
}
|
||||
|
||||
static unsigned char *
|
||||
img_to_rgbdata (const guint8 *imgdata,
|
||||
img_to_rgbdata (struct fp_img *img,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
int size = width * height;
|
||||
guint8 *rgbdata = g_malloc (size * 3);
|
||||
unsigned char *imgdata = fp_img_get_data (img);
|
||||
unsigned char *rgbdata = g_malloc (size * 3);
|
||||
size_t i;
|
||||
size_t rgb_offset = 0;
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
{
|
||||
guint8 pixel = imgdata[i];
|
||||
for (i = 0; i < size; i++) {
|
||||
unsigned char pixel = imgdata[i];
|
||||
|
||||
rgbdata[rgb_offset++] = pixel;
|
||||
rgbdata[rgb_offset++] = pixel;
|
||||
@@ -97,19 +101,18 @@ static void
|
||||
plot_minutiae (unsigned char *rgbdata,
|
||||
int width,
|
||||
int height,
|
||||
GPtrArray *minutiae)
|
||||
struct fp_minutia **minlist,
|
||||
int nr_minutiae)
|
||||
{
|
||||
int i;
|
||||
|
||||
#define write_pixel(num) do { \
|
||||
rgbdata[((num) * 3)] = 0xff; \
|
||||
rgbdata[((num) * 3) + 1] = 0; \
|
||||
rgbdata[((num) * 3) + 2] = 0; \
|
||||
} while(0)
|
||||
|
||||
for (i = 0; i < minutiae->len; i++)
|
||||
{
|
||||
struct fp_minutia *min = g_ptr_array_index (minutiae, i);
|
||||
for (i = 0; i < nr_minutiae; i++) {
|
||||
struct fp_minutia *min = minlist[i];
|
||||
int x, y;
|
||||
size_t pixel_offset;
|
||||
|
||||
@@ -133,38 +136,36 @@ plot_minutiae (unsigned char *rgbdata,
|
||||
}
|
||||
|
||||
static GdkPixbuf *
|
||||
img_to_pixbuf (FpImage *img,
|
||||
img_to_pixbuf (struct fp_img *img,
|
||||
ImageDisplayFlags flags)
|
||||
{
|
||||
int width;
|
||||
int height;
|
||||
const guint8 *data;
|
||||
unsigned char *rgbdata;
|
||||
|
||||
width = fp_image_get_width (img);
|
||||
height = fp_image_get_height (img);
|
||||
width = fp_img_get_width (img);
|
||||
height = fp_img_get_height (img);
|
||||
|
||||
if (flags & IMAGE_DISPLAY_BINARY)
|
||||
data = fp_image_get_binarized (img, NULL);
|
||||
else
|
||||
data = fp_image_get_data (img, NULL);
|
||||
if (flags & IMAGE_DISPLAY_BINARY) {
|
||||
struct fp_img *binary;
|
||||
binary = fp_img_binarize (img);
|
||||
rgbdata = img_to_rgbdata (binary, width, height);
|
||||
fp_img_free (binary);
|
||||
} else {
|
||||
rgbdata = img_to_rgbdata (img, width, height);
|
||||
}
|
||||
|
||||
if (!data)
|
||||
return NULL;
|
||||
if (flags & IMAGE_DISPLAY_MINUTIAE) {
|
||||
struct fp_minutia **minlist;
|
||||
int nr_minutiae;
|
||||
|
||||
rgbdata = img_to_rgbdata (data, width, height);
|
||||
|
||||
if (flags & IMAGE_DISPLAY_MINUTIAE)
|
||||
{
|
||||
GPtrArray *minutiae;
|
||||
|
||||
minutiae = fp_image_get_minutiae (img);
|
||||
plot_minutiae (rgbdata, width, height, minutiae);
|
||||
minlist = fp_img_get_minutiae (img, &nr_minutiae);
|
||||
plot_minutiae (rgbdata, width, height, minlist, nr_minutiae);
|
||||
}
|
||||
|
||||
return gdk_pixbuf_new_from_data (rgbdata, GDK_COLORSPACE_RGB,
|
||||
FALSE, 8, width, height,
|
||||
width * 3, (GdkPixbufDestroyNotify) g_free,
|
||||
width * 3, pixbuf_destroy,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -173,8 +174,7 @@ update_image (LibfprintDemoWindow *win)
|
||||
{
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
if (win->img == NULL)
|
||||
{
|
||||
if (win->img == NULL) {
|
||||
gtk_image_clear (GTK_IMAGE (win->capture_image));
|
||||
return;
|
||||
}
|
||||
@@ -201,21 +201,20 @@ libfprint_demo_set_spinner_label (LibfprintDemoWindow *win,
|
||||
static void
|
||||
libfprint_demo_set_capture_label (LibfprintDemoWindow *win)
|
||||
{
|
||||
FpScanType scan_type;
|
||||
struct fp_driver *drv;
|
||||
enum fp_scan_type scan_type;
|
||||
const char *message;
|
||||
|
||||
scan_type = fp_device_get_scan_type (win->dev);
|
||||
drv = fp_dscv_dev_get_driver (win->ddev);
|
||||
scan_type = fp_driver_get_scan_type(drv);
|
||||
|
||||
switch (scan_type)
|
||||
{
|
||||
switch (scan_type) {
|
||||
case FP_SCAN_TYPE_PRESS:
|
||||
message = "Place your finger on the fingerprint reader";
|
||||
break;
|
||||
|
||||
case FP_SCAN_TYPE_SWIPE:
|
||||
message = "Swipe your finger across the fingerprint reader";
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
@@ -224,60 +223,46 @@ libfprint_demo_set_capture_label (LibfprintDemoWindow *win)
|
||||
}
|
||||
|
||||
static void
|
||||
dev_capture_start_cb (FpDevice *dev,
|
||||
GAsyncResult *res,
|
||||
dev_capture_start_cb (struct fp_dev *dev,
|
||||
int result,
|
||||
struct fp_img *img,
|
||||
void *user_data)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
LibfprintDemoWindow *win = user_data;
|
||||
FpImage *image = NULL;
|
||||
|
||||
g_clear_object (&win->cancellable);
|
||||
|
||||
image = fp_device_capture_finish (dev, res, &error);
|
||||
if (!image)
|
||||
{
|
||||
g_warning ("Error capturing data: %s", error->message);
|
||||
if (error->domain == FP_DEVICE_RETRY ||
|
||||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
libfprint_demo_set_mode (win, RETRY_MODE);
|
||||
else if (g_error_matches (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_NOT_SUPPORTED))
|
||||
libfprint_demo_set_mode (win, NOIMAGING_MODE);
|
||||
else
|
||||
if (result < 0) {
|
||||
libfprint_demo_set_mode (win, ERROR_MODE);
|
||||
return;
|
||||
}
|
||||
|
||||
g_clear_object (&win->img);
|
||||
win->img = image;
|
||||
fp_async_capture_stop (dev, NULL, NULL);
|
||||
|
||||
win->img = img;
|
||||
update_image (win);
|
||||
|
||||
libfprint_demo_set_mode (win, CAPTURE_MODE);
|
||||
}
|
||||
|
||||
static void
|
||||
dev_start_capture (LibfprintDemoWindow *win)
|
||||
{
|
||||
libfprint_demo_set_capture_label (win);
|
||||
|
||||
fp_device_capture (win->dev, TRUE, win->cancellable, (GAsyncReadyCallback) dev_capture_start_cb, win);
|
||||
}
|
||||
|
||||
static void
|
||||
dev_open_cb (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
dev_open_cb (struct fp_dev *dev, int status, void *user_data)
|
||||
{
|
||||
LibfprintDemoWindow *win = user_data;
|
||||
int r;
|
||||
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
if (!fp_device_open_finish (dev, res, &error))
|
||||
{
|
||||
g_warning ("Failed to open device: %s", error->message);
|
||||
if (status < 0) {
|
||||
libfprint_demo_set_mode (win, ERROR_MODE);
|
||||
return;
|
||||
}
|
||||
|
||||
dev_start_capture (win);
|
||||
libfprint_demo_set_capture_label (win);
|
||||
|
||||
win->dev = dev;
|
||||
r = fp_async_capture_start (win->dev, FALSE, dev_capture_start_cb, user_data);
|
||||
if (r < 0) {
|
||||
g_warning ("fp_async_capture_start failed: %d", r);
|
||||
libfprint_demo_set_mode (win, ERROR_MODE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -286,36 +271,24 @@ activate_capture (GSimpleAction *action,
|
||||
gpointer user_data)
|
||||
{
|
||||
LibfprintDemoWindow *win = user_data;
|
||||
int r;
|
||||
|
||||
libfprint_demo_set_mode (win, SPINNER_MODE);
|
||||
g_clear_pointer (&win->img, g_object_unref);
|
||||
g_clear_pointer (&win->img, fp_img_free);
|
||||
|
||||
g_clear_object (&win->cancellable);
|
||||
win->cancellable = g_cancellable_new ();
|
||||
|
||||
if (win->opened)
|
||||
{
|
||||
dev_start_capture (win);
|
||||
if (win->dev != NULL) {
|
||||
dev_open_cb (win->dev, 0, user_data);
|
||||
return;
|
||||
}
|
||||
|
||||
libfprint_demo_set_spinner_label (win, "Opening fingerprint reader");
|
||||
|
||||
win->opened = TRUE;
|
||||
fp_device_open (win->dev, win->cancellable, (GAsyncReadyCallback) dev_open_cb, user_data);
|
||||
r = fp_async_dev_open (win->ddev, dev_open_cb, user_data);
|
||||
if (r < 0) {
|
||||
g_warning ("fp_async_dev_open failed: %d", r);
|
||||
libfprint_demo_set_mode (win, ERROR_MODE);
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
cancel_capture (GSimpleAction *action,
|
||||
GVariant *parameter,
|
||||
gpointer user_data)
|
||||
{
|
||||
LibfprintDemoWindow *win = user_data;
|
||||
|
||||
g_debug ("cancelling %p", win->cancellable);
|
||||
|
||||
if (win->cancellable)
|
||||
g_cancellable_cancel (win->cancellable);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -406,8 +379,7 @@ static GActionEntry app_entries[] = {
|
||||
static GActionEntry win_entries[] = {
|
||||
{ "show-minutiae", activate_show_minutiae, NULL, "false", change_show_minutiae_state },
|
||||
{ "show-binary", activate_show_binary, NULL, "false", change_show_binary_state },
|
||||
{ "capture", activate_capture, NULL, NULL, NULL },
|
||||
{ "cancel", cancel_capture, NULL, NULL, NULL }
|
||||
{ "capture", activate_capture, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
static void
|
||||
@@ -425,57 +397,41 @@ static void
|
||||
libfprint_demo_set_mode (LibfprintDemoWindow *win,
|
||||
LibfprintDemoMode mode)
|
||||
{
|
||||
struct fp_driver *drv;
|
||||
char *title;
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
switch (mode) {
|
||||
case EMPTY_MODE:
|
||||
gtk_stack_set_visible_child_name (GTK_STACK (win->mode_stack), "empty-mode");
|
||||
gtk_widget_set_sensitive (win->capture_button, FALSE);
|
||||
gtk_widget_set_sensitive (win->cancel_button, FALSE);
|
||||
gtk_spinner_stop (GTK_SPINNER (win->spinner));
|
||||
break;
|
||||
|
||||
case NOIMAGING_MODE:
|
||||
gtk_stack_set_visible_child_name (GTK_STACK (win->mode_stack), "noimaging-mode");
|
||||
gtk_widget_set_sensitive (win->capture_button, FALSE);
|
||||
gtk_widget_set_sensitive (win->cancel_button, FALSE);
|
||||
gtk_spinner_stop (GTK_SPINNER (win->spinner));
|
||||
break;
|
||||
|
||||
case CAPTURE_MODE:
|
||||
gtk_stack_set_visible_child_name (GTK_STACK (win->mode_stack), "capture-mode");
|
||||
gtk_widget_set_sensitive (win->capture_button, TRUE);
|
||||
gtk_widget_set_sensitive (win->cancel_button, FALSE);
|
||||
|
||||
title = g_strdup_printf ("%s Test", fp_device_get_name (win->dev));
|
||||
drv = fp_dscv_dev_get_driver (win->ddev);
|
||||
title = g_strdup_printf ("%s Test", fp_driver_get_full_name (drv));
|
||||
gtk_header_bar_set_title (GTK_HEADER_BAR (win->header_bar), title);
|
||||
g_free (title);
|
||||
|
||||
gtk_spinner_stop (GTK_SPINNER (win->spinner));
|
||||
break;
|
||||
|
||||
case SPINNER_MODE:
|
||||
gtk_stack_set_visible_child_name (GTK_STACK (win->mode_stack), "spinner-mode");
|
||||
gtk_widget_set_sensitive (win->capture_button, FALSE);
|
||||
gtk_widget_set_sensitive (win->cancel_button, TRUE);
|
||||
gtk_spinner_start (GTK_SPINNER (win->spinner));
|
||||
break;
|
||||
|
||||
case ERROR_MODE:
|
||||
gtk_stack_set_visible_child_name (GTK_STACK (win->mode_stack), "error-mode");
|
||||
gtk_widget_set_sensitive (win->capture_button, FALSE);
|
||||
gtk_widget_set_sensitive (win->cancel_button, FALSE);
|
||||
gtk_spinner_stop (GTK_SPINNER (win->spinner));
|
||||
break;
|
||||
|
||||
case RETRY_MODE:
|
||||
gtk_stack_set_visible_child_name (GTK_STACK (win->mode_stack), "retry-mode");
|
||||
gtk_widget_set_sensitive (win->capture_button, TRUE);
|
||||
gtk_widget_set_sensitive (win->cancel_button, FALSE);
|
||||
gtk_spinner_stop (GTK_SPINNER (win->spinner));
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
@@ -500,8 +456,7 @@ libfprint_demo_class_init (LibfprintDemoClass *class)
|
||||
static void
|
||||
libfprint_demo_window_init (LibfprintDemoWindow *window)
|
||||
{
|
||||
FpContext *ctx;
|
||||
GPtrArray *devices;
|
||||
struct fp_dscv_dev **discovered_devs;
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (window));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 700, 500);
|
||||
@@ -510,29 +465,32 @@ libfprint_demo_window_init (LibfprintDemoWindow *window)
|
||||
win_entries, G_N_ELEMENTS (win_entries),
|
||||
window);
|
||||
|
||||
ctx = fp_context_new ();
|
||||
if (fp_init () < 0) {
|
||||
libfprint_demo_set_mode (window, ERROR_MODE);
|
||||
return;
|
||||
}
|
||||
|
||||
devices = fp_context_get_devices (ctx);
|
||||
if (!devices)
|
||||
{
|
||||
setup_pollfds ();
|
||||
|
||||
discovered_devs = fp_discover_devs();
|
||||
if (!discovered_devs) {
|
||||
libfprint_demo_set_mode (window, ERROR_MODE);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Empty list? */
|
||||
if (devices->len == 0)
|
||||
{
|
||||
if (discovered_devs[0] == NULL) {
|
||||
fp_dscv_devs_free (discovered_devs);
|
||||
libfprint_demo_set_mode (window, EMPTY_MODE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fp_device_has_feature (g_ptr_array_index (devices, 0), FP_DEVICE_FEATURE_CAPTURE))
|
||||
{
|
||||
if (!fp_driver_supports_imaging(fp_dscv_dev_get_driver(discovered_devs[0]))) {
|
||||
libfprint_demo_set_mode (window, NOIMAGING_MODE);
|
||||
return;
|
||||
}
|
||||
|
||||
window->dev = g_object_ref (g_ptr_array_index (devices, 0));
|
||||
window->ddev = discovered_devs[0];
|
||||
libfprint_demo_set_mode (window, CAPTURE_MODE);
|
||||
}
|
||||
|
||||
@@ -545,7 +503,6 @@ libfprint_demo_window_class_init (LibfprintDemoWindowClass *class)
|
||||
gtk_widget_class_bind_template_child (widget_class, LibfprintDemoWindow, header_bar);
|
||||
gtk_widget_class_bind_template_child (widget_class, LibfprintDemoWindow, mode_stack);
|
||||
gtk_widget_class_bind_template_child (widget_class, LibfprintDemoWindow, capture_button);
|
||||
gtk_widget_class_bind_template_child (widget_class, LibfprintDemoWindow, cancel_button);
|
||||
gtk_widget_class_bind_template_child (widget_class, LibfprintDemoWindow, capture_image);
|
||||
gtk_widget_class_bind_template_child (widget_class, LibfprintDemoWindow, spinner);
|
||||
gtk_widget_class_bind_template_child (widget_class, LibfprintDemoWindow, instructions);
|
||||
@@ -553,8 +510,7 @@ libfprint_demo_window_class_init (LibfprintDemoWindowClass *class)
|
||||
//FIXME setup dispose
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
GtkApplication *app;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.22.0 -->
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<template class="LibfprintDemoWindow" parent="GtkApplicationWindow">
|
||||
@@ -7,6 +7,59 @@
|
||||
<property name="default_width">500</property>
|
||||
<property name="default_height">400</property>
|
||||
<property name="show_menubar">False</property>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar" id="header_bar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title">Fingerprint Reader Test</property>
|
||||
<property name="subtitle">Capture test</property>
|
||||
<property name="show_close_button">True</property>
|
||||
<child>
|
||||
<object class="GtkMenuButton" id="option-menu-button">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="menu-model">options-menu</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">open-menu-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack_type">end</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="capture_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="action_name">win.capture</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="capture_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">_Capture</property>
|
||||
<property name="use_underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="text-button"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack_type">end</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStack" id="mode_stack">
|
||||
<property name="visible">True</property>
|
||||
@@ -51,6 +104,9 @@
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
@@ -60,6 +116,70 @@
|
||||
<property name="title">spinner-mode</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="empty-mode">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="row_spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_bottom">9</property>
|
||||
<property name="pixel_size">192</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_top">9</property>
|
||||
<property name="label" translatable="yes"><b><span size="large">No fingerprint readers found</span></b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Please connect a supported fingerprint reader and start the application again</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">empty-mode</property>
|
||||
<property name="title">empty-mode</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAspectFrame" id="capture-mode">
|
||||
<property name="visible">True</property>
|
||||
@@ -81,7 +201,7 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="retry-mode">
|
||||
<object class="GtkGrid" id="error-mode">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
@@ -108,7 +228,7 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_top">9</property>
|
||||
<property name="label" translatable="yes"><b><span size="large">Device reported a recoverable error. Please retry!</span></b></property>
|
||||
<property name="label" translatable="yes"><b><span size="large">An error occurred trying to access the fingerprint reader</span></b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -116,6 +236,20 @@
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Please consult the debugging output before restarting the application</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
@@ -127,8 +261,8 @@
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">retry-mode</property>
|
||||
<property name="title">retry-mode</property>
|
||||
<property name="name">error-mode</property>
|
||||
<property name="title">error-mode</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
@@ -198,216 +332,6 @@
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="error-mode">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="row_spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_bottom">9</property>
|
||||
<property name="pixel_size">192</property>
|
||||
<property name="icon_name">dialog-warning-symbolic</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_top">9</property>
|
||||
<property name="label" translatable="yes"><b><span size="large">An error occurred trying to access the fingerprint reader</span></b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Please consult the debugging output before restarting the application</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">error-mode</property>
|
||||
<property name="title">error-mode</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="empty-mode">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="row_spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_bottom">9</property>
|
||||
<property name="pixel_size">192</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_top">9</property>
|
||||
<property name="label" translatable="yes"><b><span size="large">No fingerprint readers found</span></b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Please connect a supported fingerprint reader and start the application again</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">empty-mode</property>
|
||||
<property name="title">empty-mode</property>
|
||||
<property name="position">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar" id="header_bar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title">Fingerprint Reader Test</property>
|
||||
<property name="subtitle">Capture test</property>
|
||||
<property name="show_close_button">True</property>
|
||||
<child>
|
||||
<object class="GtkMenuButton" id="option-menu-button">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="menu-model">options-menu</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">open-menu-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack_type">end</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="cancel_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="action_name">win.cancel</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="cancel_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Cancel</property>
|
||||
<property name="use_underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="text-button"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="capture_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="action_name">win.capture</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="capture_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">_Capture</property>
|
||||
<property name="use_underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="text-button"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
/*
|
||||
* fprint D-Bus daemon
|
||||
* Copyright (C) 2008 Daniel Drake <dsd@gentoo.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <libfprint/fprint.h>
|
||||
|
||||
#include <poll.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "loop.h"
|
||||
|
||||
struct fdsource {
|
||||
GSource source;
|
||||
GSList *pollfds;
|
||||
};
|
||||
|
||||
static gboolean source_prepare(GSource *source, gint *timeout)
|
||||
{
|
||||
int r;
|
||||
struct timeval tv;
|
||||
|
||||
r = fp_get_next_timeout(&tv);
|
||||
if (r == 0) {
|
||||
*timeout = -1;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!timerisset(&tv))
|
||||
return TRUE;
|
||||
|
||||
*timeout = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean source_check(GSource *source)
|
||||
{
|
||||
struct fdsource *_fdsource = (struct fdsource *) source;
|
||||
GSList *l;
|
||||
struct timeval tv;
|
||||
int r;
|
||||
|
||||
if (!_fdsource->pollfds)
|
||||
return FALSE;
|
||||
|
||||
for (l = _fdsource->pollfds; l != NULL; l = l->next) {
|
||||
GPollFD *pollfd = l->data;
|
||||
|
||||
if (pollfd->revents)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
r = fp_get_next_timeout(&tv);
|
||||
if (r == 1 && !timerisset(&tv))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean source_dispatch(GSource *source, GSourceFunc callback,
|
||||
gpointer data)
|
||||
{
|
||||
struct timeval zerotimeout = {
|
||||
.tv_sec = 0,
|
||||
.tv_usec = 0,
|
||||
};
|
||||
|
||||
/* FIXME error handling */
|
||||
fp_handle_events_timeout(&zerotimeout);
|
||||
|
||||
/* FIXME whats the return value used for? */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void source_finalize(GSource *source)
|
||||
{
|
||||
struct fdsource *_fdsource = (struct fdsource *) source;
|
||||
GSList *l;
|
||||
|
||||
if (!_fdsource->pollfds)
|
||||
return;
|
||||
|
||||
for (l = _fdsource->pollfds; l != NULL; l = l->next) {
|
||||
GPollFD *pollfd = l->data;
|
||||
|
||||
g_source_remove_poll((GSource *) _fdsource, pollfd);
|
||||
g_slice_free(GPollFD, pollfd);
|
||||
_fdsource->pollfds = g_slist_delete_link(_fdsource->pollfds, l);
|
||||
}
|
||||
|
||||
g_slist_free(_fdsource->pollfds);
|
||||
}
|
||||
|
||||
static GSourceFuncs sourcefuncs = {
|
||||
.prepare = source_prepare,
|
||||
.check = source_check,
|
||||
.dispatch = source_dispatch,
|
||||
.finalize = source_finalize,
|
||||
};
|
||||
|
||||
static struct fdsource *fdsource = NULL;
|
||||
|
||||
static void pollfd_add(int fd, short events)
|
||||
{
|
||||
GPollFD *pollfd;
|
||||
|
||||
pollfd = g_slice_new(GPollFD);
|
||||
pollfd->fd = fd;
|
||||
pollfd->events = 0;
|
||||
pollfd->revents = 0;
|
||||
if (events & POLLIN)
|
||||
pollfd->events |= G_IO_IN;
|
||||
if (events & POLLOUT)
|
||||
pollfd->events |= G_IO_OUT;
|
||||
|
||||
fdsource->pollfds = g_slist_prepend(fdsource->pollfds, pollfd);
|
||||
g_source_add_poll((GSource *) fdsource, pollfd);
|
||||
}
|
||||
|
||||
static void pollfd_added_cb(int fd, short events)
|
||||
{
|
||||
g_debug("now monitoring fd %d", fd);
|
||||
pollfd_add(fd, events);
|
||||
}
|
||||
|
||||
static void pollfd_removed_cb(int fd)
|
||||
{
|
||||
GSList *l;
|
||||
|
||||
g_debug("no longer monitoring fd %d", fd);
|
||||
|
||||
if (!fdsource->pollfds) {
|
||||
g_debug("cannot remove from list as list is empty?");
|
||||
return;
|
||||
}
|
||||
|
||||
for (l = fdsource->pollfds; l != NULL; l = l->next) {
|
||||
GPollFD *pollfd = l->data;
|
||||
|
||||
if (pollfd->fd != fd)
|
||||
continue;
|
||||
|
||||
g_source_remove_poll((GSource *) fdsource, pollfd);
|
||||
g_slice_free(GPollFD, pollfd);
|
||||
fdsource->pollfds = g_slist_delete_link(fdsource->pollfds, l);
|
||||
return;
|
||||
}
|
||||
|
||||
g_error("couldn't find fd %d in list\n", fd);
|
||||
}
|
||||
|
||||
int setup_pollfds(void)
|
||||
{
|
||||
ssize_t numfds;
|
||||
size_t i;
|
||||
struct fp_pollfd *fpfds;
|
||||
GSource *gsource;
|
||||
|
||||
gsource = g_source_new(&sourcefuncs, sizeof(struct fdsource));
|
||||
fdsource = (struct fdsource *) gsource;
|
||||
fdsource->pollfds = NULL;
|
||||
|
||||
numfds = fp_get_pollfds(&fpfds);
|
||||
if (numfds < 0) {
|
||||
if (fpfds)
|
||||
free(fpfds);
|
||||
return (int) numfds;
|
||||
} else if (numfds > 0) {
|
||||
for (i = 0; i < numfds; i++) {
|
||||
struct fp_pollfd *fpfd = &fpfds[i];
|
||||
pollfd_add(fpfd->fd, fpfd->events);
|
||||
}
|
||||
}
|
||||
|
||||
free(fpfds);
|
||||
fp_set_pollfd_notifiers(pollfd_added_cb, pollfd_removed_cb);
|
||||
g_source_attach(gsource, NULL);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2008 Daniel Drake <dsd@gentoo.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef POLL_H
|
||||
|
||||
#define POLL_H
|
||||
|
||||
int setup_pollfds(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
gtk_test_resources = gnome.compile_resources('gtk-test-resources',
|
||||
'gtk-libfprint-test.gresource.xml',
|
||||
gtk_test_resources = gnome.compile_resources('gtk-test-resources', 'gtk-libfprint-test.gresource.xml',
|
||||
source_dir : '.',
|
||||
c_name : 'gtk_test')
|
||||
|
||||
@@ -8,12 +7,13 @@ bindir = join_paths(prefix, get_option('bindir'))
|
||||
datadir = join_paths(prefix, get_option('datadir'))
|
||||
|
||||
executable('gtk-libfprint-test',
|
||||
[ 'gtk-libfprint-test.c', gtk_test_resources ],
|
||||
dependencies: [
|
||||
gtk_dep,
|
||||
libfprint_dep,
|
||||
[ 'gtk-libfprint-test.c', 'loop.c', 'loop.h', gtk_test_resources ],
|
||||
dependencies: [ libfprint_dep, gtk_dep ],
|
||||
include_directories: [
|
||||
root_inc,
|
||||
],
|
||||
c_args: '-DPACKAGE_VERSION="' + meson.project_version() + '"',
|
||||
c_args: [ common_cflags,
|
||||
'-DPACKAGE_VERSION="' + meson.project_version() + '"' ],
|
||||
install: true,
|
||||
install_dir: bindir)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"command": "gtk-libfprint-test",
|
||||
"finish-args": [
|
||||
/* X11 + XShm access */
|
||||
"--share=ipc", "--socket=fallback-x11",
|
||||
"--share=ipc", "--socket=x11",
|
||||
/* Wayland access */
|
||||
"--socket=wayland",
|
||||
/* OpenGL access */
|
||||
@@ -18,7 +18,7 @@
|
||||
"modules": [
|
||||
{
|
||||
"name": "libusb",
|
||||
"config-opts": [ "--disable-static" ],
|
||||
"config-opts": [ "--disable-static", "--disable-udev" ],
|
||||
"cleanup": [
|
||||
"/lib/*.la",
|
||||
"/lib/pkgconfig",
|
||||
@@ -27,46 +27,23 @@
|
||||
"sources": [
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2",
|
||||
"sha256": "12ce7a61fc9854d1d2a1ffe095f7b5fac19ddba095c259e6067a46500381b5a5"
|
||||
"url": "https://github.com/libusb/libusb/archive/v1.0.22.tar.gz",
|
||||
"sha256": "3500f7b182750cd9ccf9be8b1df998f83df56a39ab264976bdb3307773e16f48"
|
||||
}
|
||||
],
|
||||
"post-install": [
|
||||
"install -Dm644 COPYING /app/share/licenses/libusb/COPYING"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "libgusb",
|
||||
"buildsystem": "meson",
|
||||
"config-opts": [ "-Dtests=false", "-Dvapi=false", "-Ddocs=false" ],
|
||||
"sources": [
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://github.com/hughsie/libgusb/releases/download/0.4.6/libgusb-0.4.6.tar.xz",
|
||||
"sha256": "1b0422bdcd72183272ac42eec9398c5a0bc48a02f618fa3242c468cbbd003049"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gudev",
|
||||
"buildsystem": "meson",
|
||||
"config-opts": [ "-Dtests=disabled", "-Dintrospection=disabled", "-Dvapi=disabled" ],
|
||||
"sources": [
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://download.gnome.org/sources/libgudev/238/libgudev-238.tar.xz",
|
||||
"sha256": "61266ab1afc9d73dbc60a8b2af73e99d2fdff47d99544d085760e4fa667b5dd1"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "libfprint",
|
||||
"buildsystem": "meson",
|
||||
"config-opts": [ "-Dudev_hwdb=disabled", "-Dudev_rules=disabled", "-Dgtk-examples=true", "-Ddrivers=all" ],
|
||||
"config-opts": [ "-Dudev_rules=false", "-Dx11-examples=false", "-Dgtk-examples=true" ],
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://gitlab.freedesktop.org/libfprint/libfprint.git"
|
||||
"url": "https://gitlab.freedesktop.org/libfprint/libfprint.git",
|
||||
"branch": "wip/hadess/gtk-example"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -60,18 +60,21 @@
|
||||
<para>
|
||||
In summary, libfprint represents fingerprints in several internal structures
|
||||
and each representation will offer you a way of determining the
|
||||
<ulink url="#driver">driver</ulink> and <ulink url="#device-id">device ID</ulink> of the print in
|
||||
<ulink url="#driver_id">driver ID</ulink> and <ulink url="#device-types">devtype</ulink> of the print in
|
||||
question. Prints are only compatible if the driver ID <emphasis role="strong">and</emphasis> devtypes
|
||||
match. libfprint does offer you some "is this print compatible?" helper
|
||||
functions, so you don't have to worry about these details too much.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="driver">
|
||||
<title>Driver</title>
|
||||
<refsect2 id="driver_id">
|
||||
<title>Driver IDs</title>
|
||||
|
||||
<para>
|
||||
Each driver is assigned a unique string identifier by the project maintainer.
|
||||
Each driver is assigned a unique ID by the project maintainer. These
|
||||
assignments are
|
||||
<ulink url="https://gitlab.freedesktop.org/libfprint/libfprint/blob/master/libfprint/drivers/driver_ids.h">
|
||||
documented in the sources</ulink> and will never change.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -86,23 +89,22 @@
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="device-id">
|
||||
<title>Device ID</title>
|
||||
<refsect2 id="device-types">
|
||||
<title>Device types</title>
|
||||
|
||||
<para>
|
||||
Internally, the behind a device assigns a string identifier to the device
|
||||
This cannot be used as a unique ID for a specific device as many devices
|
||||
under the same range may share the same devtype. The device ID may even
|
||||
be the same string in all cases. It is guaranteed to have a non-zero length
|
||||
and be a valid file name. It defaults to "0".
|
||||
Internally, the <ulink url="libfprint-Driver-operations.html#libfprint-Driver-operations.description">driver</ulink> behind a device assigns a 32-bit
|
||||
<emphasis>devtype</emphasis> identifier to the device. This cannot be used as a unique
|
||||
ID for a specific device as many devices under the same range may share
|
||||
the same devtype. The devtype may even be 0 in all cases.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The only reason you may be interested in retrieving the device ID for a
|
||||
The only reason you may be interested in retrieving the devtype for a
|
||||
device is for the purpose of checking if some print data is compatible
|
||||
with a device. libfprint uses the device ID as one way of checking that the
|
||||
with a device. libfprint uses the devtype as one way of checking that the
|
||||
print you are verifying is compatible with the device in question - the
|
||||
device ID must be equal. This effectively allows drivers to support more
|
||||
devtypes must be equal. This effectively allows drivers to support more
|
||||
than one type of device where the data from each one is not compatible with
|
||||
the other. Note that libfprint does provide you with helper functions to
|
||||
determine whether a print is compatible with a device, so under most
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
|
||||
<para>
|
||||
Usually the first thing you want to do is determine which fingerprint
|
||||
devices are present. This is done using the <ulink url="fp-context.html">FpContext</ulink> object.
|
||||
devices are present. This is done through <ulink url="libfprint-Device-discovery.html">device discovery</ulink>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Once you have found a device you would like to operate, you should open it.
|
||||
Refer to <ulink url="fp-context.html">device operations</ulink>. This section also details enrollment,
|
||||
Refer to <ulink url="libfprint-Devices-operations.html">device operations</ulink>. This section also details enrollment,
|
||||
image capture, and verification.
|
||||
</para>
|
||||
|
||||
|
||||
@@ -1,310 +0,0 @@
|
||||
<SECTION>
|
||||
<FILE>drivers_api</FILE>
|
||||
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>fp-context</FILE>
|
||||
<TITLE>FpContext</TITLE>
|
||||
FP_TYPE_CONTEXT
|
||||
FpContextClass
|
||||
fp_context_new
|
||||
fp_context_enumerate
|
||||
fp_context_get_devices
|
||||
FpContext
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>fp-device</FILE>
|
||||
FP_TYPE_DEVICE
|
||||
FP_DEVICE_RETRY
|
||||
FP_DEVICE_ERROR
|
||||
FpDeviceType
|
||||
FpDeviceFeature
|
||||
FpScanType
|
||||
FpDeviceRetry
|
||||
FpDeviceError
|
||||
FpFingerStatusFlags
|
||||
fp_device_retry_quark
|
||||
fp_device_error_quark
|
||||
FpEnrollProgress
|
||||
FpMatchCb
|
||||
fp_device_get_driver
|
||||
fp_device_get_device_id
|
||||
fp_device_get_name
|
||||
fp_device_get_scan_type
|
||||
fp_device_get_nr_enroll_stages
|
||||
fp_device_get_finger_status
|
||||
fp_device_get_features
|
||||
fp_device_has_feature
|
||||
fp_device_has_storage
|
||||
fp_device_supports_identify
|
||||
fp_device_supports_capture
|
||||
fp_device_is_open
|
||||
fp_device_open
|
||||
fp_device_close
|
||||
fp_device_enroll
|
||||
fp_device_verify
|
||||
fp_device_identify
|
||||
fp_device_capture
|
||||
fp_device_delete_print
|
||||
fp_device_list_prints
|
||||
fp_device_clear_storage
|
||||
fp_device_suspend
|
||||
fp_device_resume
|
||||
fp_device_open_finish
|
||||
fp_device_close_finish
|
||||
fp_device_enroll_finish
|
||||
fp_device_verify_finish
|
||||
fp_device_identify_finish
|
||||
fp_device_capture_finish
|
||||
fp_device_delete_print_finish
|
||||
fp_device_list_prints_finish
|
||||
fp_device_clear_storage_finish
|
||||
fp_device_suspend_finish
|
||||
fp_device_resume_finish
|
||||
fp_device_open_sync
|
||||
fp_device_close_sync
|
||||
fp_device_enroll_sync
|
||||
fp_device_verify_sync
|
||||
fp_device_identify_sync
|
||||
fp_device_capture_sync
|
||||
fp_device_delete_print_sync
|
||||
fp_device_list_prints_sync
|
||||
fp_device_clear_storage_sync
|
||||
fp_device_suspend_sync
|
||||
fp_device_resume_sync
|
||||
FpDevice
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>fp-image</FILE>
|
||||
FP_TYPE_IMAGE
|
||||
FpMinutia
|
||||
fp_image_new
|
||||
fp_image_get_width
|
||||
fp_image_get_height
|
||||
fp_image_get_ppmm
|
||||
fp_image_get_minutiae
|
||||
fp_image_detect_minutiae
|
||||
fp_image_detect_minutiae_finish
|
||||
fp_image_get_data
|
||||
fp_image_get_binarized
|
||||
fp_minutia_get_coords
|
||||
FpImage
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>fp-image-device</FILE>
|
||||
FP_TYPE_IMAGE_DEVICE
|
||||
FpImageDevice
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>fp-print</FILE>
|
||||
FP_TYPE_PRINT
|
||||
FpFinger
|
||||
FpPrint
|
||||
fp_print_new
|
||||
fp_print_get_driver
|
||||
fp_print_get_device_id
|
||||
fp_print_get_device_stored
|
||||
fp_print_get_image
|
||||
fp_print_get_finger
|
||||
fp_print_get_username
|
||||
fp_print_get_description
|
||||
fp_print_get_enroll_date
|
||||
fp_print_set_finger
|
||||
fp_print_set_username
|
||||
fp_print_set_description
|
||||
fp_print_set_enroll_date
|
||||
fp_print_compatible
|
||||
fp_print_equal
|
||||
fp_print_serialize
|
||||
fp_print_deserialize
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>fpi-assembling</FILE>
|
||||
fpi_frame
|
||||
fpi_frame_asmbl_ctx
|
||||
fpi_do_movement_estimation
|
||||
fpi_assemble_frames
|
||||
fpi_line_asmbl_ctx
|
||||
fpi_assemble_lines
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>fpi-context</FILE>
|
||||
fpi_get_driver_types
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>fpi-device</FILE>
|
||||
FpDeviceClass
|
||||
FpTimeoutFunc
|
||||
FpiDeviceAction
|
||||
FpIdEntry
|
||||
FpiDeviceUdevSubtypeFlags
|
||||
fpi_device_get_usb_device
|
||||
fpi_device_get_udev_data
|
||||
fpi_device_get_virtual_env
|
||||
fpi_device_get_current_action
|
||||
fpi_device_retry_new
|
||||
fpi_device_error_new
|
||||
fpi_device_retry_new_msg
|
||||
fpi_device_error_new_msg
|
||||
fpi_device_get_driver_data
|
||||
fpi_device_get_enroll_data
|
||||
fpi_device_get_capture_data
|
||||
fpi_device_get_verify_data
|
||||
fpi_device_get_identify_data
|
||||
fpi_device_get_delete_data
|
||||
fpi_device_get_cancellable
|
||||
fpi_device_action_is_cancelled
|
||||
fpi_device_add_timeout
|
||||
fpi_device_set_nr_enroll_stages
|
||||
fpi_device_set_scan_type
|
||||
fpi_device_update_features
|
||||
fpi_device_critical_enter
|
||||
fpi_device_critical_leave
|
||||
fpi_device_remove
|
||||
fpi_device_report_finger_status
|
||||
fpi_device_report_finger_status_changes
|
||||
fpi_device_action_error
|
||||
fpi_device_probe_complete
|
||||
fpi_device_open_complete
|
||||
fpi_device_close_complete
|
||||
fpi_device_enroll_complete
|
||||
fpi_device_verify_complete
|
||||
fpi_device_identify_complete
|
||||
fpi_device_capture_complete
|
||||
fpi_device_clear_storage_complete
|
||||
fpi_device_delete_complete
|
||||
fpi_device_list_complete
|
||||
fpi_device_suspend_complete
|
||||
fpi_device_resume_complete
|
||||
fpi_device_enroll_progress
|
||||
fpi_device_verify_report
|
||||
fpi_device_identify_report
|
||||
fpi_device_class_auto_initialize_features
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>fpi-image</FILE>
|
||||
FpiImageFlags
|
||||
FpImage
|
||||
fpi_std_sq_dev
|
||||
fpi_mean_sq_diff_norm
|
||||
fpi_image_resize
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>fpi-image-device</FILE>
|
||||
<TITLE>Internal FpImageDevice</TITLE>
|
||||
FpiImageDeviceState
|
||||
FpImageDeviceClass
|
||||
fpi_image_device_session_error
|
||||
fpi_image_device_open_complete
|
||||
fpi_image_device_close_complete
|
||||
fpi_image_device_activate_complete
|
||||
fpi_image_device_deactivate_complete
|
||||
fpi_image_device_report_finger_status
|
||||
fpi_image_device_image_captured
|
||||
fpi_image_device_retry_scan
|
||||
fpi_image_device_set_bz3_threshold
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>fpi-log</FILE>
|
||||
fp_dbg
|
||||
fp_info
|
||||
fp_warn
|
||||
fp_err
|
||||
BUG_ON
|
||||
BUG
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>fpi-print</FILE>
|
||||
FpiPrintType
|
||||
FpiMatchResult
|
||||
fpi_print_add_print
|
||||
fpi_print_set_type
|
||||
fpi_print_set_device_stored
|
||||
fpi_print_add_from_image
|
||||
fpi_print_bz3_match
|
||||
fpi_print_generate_user_id
|
||||
fpi_print_fill_from_user_id
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>fpi-ssm</FILE>
|
||||
FpiSsmCompletedCallback
|
||||
FpiSsmHandlerCallback
|
||||
fpi_ssm_new
|
||||
fpi_ssm_new_full
|
||||
fpi_ssm_free
|
||||
fpi_ssm_start
|
||||
fpi_ssm_start_subsm
|
||||
fpi_ssm_next_state
|
||||
fpi_ssm_next_state_delayed
|
||||
fpi_ssm_jump_to_state
|
||||
fpi_ssm_jump_to_state_delayed
|
||||
fpi_ssm_cancel_delayed_state_change
|
||||
fpi_ssm_mark_completed
|
||||
fpi_ssm_mark_failed
|
||||
fpi_ssm_set_data
|
||||
fpi_ssm_get_data
|
||||
fpi_ssm_get_device
|
||||
fpi_ssm_get_error
|
||||
fpi_ssm_dup_error
|
||||
fpi_ssm_get_cur_state
|
||||
fpi_ssm_silence_debug
|
||||
fpi_ssm_spi_transfer_cb
|
||||
fpi_ssm_spi_transfer_with_weak_pointer_cb
|
||||
fpi_ssm_usb_transfer_cb
|
||||
fpi_ssm_usb_transfer_with_weak_pointer_cb
|
||||
FpiSsm
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>fpi-usb-transfer</FILE>
|
||||
FPI_USB_ENDPOINT_IN
|
||||
FPI_USB_ENDPOINT_OUT
|
||||
FpiUsbTransferCallback
|
||||
FpiTransferType
|
||||
FpiUsbTransfer
|
||||
fpi_usb_transfer_new
|
||||
fpi_usb_transfer_ref
|
||||
fpi_usb_transfer_unref
|
||||
fpi_usb_transfer_set_short_error
|
||||
fpi_usb_transfer_fill_bulk
|
||||
fpi_usb_transfer_fill_bulk_full
|
||||
fpi_usb_transfer_fill_control
|
||||
fpi_usb_transfer_fill_interrupt
|
||||
fpi_usb_transfer_fill_interrupt_full
|
||||
fpi_usb_transfer_submit
|
||||
fpi_usb_transfer_submit_sync
|
||||
<SUBSECTION Standard>
|
||||
FPI_TYPE_USB_TRANSFER
|
||||
fpi_usb_transfer_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>fpi-spi-transfer</FILE>
|
||||
FpiSpiTransferCallback
|
||||
FpiSpiTransfer
|
||||
fpi_spi_transfer_new
|
||||
fpi_spi_transfer_ref
|
||||
fpi_spi_transfer_unref
|
||||
fpi_spi_transfer_write
|
||||
fpi_spi_transfer_write_full
|
||||
fpi_spi_transfer_read
|
||||
fpi_spi_transfer_read_full
|
||||
fpi_spi_transfer_submit
|
||||
fpi_spi_transfer_submit_sync
|
||||
<SUBSECTION Standard>
|
||||
FPI_TYPE_SPI_TRANSFER
|
||||
fpi_spi_transfer_get_type
|
||||
</SECTION>
|
||||
@@ -1,8 +0,0 @@
|
||||
#include <fprint.h>
|
||||
#include <fp-image-device.h>
|
||||
|
||||
fp_context_get_type
|
||||
fp_device_get_type
|
||||
fp_image_device_get_type
|
||||
fp_image_get_type
|
||||
fp_print_get_type
|
||||
@@ -25,44 +25,41 @@
|
||||
|
||||
<part>
|
||||
<title>Library API Documentation</title>
|
||||
<xi:include href="xml/fp-context.xml"/>
|
||||
<xi:include href="xml/fp-device.xml"/>
|
||||
<xi:include href="xml/fp-image-device.xml"/>
|
||||
<xi:include href="xml/fp-print.xml"/>
|
||||
<xi:include href="xml/fp-image.xml"/>
|
||||
<xi:include href="xml/events.xml"/>
|
||||
<xi:include href="xml/discovery.xml"/>
|
||||
|
||||
<xi:include href="xml/drv.xml"/>
|
||||
<xi:include href="xml/dev.xml"/>
|
||||
<xi:include href="xml/print_data.xml"/>
|
||||
<!-- FIXME https://bugs.freedesktop.org/show_bug.cgi?id=106550 -->
|
||||
<xi:include href="xml/dscv_print.xml"/>
|
||||
<xi:include href="xml/img.xml"/>
|
||||
</part>
|
||||
|
||||
<part>
|
||||
<title>Writing Drivers</title>
|
||||
<chapter id="driver-dev">
|
||||
<title>Device methods for drivers</title>
|
||||
<xi:include href="xml/fpi-device.xml"/>
|
||||
<xi:include href="xml/fpi-image-device.xml"/>
|
||||
<chapter id="driver-helpers">
|
||||
<title>Logging, and async machinery</title>
|
||||
<xi:include href="xml/fpi-log.xml"/>
|
||||
<xi:include href="xml/fpi-ssm.xml"/>
|
||||
<xi:include href="xml/fpi-poll.xml"/>
|
||||
</chapter>
|
||||
|
||||
<chapter id="driver-helpers">
|
||||
<title>USB, SPI and State Machine helpers</title>
|
||||
<xi:include href="xml/fpi-spi-transfer.xml"/>
|
||||
<xi:include href="xml/fpi-usb-transfer.xml"/>
|
||||
<xi:include href="xml/fpi-ssm.xml"/>
|
||||
<xi:include href="xml/fpi-log.xml"/>
|
||||
<chapter id="driver-dev">
|
||||
<title>Device and driver structures</title>
|
||||
<xi:include href="xml/fpi-dev.xml"/>
|
||||
<xi:include href="xml/fpi-dev-img.xml"/>
|
||||
<xi:include href="xml/fpi-core.xml"/>
|
||||
<xi:include href="xml/fpi-core-img.xml"/>
|
||||
</chapter>
|
||||
|
||||
<chapter id="driver-img">
|
||||
<title>Image manipulation</title>
|
||||
<xi:include href="xml/fpi-image.xml"/>
|
||||
<xi:include href="xml/fpi-img.xml"/>
|
||||
<xi:include href="xml/fpi-assembling.xml"/>
|
||||
</chapter>
|
||||
|
||||
<chapter id="driver-print">
|
||||
<title>Print handling</title>
|
||||
<xi:include href="xml/fpi-print.xml"/>
|
||||
</chapter>
|
||||
|
||||
<chapter id="driver-misc">
|
||||
<title>Listing drivers</title>
|
||||
<xi:include href="xml/fpi-context.xml"/>
|
||||
</chapter>
|
||||
<xi:include href="xml/fpi-usb.xml"/>
|
||||
</part>
|
||||
|
||||
<index id="api-index">
|
||||
|
||||
@@ -0,0 +1,271 @@
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fprint.h</INCLUDE>
|
||||
<FILE>events</FILE>
|
||||
<TITLE>Initialisation and events handling</TITLE>
|
||||
LIBFPRINT_DEPRECATED
|
||||
fp_set_debug
|
||||
fp_init
|
||||
fp_exit
|
||||
fp_pollfd
|
||||
fp_handle_events_timeout
|
||||
fp_handle_events
|
||||
fp_get_next_timeout
|
||||
fp_get_pollfds
|
||||
fp_pollfd_added_cb
|
||||
fp_pollfd_removed_cb
|
||||
fp_set_pollfd_notifiers
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fprint.h</INCLUDE>
|
||||
<FILE>discovery</FILE>
|
||||
<TITLE>Device discovery</TITLE>
|
||||
fp_dscv_dev
|
||||
fp_discover_devs
|
||||
fp_dscv_devs_free
|
||||
fp_dscv_dev_get_driver
|
||||
fp_dscv_dev_get_devtype
|
||||
fp_dscv_dev_get_driver_id
|
||||
fp_dscv_dev_supports_print_data
|
||||
fp_dscv_dev_supports_dscv_print
|
||||
fp_dscv_dev_for_print_data
|
||||
fp_dscv_dev_for_dscv_print
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fprint.h</INCLUDE>
|
||||
<FILE>drv</FILE>
|
||||
fp_driver
|
||||
fp_driver_get_name
|
||||
fp_driver_get_full_name
|
||||
fp_driver_get_driver_id
|
||||
fp_driver_get_scan_type
|
||||
fp_driver_supports_imaging
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fprint.h</INCLUDE>
|
||||
<FILE>dev</FILE>
|
||||
fp_dev
|
||||
fp_scan_type
|
||||
fp_capture_result
|
||||
fp_enroll_result
|
||||
fp_verify_result
|
||||
|
||||
fp_dev_get_driver
|
||||
fp_dev_get_nr_enroll_stages
|
||||
fp_dev_get_devtype
|
||||
fp_dev_supports_print_data
|
||||
fp_dev_supports_imaging
|
||||
fp_dev_supports_identification
|
||||
fp_dev_supports_dscv_print
|
||||
fp_dev_get_img_width
|
||||
fp_dev_get_img_height
|
||||
|
||||
fp_operation_stop_cb
|
||||
fp_img_operation_cb
|
||||
fp_dev_open_cb
|
||||
fp_enroll_stage_cb
|
||||
fp_identify_cb
|
||||
|
||||
fp_dev_open
|
||||
fp_async_dev_open
|
||||
|
||||
fp_dev_close
|
||||
fp_async_dev_close
|
||||
|
||||
fp_enroll_finger
|
||||
fp_enroll_finger_img
|
||||
fp_async_enroll_start
|
||||
fp_async_enroll_stop
|
||||
|
||||
fp_verify_finger
|
||||
fp_verify_finger_img
|
||||
fp_async_verify_start
|
||||
fp_async_verify_stop
|
||||
|
||||
fp_identify_finger
|
||||
fp_identify_finger_img
|
||||
fp_async_identify_start
|
||||
fp_async_identify_stop
|
||||
|
||||
fp_dev_img_capture
|
||||
fp_async_capture_start
|
||||
fp_async_capture_stop
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fprint.h</INCLUDE>
|
||||
<FILE>print_data</FILE>
|
||||
fp_finger
|
||||
fp_print_data
|
||||
fp_print_data_get_data
|
||||
fp_print_data_from_data
|
||||
fp_print_data_save
|
||||
fp_print_data_load
|
||||
fp_print_data_delete
|
||||
fp_print_data_from_dscv_print
|
||||
fp_print_data_free
|
||||
fp_print_data_get_driver_id
|
||||
fp_print_data_get_devtype
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fprint.h</INCLUDE>
|
||||
<FILE>dscv_print</FILE>
|
||||
fp_dscv_print
|
||||
fp_discover_prints
|
||||
fp_dscv_prints_free
|
||||
fp_dscv_print_get_driver_id
|
||||
fp_dscv_print_get_devtype
|
||||
fp_dscv_print_get_finger
|
||||
fp_dscv_print_delete
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fprint.h</INCLUDE>
|
||||
<FILE>img</FILE>
|
||||
fp_img
|
||||
fp_minutia
|
||||
fp_img_free
|
||||
fp_img_get_height
|
||||
fp_img_get_width
|
||||
fp_img_get_data
|
||||
fp_img_save_to_file
|
||||
fp_img_standardize
|
||||
fp_img_binarize
|
||||
fp_img_get_minutiae
|
||||
fp_minutia_get_coords
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fpi-log.h</INCLUDE>
|
||||
<FILE>fpi-log</FILE>
|
||||
fp_dbg
|
||||
fp_info
|
||||
fp_warn
|
||||
fp_err
|
||||
BUG_ON
|
||||
BUG
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fpi-ssm.h</INCLUDE>
|
||||
<FILE>fpi-ssm</FILE>
|
||||
fpi_ssm
|
||||
ssm_completed_fn
|
||||
ssm_handler_fn
|
||||
|
||||
fpi_ssm_new
|
||||
fpi_ssm_free
|
||||
fpi_ssm_start
|
||||
fpi_ssm_start_subsm
|
||||
|
||||
fpi_ssm_next_state
|
||||
fpi_ssm_next_state_timeout_cb
|
||||
fpi_ssm_jump_to_state
|
||||
fpi_ssm_mark_completed
|
||||
fpi_ssm_mark_failed
|
||||
fpi_ssm_get_user_data
|
||||
fpi_ssm_get_error
|
||||
fpi_ssm_get_cur_state
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fpi-poll.h</INCLUDE>
|
||||
<FILE>fpi-poll</FILE>
|
||||
fpi_timeout
|
||||
fpi_timeout_fn
|
||||
fpi_timeout_add
|
||||
fpi_timeout_set_name
|
||||
fpi_timeout_cancel
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fpi-dev.h</INCLUDE>
|
||||
<FILE>fpi-dev</FILE>
|
||||
fp_img_dev
|
||||
|
||||
FP_DEV
|
||||
FP_IMG_DEV
|
||||
fp_dev_set_instance_data
|
||||
FP_INSTANCE_DATA
|
||||
|
||||
fpi_dev_get_usb_dev
|
||||
fpi_dev_get_verify_data
|
||||
fpi_dev_set_nr_enroll_stages
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fpi-dev-img.h</INCLUDE>
|
||||
<FILE>fpi-dev-img</FILE>
|
||||
fp_imgdev_action
|
||||
fp_imgdev_state
|
||||
fp_imgdev_enroll_state
|
||||
|
||||
fpi_imgdev_abort_scan
|
||||
fpi_imgdev_activate_complete
|
||||
fpi_imgdev_close_complete
|
||||
fpi_imgdev_deactivate_complete
|
||||
fpi_imgdev_get_action
|
||||
fpi_imgdev_get_action_result
|
||||
fpi_imgdev_get_action_state
|
||||
fpi_imgdev_image_captured
|
||||
fpi_imgdev_open_complete
|
||||
fpi_imgdev_report_finger_status
|
||||
fpi_imgdev_session_error
|
||||
fpi_imgdev_set_action_result
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fpi-core.h</INCLUDE>
|
||||
<FILE>fpi-core</FILE>
|
||||
usb_id
|
||||
fp_driver_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fpi-core.h</INCLUDE>
|
||||
<FILE>fpi-core-img</FILE>
|
||||
FpiImgDriverFlags
|
||||
fp_img_driver
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fpi-img.h</INCLUDE>
|
||||
<FILE>fpi-img</FILE>
|
||||
FpiImgFlags
|
||||
|
||||
fpi_img_new
|
||||
fpi_img_new_for_imgdev
|
||||
fpi_img_realloc
|
||||
fpi_img_resize
|
||||
|
||||
fpi_std_sq_dev
|
||||
fpi_mean_sq_diff_norm
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fpi-assembling.h</INCLUDE>
|
||||
<FILE>fpi-assembling</FILE>
|
||||
fpi_frame
|
||||
fpi_frame_asmbl_ctx
|
||||
fpi_line_asmbl_ctx
|
||||
|
||||
fpi_do_movement_estimation
|
||||
fpi_assemble_frames
|
||||
fpi_assemble_lines
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fpi-usb.h</INCLUDE>
|
||||
<FILE>fpi-usb</FILE>
|
||||
fpi_usb_transfer
|
||||
|
||||
fpi_usb_transfer_cb_fn
|
||||
fpi_usb_alloc
|
||||
fpi_usb_fill_bulk_transfer
|
||||
fpi_usb_submit_transfer
|
||||
fpi_usb_cancel_transfer
|
||||
</SECTION>
|
||||
@@ -1,116 +0,0 @@
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fprint.h</INCLUDE>
|
||||
<FILE>context</FILE>
|
||||
<TITLE>Device discovery and hotplugging</TITLE>
|
||||
FP_TYPE_CONTEXT
|
||||
FpContext
|
||||
fp_context_new
|
||||
fp_context_enumerate
|
||||
fp_context_get_devices
|
||||
</SECTION>
|
||||
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fprint.h</INCLUDE>
|
||||
<FILE>device</FILE>
|
||||
<TITLE>Device</TITLE>
|
||||
FP_TYPE_DEVICE
|
||||
FpDevice
|
||||
FpDeviceType
|
||||
FpScanType
|
||||
FpDeviceRetry
|
||||
FpDeviceError
|
||||
FP_DEVICE_ERROR
|
||||
FP_DEVICE_RETRY
|
||||
fp_device_get_driver
|
||||
fp_device_get_device_id
|
||||
fp_device_get_name
|
||||
fp_device_get_scan_type
|
||||
|
||||
fp_device_open
|
||||
fp_device_open_finish
|
||||
fp_device_open_sync
|
||||
|
||||
fp_device_close
|
||||
fp_device_close_finish
|
||||
fp_device_close_sync
|
||||
|
||||
fp_device_enroll
|
||||
fp_device_enroll_finish
|
||||
fp_device_enroll_sync
|
||||
|
||||
fp_device_identify
|
||||
fp_device_identify_finish
|
||||
fp_device_identify_sync
|
||||
|
||||
fp_device_capture
|
||||
fp_device_capture_finish
|
||||
fp_device_capture_sync
|
||||
|
||||
fp_device_verify
|
||||
fp_device_verify_finish
|
||||
fp_device_verify_sync
|
||||
|
||||
_fp_device_get_cancellable
|
||||
</SECTION>
|
||||
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fprint.h</INCLUDE>
|
||||
<FILE>print</FILE>
|
||||
<TITLE>Fingerprint handling</TITLE>
|
||||
FpPrint
|
||||
fp_print_new
|
||||
</SECTION>
|
||||
|
||||
|
||||
<SECTION>
|
||||
<INCLUDE>fprint.h</INCLUDE>
|
||||
<FILE>image</FILE>
|
||||
<TITLE>Image handling</TITLE>
|
||||
FP_TYPE_IMAGE
|
||||
FpImage
|
||||
fp_image_new
|
||||
fp_image_detect_minutiae
|
||||
fp_image_detect_minutiae_finish
|
||||
fp_image_device_new
|
||||
fp_image_get_binarized
|
||||
fp_image_get_data
|
||||
fp_image_get_height
|
||||
fp_image_get_minutiae
|
||||
fp_image_get_ppmm
|
||||
fp_image_get_width
|
||||
</SECTION>
|
||||
|
||||
|
||||
<SECTION>
|
||||
<FILE>internal-image-device</FILE>
|
||||
<INCLUDE>drivers_api.h</INCLUDE>
|
||||
<TITLE>Base class for image devices</TITLE>
|
||||
FpImageDevice
|
||||
FpImageDeviceClass
|
||||
FpiImageDeviceState
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>internal-usb-transfers</FILE>
|
||||
<INCLUDE>drivers_api.h</INCLUDE>
|
||||
<TITLE>USB Transfers</TITLE>
|
||||
FpUsbTransfer
|
||||
fp_usb_transfer_fill_bulk
|
||||
fp_usb_transfer_fill_bulk_full
|
||||
fp_usb_transfer_fill_control
|
||||
fp_usb_transfer_fill_interrupt
|
||||
fp_usb_transfer_fill_interrupt_full
|
||||
fp_usb_transfer_get_type
|
||||
fp_usb_transfer_new
|
||||
fp_usb_transfer_ref
|
||||
fp_usb_transfer_set_short_error
|
||||
fp_usb_transfer_submit
|
||||
fp_usb_transfer_submit_sync
|
||||
fp_usb_transfer_unref
|
||||
FpUsbTransferCallback
|
||||
FP_USB_ENDPOINT_IN
|
||||
FP_USB_ENDPOINT_OUT
|
||||
</SECTION>
|
||||
@@ -2,12 +2,42 @@ subdir('xml')
|
||||
|
||||
private_headers = [
|
||||
'config.h',
|
||||
'nbis-helpers.h',
|
||||
'fprint.h',
|
||||
|
||||
# Subdirectories to ignore
|
||||
'drivers',
|
||||
'nbis',
|
||||
'aeslib.h',
|
||||
'assembling.h',
|
||||
'fp_internal.h',
|
||||
'nbis-helpers.h',
|
||||
'fpi-async.h',
|
||||
'fpi-data.h',
|
||||
|
||||
# Drivers
|
||||
'aes1660.h',
|
||||
'aes2501.h',
|
||||
'aes2550.h',
|
||||
'aes2660.h',
|
||||
'aes3k.h',
|
||||
'aesx660.h',
|
||||
'driver_ids.h',
|
||||
'elan.h',
|
||||
'upek_proto.h',
|
||||
'upeksonly.h',
|
||||
'upektc.h',
|
||||
'upektc_img.h',
|
||||
'vfs0050.h',
|
||||
'vfs301_proto_fragments.h',
|
||||
'vfs301_proto.h',
|
||||
'vfs5011_proto.h',
|
||||
'synaptics.h',
|
||||
|
||||
# NBIS
|
||||
'morph.h',
|
||||
'sunrast.h',
|
||||
'bozorth.h',
|
||||
'defs.h',
|
||||
'log.h',
|
||||
'bz_array.h',
|
||||
'lfs.h',
|
||||
'mytime.h',
|
||||
]
|
||||
|
||||
html_images = [
|
||||
@@ -19,19 +49,20 @@ content_files = [
|
||||
|
||||
expand_content_files = content_files
|
||||
|
||||
glib_prefix = dependency('glib-2.0').get_variable(pkgconfig: 'prefix')
|
||||
glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix')
|
||||
glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
|
||||
docpath = join_paths(get_option('datadir'), 'gtk-doc', 'html')
|
||||
|
||||
gnome.gtkdoc(versioned_libname,
|
||||
gnome.gtkdoc('libfprint',
|
||||
main_xml: 'libfprint-docs.xml',
|
||||
src_dir: join_paths(meson.project_source_root(), 'libfprint'),
|
||||
include_directories: include_directories('../libfprint'),
|
||||
src_dir: join_paths(meson.source_root(), 'libfprint'),
|
||||
dependencies: libfprint_dep,
|
||||
content_files: content_files,
|
||||
expand_content_files: expand_content_files,
|
||||
ignore_headers: private_headers,
|
||||
gobject_typesfile: 'libfprint-2.types',
|
||||
scan_args: [
|
||||
'--ignore-decorators=API_EXPORTED',
|
||||
'--ignore-headers=' + ' '.join(private_headers),
|
||||
],
|
||||
fixxref_args: [
|
||||
'--html-dir=@0@'.format(docpath),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
ent_conf = configuration_data()
|
||||
ent_conf.set('PACKAGE', versioned_libname)
|
||||
ent_conf.set('PACKAGE', 'libfprint')
|
||||
ent_conf.set('PACKAGE_BUGREPORT', 'https://gitlab.freedesktop.org/libfprint/libfprint/issues')
|
||||
ent_conf.set('PACKAGE_NAME', versioned_libname)
|
||||
ent_conf.set('PACKAGE_STRING', versioned_libname)
|
||||
ent_conf.set('PACKAGE_NAME', 'libfprint')
|
||||
ent_conf.set('PACKAGE_STRING', 'libfprint')
|
||||
ent_conf.set('PACKAGE_TARNAME', 'libfprint-' + meson.project_version())
|
||||
ent_conf.set('PACKAGE_URL', 'https://fprint.freedesktop.org/')
|
||||
ent_conf.set('PACKAGE_VERSION', meson.project_version())
|
||||
ent_conf.set('PACKAGE_API_VERSION', '1.0')
|
||||
configure_file(input: 'gtkdocentities.ent.in',
|
||||
output: 'gtkdocentities.ent',
|
||||
configuration: ent_conf)
|
||||
configure_file(input: 'gtkdocentities.ent.in', output: 'gtkdocentities.ent', configuration: ent_conf)
|
||||
|
||||
@@ -6,10 +6,6 @@
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
FpContext *ctx;
|
||||
|
||||
ctx = fp_context_new ();
|
||||
g_object_unref (ctx);
|
||||
|
||||
fp_init ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Example fingerprint delete finger program, which delete the right index
|
||||
* finger which has been previously enrolled to disk.
|
||||
* Copyright (C) 2019 Synaptics Inc
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <libfprint/fprint.h>
|
||||
|
||||
struct fp_dscv_dev *discover_device(struct fp_dscv_dev **discovered_devs)
|
||||
{
|
||||
struct fp_dscv_dev *ddev = discovered_devs[0];
|
||||
struct fp_driver *drv;
|
||||
if (!ddev)
|
||||
return NULL;
|
||||
|
||||
drv = fp_dscv_dev_get_driver(ddev);
|
||||
printf("Found device claimed by %s driver\n", fp_driver_get_full_name(drv));
|
||||
return ddev;
|
||||
}
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int r = 1;
|
||||
struct fp_dscv_dev *ddev;
|
||||
struct fp_dscv_dev **discovered_devs;
|
||||
struct fp_dev *dev;
|
||||
struct fp_print_data *data;
|
||||
|
||||
setenv ("G_MESSAGES_DEBUG", "all", 0);
|
||||
setenv ("LIBUSB_DEBUG", "3", 0);
|
||||
|
||||
r = fp_init();
|
||||
if (r < 0) {
|
||||
fprintf(stderr, "Failed to initialize libfprint\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
discovered_devs = fp_discover_devs();
|
||||
if (!discovered_devs) {
|
||||
fprintf(stderr, "Could not discover devices\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
ddev = discover_device(discovered_devs);
|
||||
if (!ddev) {
|
||||
fprintf(stderr, "No devices detected.\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
dev = fp_dev_open(ddev);
|
||||
fp_dscv_devs_free(discovered_devs);
|
||||
if (!dev) {
|
||||
fprintf(stderr, "Could not open device.\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
printf("Opened device. Loading previously enrolled right index finger "
|
||||
"data...\n");
|
||||
|
||||
r = fp_print_data_load(dev, RIGHT_INDEX, &data);
|
||||
if (r != 0) {
|
||||
fprintf(stderr, "Failed to load fingerprint, error %d\n", r);
|
||||
fprintf(stderr, "Did you remember to enroll your right index finger "
|
||||
"first?\n");
|
||||
goto out_close;
|
||||
}
|
||||
|
||||
printf("Print loaded. delete data in sensor.\n");
|
||||
if(!fp_dev_supports_data_in_sensor(dev))
|
||||
{
|
||||
printf("This driver doesn't support to store data in sensor.\n");
|
||||
goto out_close;
|
||||
}
|
||||
|
||||
r = fp_delete_finger(dev, data);
|
||||
fp_print_data_free(data);
|
||||
if (r) {
|
||||
printf("delete finger failed with error %d :(\n", r);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("sensor data deleted. now delete host data");
|
||||
r = fp_print_data_delete(dev, RIGHT_INDEX);
|
||||
if (r < 0) {
|
||||
printf("Delete sensor data successfully but delete host data failed. %d :(\n", r);
|
||||
}
|
||||
}
|
||||
|
||||
out_close:
|
||||
fp_dev_close(dev);
|
||||
out:
|
||||
fp_exit();
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/*
|
||||
* Example fingerprint enrollment program
|
||||
* Enrolls your chosen finger and saves the print to disk
|
||||
* Enrolls your right index finger and saves the print to disk
|
||||
* Copyright (C) 2007 Daniel Drake <dsd@gentoo.org>
|
||||
* Copyright (C) 2019 Marco Trevisan <marco.trevisan@canonical.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -19,254 +18,143 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define FP_COMPONENT "example-enroll"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <libfprint/fprint.h>
|
||||
#include <glib-unix.h>
|
||||
|
||||
#include "storage.h"
|
||||
#include "utilities.h"
|
||||
|
||||
typedef struct _EnrollData
|
||||
struct fp_dscv_dev *discover_device(struct fp_dscv_dev **discovered_devs)
|
||||
{
|
||||
GMainLoop *loop;
|
||||
GCancellable *cancellable;
|
||||
unsigned int sigint_handler;
|
||||
FpFinger finger;
|
||||
int ret_value;
|
||||
gboolean update_fingerprint;
|
||||
} EnrollData;
|
||||
struct fp_dscv_dev *ddev = discovered_devs[0];
|
||||
struct fp_driver *drv;
|
||||
if (!ddev)
|
||||
return NULL;
|
||||
|
||||
static void
|
||||
enroll_data_free (EnrollData *enroll_data)
|
||||
{
|
||||
g_clear_handle_id (&enroll_data->sigint_handler, g_source_remove);
|
||||
g_clear_object (&enroll_data->cancellable);
|
||||
g_main_loop_unref (enroll_data->loop);
|
||||
g_free (enroll_data);
|
||||
}
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (EnrollData, enroll_data_free)
|
||||
|
||||
static void
|
||||
on_device_closed (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
{
|
||||
EnrollData *enroll_data = user_data;
|
||||
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
fp_device_close_finish (dev, res, &error);
|
||||
|
||||
if (error)
|
||||
g_warning ("Failed closing device %s", error->message);
|
||||
|
||||
g_main_loop_quit (enroll_data->loop);
|
||||
drv = fp_dscv_dev_get_driver(ddev);
|
||||
printf("Found device claimed by %s driver\n", fp_driver_get_full_name(drv));
|
||||
return ddev;
|
||||
}
|
||||
|
||||
static void
|
||||
on_enroll_completed (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
{
|
||||
EnrollData *enroll_data = user_data;
|
||||
struct fp_print_data *enroll(struct fp_dev *dev) {
|
||||
struct fp_print_data *enrolled_print = NULL;
|
||||
int r;
|
||||
|
||||
g_autoptr(FpPrint) print = NULL;
|
||||
g_autoptr(GError) error = NULL;
|
||||
printf("You will need to successfully scan your finger %d times to "
|
||||
"complete the process.\n", fp_dev_get_nr_enroll_stages(dev));
|
||||
|
||||
print = fp_device_enroll_finish (dev, res, &error);
|
||||
do {
|
||||
struct fp_img *img = NULL;
|
||||
|
||||
if (!error)
|
||||
{
|
||||
enroll_data->ret_value = EXIT_SUCCESS;
|
||||
printf("\nScan your finger now.\n");
|
||||
|
||||
if (fp_device_has_feature (dev, FP_DEVICE_FEATURE_STORAGE))
|
||||
g_debug ("Device has storage, saving a print reference locally");
|
||||
else
|
||||
g_debug ("Device has not storage, saving print only locally");
|
||||
|
||||
/* Even if the device has storage, it may not be able to save all the
|
||||
* metadata that the print contains, so we can always save a local copy
|
||||
* containing the handle to the device print */
|
||||
int r = print_data_save (print, enroll_data->finger,
|
||||
enroll_data->update_fingerprint);
|
||||
if (r < 0)
|
||||
{
|
||||
g_warning ("Data save failed, code %d", r);
|
||||
enroll_data->ret_value = EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Enroll failed with error %s", error->message);
|
||||
}
|
||||
|
||||
fp_device_close (dev, NULL, (GAsyncReadyCallback) on_device_closed,
|
||||
enroll_data);
|
||||
}
|
||||
|
||||
static void
|
||||
on_enroll_progress (FpDevice *device,
|
||||
gint completed_stages,
|
||||
FpPrint *print,
|
||||
gpointer user_data,
|
||||
GError *error)
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
g_warning ("Enroll stage %d of %d failed with error %s",
|
||||
completed_stages,
|
||||
fp_device_get_nr_enroll_stages (device),
|
||||
error->message);
|
||||
return;
|
||||
}
|
||||
|
||||
if (print && fp_print_get_image (print) &&
|
||||
print_image_save (print, "enrolled.pgm"))
|
||||
r = fp_enroll_finger_img(dev, &enrolled_print, &img);
|
||||
if (img) {
|
||||
fp_img_save_to_file(img, "enrolled.pgm");
|
||||
printf("Wrote scanned image to enrolled.pgm\n");
|
||||
|
||||
printf ("Enroll stage %d of %d passed. Yay!\n", completed_stages,
|
||||
fp_device_get_nr_enroll_stages (device));
|
||||
fp_img_free(img);
|
||||
}
|
||||
if (r < 0) {
|
||||
printf("Enroll failed with error %d\n", r);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
should_update_fingerprint (void)
|
||||
{
|
||||
int update_choice;
|
||||
gboolean update_fingerprint = FALSE;
|
||||
|
||||
printf ("Should an existing fingerprint be updated instead of being replaced (if present)? "
|
||||
"Enter Y/y or N/n to make a choice.\n");
|
||||
update_choice = getchar ();
|
||||
if (update_choice == EOF)
|
||||
{
|
||||
g_warning ("EOF encountered while reading a character");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
switch (update_choice)
|
||||
{
|
||||
case 'y':
|
||||
case 'Y':
|
||||
update_fingerprint = TRUE;
|
||||
switch (r) {
|
||||
case FP_ENROLL_COMPLETE:
|
||||
printf("Enroll complete!\n");
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
case 'N':
|
||||
update_fingerprint = FALSE;
|
||||
case FP_ENROLL_FAIL:
|
||||
printf("Enroll failed, something wen't wrong :(\n");
|
||||
return NULL;
|
||||
case FP_ENROLL_PASS:
|
||||
printf("Enroll stage passed. Yay!\n");
|
||||
break;
|
||||
case FP_ENROLL_RETRY:
|
||||
printf("Didn't quite catch that. Please try again.\n");
|
||||
break;
|
||||
case FP_ENROLL_RETRY_TOO_SHORT:
|
||||
printf("Your swipe was too short, please try again.\n");
|
||||
break;
|
||||
case FP_ENROLL_RETRY_CENTER_FINGER:
|
||||
printf("Didn't catch that, please center your finger on the "
|
||||
"sensor and try again.\n");
|
||||
break;
|
||||
case FP_ENROLL_RETRY_REMOVE_FINGER:
|
||||
printf("Scan failed, please remove your finger and then try "
|
||||
"again.\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
g_warning ("Invalid choice %c, should be Y/y or N/n.", update_choice);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
return update_fingerprint;
|
||||
} while (r != FP_ENROLL_COMPLETE);
|
||||
|
||||
if (!enrolled_print) {
|
||||
fprintf(stderr, "Enroll complete but no print?\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
on_device_opened (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
printf("Enrollment completed!\n\n");
|
||||
return enrolled_print;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
EnrollData *enroll_data = user_data;
|
||||
FpPrint *print_template;
|
||||
int r = 1;
|
||||
struct fp_dscv_dev *ddev;
|
||||
struct fp_dscv_dev **discovered_devs;
|
||||
struct fp_dev *dev;
|
||||
struct fp_print_data *data;
|
||||
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
if (!fp_device_open_finish (dev, res, &error))
|
||||
{
|
||||
g_warning ("Failed to open device: %s", error->message);
|
||||
g_main_loop_quit (enroll_data->loop);
|
||||
return;
|
||||
}
|
||||
|
||||
printf ("Opened device.\n");
|
||||
|
||||
if (fp_device_has_feature (dev, FP_DEVICE_FEATURE_UPDATE_PRINT))
|
||||
{
|
||||
printf ("The device supports fingerprint updates.\n");
|
||||
enroll_data->update_fingerprint = should_update_fingerprint ();
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("The device doesn't support fingerprint updates. Old prints will be erased.\n");
|
||||
enroll_data->update_fingerprint = FALSE;
|
||||
}
|
||||
|
||||
printf ("It's now time to enroll your finger.\n\n");
|
||||
printf ("You will need to successfully scan your %s finger %d times to "
|
||||
"complete the process.\n\n", finger_to_string (enroll_data->finger),
|
||||
fp_device_get_nr_enroll_stages (dev));
|
||||
printf ("Scan your finger now.\n");
|
||||
|
||||
print_template = print_create_template (dev, enroll_data->finger, enroll_data->update_fingerprint);
|
||||
fp_device_enroll (dev, print_template, enroll_data->cancellable,
|
||||
on_enroll_progress, NULL, NULL,
|
||||
(GAsyncReadyCallback) on_enroll_completed,
|
||||
enroll_data);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
sigint_cb (void *user_data)
|
||||
{
|
||||
EnrollData *enroll_data = user_data;
|
||||
|
||||
g_cancellable_cancel (enroll_data->cancellable);
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
g_autoptr(FpContext) ctx = NULL;
|
||||
g_autoptr(EnrollData) enroll_data = NULL;
|
||||
GPtrArray *devices;
|
||||
FpDevice *dev;
|
||||
FpFinger finger;
|
||||
|
||||
g_print ("This program will enroll the selected finger overwriting any print for the same"
|
||||
" finger that was enrolled previously. Fingerprint updates without erasing old data"
|
||||
" are possible on devices supporting that. Ctrl+C interrupts program execution.\n");
|
||||
|
||||
g_print ("Choose the finger to enroll:\n");
|
||||
finger = finger_chooser ();
|
||||
|
||||
if (finger == FP_FINGER_UNKNOWN)
|
||||
{
|
||||
g_warning ("Unknown finger selected");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
printf("This program will enroll your right index finger, "
|
||||
"unconditionally overwriting any right-index print that was enrolled "
|
||||
"previously. If you want to continue, press enter, otherwise hit "
|
||||
"Ctrl+C\n");
|
||||
getchar();
|
||||
|
||||
setenv ("G_MESSAGES_DEBUG", "all", 0);
|
||||
setenv ("LIBUSB_DEBUG", "3", 0);
|
||||
|
||||
ctx = fp_context_new ();
|
||||
|
||||
devices = fp_context_get_devices (ctx);
|
||||
if (!devices)
|
||||
{
|
||||
g_warning ("Impossible to get devices");
|
||||
return EXIT_FAILURE;
|
||||
r = fp_init();
|
||||
if (r < 0) {
|
||||
fprintf(stderr, "Failed to initialize libfprint\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
dev = discover_device (devices);
|
||||
if (!dev)
|
||||
{
|
||||
g_warning ("No devices detected.");
|
||||
return EXIT_FAILURE;
|
||||
discovered_devs = fp_discover_devs();
|
||||
if (!discovered_devs) {
|
||||
fprintf(stderr, "Could not discover devices\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
enroll_data = g_new0 (EnrollData, 1);
|
||||
enroll_data->finger = finger;
|
||||
enroll_data->ret_value = EXIT_FAILURE;
|
||||
enroll_data->loop = g_main_loop_new (NULL, FALSE);
|
||||
enroll_data->cancellable = g_cancellable_new ();
|
||||
enroll_data->sigint_handler = g_unix_signal_add_full (G_PRIORITY_HIGH,
|
||||
SIGINT,
|
||||
sigint_cb,
|
||||
enroll_data,
|
||||
NULL);
|
||||
|
||||
fp_device_open (dev, enroll_data->cancellable,
|
||||
(GAsyncReadyCallback) on_device_opened,
|
||||
enroll_data);
|
||||
|
||||
g_main_loop_run (enroll_data->loop);
|
||||
|
||||
return enroll_data->ret_value;
|
||||
ddev = discover_device(discovered_devs);
|
||||
if (!ddev) {
|
||||
fprintf(stderr, "No devices detected.\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
dev = fp_dev_open(ddev);
|
||||
fp_dscv_devs_free(discovered_devs);
|
||||
if (!dev) {
|
||||
fprintf(stderr, "Could not open device.\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
printf("Opened device. It's now time to enroll your finger.\n\n");
|
||||
data = enroll(dev);
|
||||
if (!data)
|
||||
goto out_close;
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
r = fp_print_data_save(data, RIGHT_INDEX);
|
||||
#pragma GCC diagnostic pop
|
||||
if (r < 0)
|
||||
fprintf(stderr, "Data save failed, code %d\n", r);
|
||||
|
||||
fp_print_data_free(data);
|
||||
out_close:
|
||||
fp_dev_close(dev);
|
||||
out:
|
||||
fp_exit();
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,321 +0,0 @@
|
||||
/*
|
||||
* Example fingerprint verification program, which verifies the
|
||||
* finger which has been previously enrolled to disk.
|
||||
* Copyright (C) 2020 Marco Trevisan <marco.trevisan@canonical.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define FP_COMPONENT "example-identify"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <libfprint/fprint.h>
|
||||
#include <glib-unix.h>
|
||||
|
||||
#include "storage.h"
|
||||
#include "utilities.h"
|
||||
|
||||
typedef struct _IdentifyData
|
||||
{
|
||||
GMainLoop *loop;
|
||||
GCancellable *cancellable;
|
||||
unsigned int sigint_handler;
|
||||
int ret_value;
|
||||
} IdentifyData;
|
||||
|
||||
static void
|
||||
identify_data_free (IdentifyData *identify_data)
|
||||
{
|
||||
g_clear_handle_id (&identify_data->sigint_handler, g_source_remove);
|
||||
g_clear_object (&identify_data->cancellable);
|
||||
g_main_loop_unref (identify_data->loop);
|
||||
g_free (identify_data);
|
||||
}
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (IdentifyData, identify_data_free)
|
||||
|
||||
static void
|
||||
on_device_closed (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
{
|
||||
IdentifyData *identify_data = user_data;
|
||||
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
fp_device_close_finish (dev, res, &error);
|
||||
|
||||
if (error)
|
||||
g_warning ("Failed closing device %s", error->message);
|
||||
|
||||
g_main_loop_quit (identify_data->loop);
|
||||
}
|
||||
|
||||
static void
|
||||
identify_quit (FpDevice *dev,
|
||||
IdentifyData *identify_data)
|
||||
{
|
||||
if (!fp_device_is_open (dev))
|
||||
{
|
||||
g_main_loop_quit (identify_data->loop);
|
||||
return;
|
||||
}
|
||||
|
||||
fp_device_close (dev, NULL, (GAsyncReadyCallback) on_device_closed, identify_data);
|
||||
}
|
||||
|
||||
static void start_identification (FpDevice *dev,
|
||||
IdentifyData *identify_data);
|
||||
|
||||
static void
|
||||
on_identify_completed (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
{
|
||||
IdentifyData *identify_data = user_data;
|
||||
|
||||
g_autoptr(FpPrint) print = NULL;
|
||||
g_autoptr(FpPrint) match = NULL;
|
||||
g_autoptr(GError) error = NULL;
|
||||
char buffer[20];
|
||||
|
||||
if (!fp_device_identify_finish (dev, res, &match, &print, &error))
|
||||
{
|
||||
g_warning ("Failed to identify print: %s", error->message);
|
||||
identify_data->ret_value = EXIT_FAILURE;
|
||||
|
||||
if (error->domain != FP_DEVICE_RETRY)
|
||||
{
|
||||
identify_quit (dev, identify_data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
g_print ("Identify again? [Y/n]? ");
|
||||
if (fgets (buffer, sizeof (buffer), stdin) &&
|
||||
(buffer[0] == 'Y' || buffer[0] == 'y' || buffer[0] == '\n'))
|
||||
{
|
||||
start_identification (dev, identify_data);
|
||||
return;
|
||||
}
|
||||
|
||||
identify_quit (dev, identify_data);
|
||||
}
|
||||
|
||||
static FpPrint *
|
||||
get_stored_print (FpDevice *dev, FpPrint *print)
|
||||
{
|
||||
g_autoptr(GPtrArray) gallery = gallery_data_load (dev);
|
||||
guint index;
|
||||
|
||||
if (g_ptr_array_find_with_equal_func (gallery, print,
|
||||
(GEqualFunc) fp_print_equal,
|
||||
&index))
|
||||
return g_object_ref (g_ptr_array_index (gallery, index));
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
on_identify_cb (FpDevice *dev, FpPrint *match, FpPrint *print,
|
||||
gpointer user_data, GError *error)
|
||||
{
|
||||
IdentifyData *identify_data = user_data;
|
||||
|
||||
if (error)
|
||||
{
|
||||
g_warning ("Identify report: No finger matched, retry error reported: %s",
|
||||
error->message);
|
||||
return;
|
||||
}
|
||||
|
||||
if (print && fp_print_get_image (print) &&
|
||||
print_image_save (print, "identify.pgm"))
|
||||
g_print ("Print image saved as identify.pgm\n");
|
||||
|
||||
if (match)
|
||||
{
|
||||
g_autoptr(FpPrint) matched_print = g_object_ref (match);
|
||||
const GDate *date;
|
||||
char date_str[128] = {};
|
||||
|
||||
identify_data->ret_value = EXIT_SUCCESS;
|
||||
|
||||
if (fp_print_get_device_stored (match))
|
||||
{
|
||||
FpPrint *stored_print = get_stored_print (dev, match);
|
||||
|
||||
if (stored_print)
|
||||
matched_print = g_steal_pointer (&stored_print);
|
||||
}
|
||||
|
||||
date = fp_print_get_enroll_date (matched_print);
|
||||
if (date && g_date_valid (date))
|
||||
g_date_strftime (date_str, G_N_ELEMENTS (date_str), "%Y-%m-%d\0",
|
||||
fp_print_get_enroll_date (matched_print));
|
||||
else
|
||||
strcpy (date_str, "<unknown>");
|
||||
|
||||
g_debug ("Identify report: device %s matched finger %s successfully "
|
||||
"with print '%s', enrolled on date %s by user %s",
|
||||
fp_device_get_name (dev),
|
||||
finger_to_string (fp_print_get_finger (matched_print)),
|
||||
fp_print_get_description (matched_print), date_str,
|
||||
fp_print_get_username (matched_print));
|
||||
|
||||
g_print ("IDENTIFIED!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
g_debug ("Identification report: No finger matched");
|
||||
g_print ("NOT IDENTIFIED!\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_list_completed (FpDevice *dev, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
IdentifyData *identify_data = user_data;
|
||||
|
||||
g_autoptr(GPtrArray) gallery = NULL;
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
gallery = fp_device_list_prints_finish (dev, res, &error);
|
||||
|
||||
if (!error)
|
||||
{
|
||||
if (!gallery->len)
|
||||
{
|
||||
g_warning ("No prints saved on device");
|
||||
identify_quit (dev, identify_data);
|
||||
return;
|
||||
}
|
||||
|
||||
g_debug ("Identifying with %u prints in gallery", gallery->len);
|
||||
fp_device_identify (dev, gallery, identify_data->cancellable,
|
||||
on_identify_cb, identify_data, NULL,
|
||||
(GAsyncReadyCallback) on_identify_completed,
|
||||
identify_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Loading prints failed with error %s", error->message);
|
||||
identify_quit (dev, identify_data);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
start_identification (FpDevice *dev, IdentifyData *identify_data)
|
||||
{
|
||||
if (fp_device_has_feature (dev, FP_DEVICE_FEATURE_STORAGE))
|
||||
{
|
||||
g_print ("Creating finger template, using device storage...\n");
|
||||
fp_device_list_prints (dev, NULL,
|
||||
(GAsyncReadyCallback) on_list_completed,
|
||||
identify_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_autoptr(GPtrArray) gallery = gallery_data_load (dev);
|
||||
|
||||
if (!gallery)
|
||||
{
|
||||
identify_quit (dev, identify_data);
|
||||
return;
|
||||
}
|
||||
|
||||
g_print ("Gallery loaded. Time to identify!\n");
|
||||
fp_device_identify (dev, gallery, identify_data->cancellable,
|
||||
on_identify_cb, identify_data, NULL,
|
||||
(GAsyncReadyCallback) on_identify_completed,
|
||||
identify_data);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_device_opened (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
{
|
||||
IdentifyData *identify_data = user_data;
|
||||
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
if (!fp_device_open_finish (dev, res, &error))
|
||||
{
|
||||
g_warning ("Failed to open device: %s", error->message);
|
||||
identify_quit (dev, identify_data);
|
||||
return;
|
||||
}
|
||||
|
||||
g_print ("Opened device. ");
|
||||
|
||||
start_identification (dev, identify_data);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
sigint_cb (void *user_data)
|
||||
{
|
||||
IdentifyData *identify_data = user_data;
|
||||
|
||||
g_cancellable_cancel (identify_data->cancellable);
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
g_autoptr(FpContext) ctx = NULL;
|
||||
g_autoptr(IdentifyData) identify_data = NULL;
|
||||
GPtrArray *devices;
|
||||
FpDevice *dev;
|
||||
|
||||
setenv ("G_MESSAGES_DEBUG", "all", 0);
|
||||
setenv ("LIBUSB_DEBUG", "3", 0);
|
||||
|
||||
ctx = fp_context_new ();
|
||||
|
||||
devices = fp_context_get_devices (ctx);
|
||||
if (!devices)
|
||||
{
|
||||
g_warning ("Impossible to get devices");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
dev = discover_device (devices);
|
||||
if (!dev)
|
||||
{
|
||||
g_warning ("No devices detected.");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (!fp_device_has_feature (dev, FP_DEVICE_FEATURE_IDENTIFY))
|
||||
{
|
||||
g_warning ("Device %s does not support identification.",
|
||||
fp_device_get_name (dev));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
identify_data = g_new0 (IdentifyData, 1);
|
||||
identify_data->ret_value = EXIT_FAILURE;
|
||||
identify_data->loop = g_main_loop_new (NULL, FALSE);
|
||||
identify_data->cancellable = g_cancellable_new ();
|
||||
identify_data->sigint_handler = g_unix_signal_add_full (G_PRIORITY_HIGH,
|
||||
SIGINT,
|
||||
sigint_cb,
|
||||
identify_data,
|
||||
NULL);
|
||||
fp_device_open (dev, identify_data->cancellable,
|
||||
(GAsyncReadyCallback) on_device_opened,
|
||||
identify_data);
|
||||
|
||||
g_main_loop_run (identify_data->loop);
|
||||
|
||||
return identify_data->ret_value;
|
||||
}
|
||||
@@ -1,192 +0,0 @@
|
||||
/*
|
||||
* Example fingerprint verification program, which verifies the
|
||||
* finger which has been previously enrolled to disk.
|
||||
* Copyright (C) 2007 Daniel Drake <dsd@gentoo.org>
|
||||
* Copyright (C) 2019 Marco Trevisan <marco.trevisan@canonical.com>
|
||||
* Copyright (C) 2020 Vasily Khoruzhick <anarsoul@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define FP_COMPONENT "example-capture"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <libfprint/fprint.h>
|
||||
#include <glib-unix.h>
|
||||
|
||||
#include "storage.h"
|
||||
#include "utilities.h"
|
||||
|
||||
typedef struct CaptureData
|
||||
{
|
||||
GMainLoop *loop;
|
||||
GCancellable *cancellable;
|
||||
unsigned int sigint_handler;
|
||||
int ret_value;
|
||||
const char *filename;
|
||||
} CaptureData;
|
||||
|
||||
static void
|
||||
capture_data_free (CaptureData *capture_data)
|
||||
{
|
||||
g_clear_handle_id (&capture_data->sigint_handler, g_source_remove);
|
||||
g_clear_object (&capture_data->cancellable);
|
||||
g_main_loop_unref (capture_data->loop);
|
||||
g_free (capture_data);
|
||||
}
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CaptureData, capture_data_free)
|
||||
|
||||
static void
|
||||
on_device_closed (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
{
|
||||
CaptureData *capture_data = user_data;
|
||||
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
fp_device_close_finish (dev, res, &error);
|
||||
|
||||
if (error)
|
||||
g_warning ("Failed closing device %s", error->message);
|
||||
|
||||
g_main_loop_quit (capture_data->loop);
|
||||
}
|
||||
|
||||
static void
|
||||
capture_quit (FpDevice *dev,
|
||||
CaptureData *capture_data)
|
||||
{
|
||||
if (!fp_device_is_open (dev))
|
||||
{
|
||||
g_main_loop_quit (capture_data->loop);
|
||||
return;
|
||||
}
|
||||
|
||||
fp_device_close (dev, NULL, (GAsyncReadyCallback) on_device_closed, capture_data);
|
||||
}
|
||||
|
||||
static void
|
||||
dev_capture_cb (FpDevice *dev,
|
||||
GAsyncResult *res,
|
||||
void *user_data)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
CaptureData *capture_data = user_data;
|
||||
FpImage *image = NULL;
|
||||
|
||||
g_clear_object (&capture_data->cancellable);
|
||||
|
||||
image = fp_device_capture_finish (dev, res, &error);
|
||||
if (!image)
|
||||
{
|
||||
g_warning ("Error capturing data: %s", error->message);
|
||||
capture_quit (dev, capture_data);
|
||||
return;
|
||||
}
|
||||
|
||||
save_image_to_pgm (image, capture_data->filename);
|
||||
|
||||
capture_quit (dev, capture_data);
|
||||
}
|
||||
|
||||
static void
|
||||
start_capture (FpDevice *dev, CaptureData *capture_data)
|
||||
{
|
||||
fp_device_capture (dev, TRUE, capture_data->cancellable, (GAsyncReadyCallback) dev_capture_cb, capture_data);
|
||||
}
|
||||
|
||||
static void
|
||||
on_device_opened (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
{
|
||||
CaptureData *capture_data = user_data;
|
||||
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
if (!fp_device_open_finish (dev, res, &error))
|
||||
{
|
||||
g_warning ("Failed to open device: %s", error->message);
|
||||
capture_quit (dev, capture_data);
|
||||
return;
|
||||
}
|
||||
|
||||
g_print ("Opened device. ");
|
||||
|
||||
start_capture (dev, capture_data);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
sigint_cb (void *user_data)
|
||||
{
|
||||
CaptureData *capture_data = user_data;
|
||||
|
||||
g_cancellable_cancel (capture_data->cancellable);
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, const char *argv[])
|
||||
{
|
||||
g_autoptr(FpContext) ctx = NULL;
|
||||
g_autoptr(CaptureData) capture_data = NULL;
|
||||
GPtrArray *devices;
|
||||
FpDevice *dev;
|
||||
|
||||
setenv ("G_MESSAGES_DEBUG", "all", 0);
|
||||
setenv ("LIBUSB_DEBUG", "3", 0);
|
||||
|
||||
ctx = fp_context_new ();
|
||||
|
||||
devices = fp_context_get_devices (ctx);
|
||||
if (!devices)
|
||||
{
|
||||
g_warning ("Impossible to get devices");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
dev = discover_device (devices);
|
||||
if (!dev)
|
||||
{
|
||||
g_warning ("No devices detected.");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (!fp_device_has_feature (dev, FP_DEVICE_FEATURE_CAPTURE))
|
||||
{
|
||||
g_warning ("Device %s doesn't support capture",
|
||||
fp_device_get_name (dev));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
capture_data = g_new0 (CaptureData, 1);
|
||||
capture_data->ret_value = EXIT_FAILURE;
|
||||
capture_data->loop = g_main_loop_new (NULL, FALSE);
|
||||
capture_data->cancellable = g_cancellable_new ();
|
||||
capture_data->sigint_handler = g_unix_signal_add_full (G_PRIORITY_HIGH,
|
||||
SIGINT,
|
||||
sigint_cb,
|
||||
capture_data,
|
||||
NULL);
|
||||
if (argc == 2)
|
||||
capture_data->filename = argv[1];
|
||||
else
|
||||
capture_data->filename = "finger.pgm";
|
||||
fp_device_open (dev, capture_data->cancellable,
|
||||
(GAsyncReadyCallback) on_device_opened,
|
||||
capture_data);
|
||||
|
||||
g_main_loop_run (capture_data->loop);
|
||||
|
||||
return capture_data->ret_value;
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* Example libfprint image capture program
|
||||
* Copyright (C) 2007 Daniel Drake <dsd@gentoo.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <libfprint/fprint.h>
|
||||
|
||||
struct fp_dscv_dev *discover_device(struct fp_dscv_dev **discovered_devs)
|
||||
{
|
||||
struct fp_dscv_dev *ddev = discovered_devs[0];
|
||||
struct fp_driver *drv;
|
||||
if (!ddev)
|
||||
return NULL;
|
||||
|
||||
drv = fp_dscv_dev_get_driver(ddev);
|
||||
printf("Found device claimed by %s driver\n", fp_driver_get_full_name(drv));
|
||||
return ddev;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int r = 1;
|
||||
struct fp_dscv_dev *ddev;
|
||||
struct fp_dscv_dev **discovered_devs;
|
||||
struct fp_dev *dev;
|
||||
struct fp_img *img = NULL;
|
||||
|
||||
setenv ("G_MESSAGES_DEBUG", "all", 0);
|
||||
setenv ("LIBUSB_DEBUG", "3", 0);
|
||||
|
||||
r = fp_init();
|
||||
if (r < 0) {
|
||||
fprintf(stderr, "Failed to initialize libfprint\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
discovered_devs = fp_discover_devs();
|
||||
if (!discovered_devs) {
|
||||
fprintf(stderr, "Could not discover devices\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
ddev = discover_device(discovered_devs);
|
||||
if (!ddev) {
|
||||
fp_dscv_devs_free(discovered_devs);
|
||||
fprintf(stderr, "No devices detected.\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
dev = fp_dev_open(ddev);
|
||||
fp_dscv_devs_free(discovered_devs);
|
||||
if (!dev) {
|
||||
fprintf(stderr, "Could not open device.\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!fp_dev_supports_imaging(dev)) {
|
||||
fprintf(stderr, "this device does not have imaging capabilities.\n");
|
||||
goto out_close;
|
||||
}
|
||||
|
||||
printf("Opened device. It's now time to scan your finger.\n\n");
|
||||
|
||||
r = fp_dev_img_capture(dev, 0, &img);
|
||||
if (r) {
|
||||
fprintf(stderr, "image capture failed, code %d\n", r);
|
||||
goto out_close;
|
||||
}
|
||||
|
||||
r = fp_img_save_to_file(img, "finger.pgm");
|
||||
if (r) {
|
||||
fprintf(stderr, "img save failed, code %d\n", r);
|
||||
goto out_close;
|
||||
}
|
||||
|
||||
fp_img_standardize(img);
|
||||
r = fp_img_save_to_file(img, "finger_standardized.pgm");
|
||||
fp_img_free(img);
|
||||
if (r) {
|
||||
fprintf(stderr, "standardized img save failed, code %d\n", r);
|
||||
goto out_close;
|
||||
}
|
||||
|
||||
r = 0;
|
||||
out_close:
|
||||
fp_dev_close(dev);
|
||||
out:
|
||||
fp_exit();
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
/*
|
||||
* Example libfprint continuous image capture program
|
||||
* Copyright (C) 2007 Daniel Drake <dsd@gentoo.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <libfprint/fprint.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/keysym.h>
|
||||
#include <X11/extensions/Xvlib.h>
|
||||
|
||||
#define FORMAT 0x32595559
|
||||
|
||||
static int adaptor = -1;
|
||||
static char *framebuffer = NULL;
|
||||
|
||||
static Display *display = NULL;
|
||||
static Window window=(Window)NULL;
|
||||
static XvImage *xv_image = NULL;
|
||||
static XvAdaptorInfo *info;
|
||||
static GC gc;
|
||||
static int connection = -1;
|
||||
|
||||
/* based on macro by Bart Nabbe */
|
||||
#define GREY2YUV(grey, y, u, v)\
|
||||
y = (9798*grey + 19235*grey + 3736*grey) / 32768;\
|
||||
u = (-4784*grey - 9437*grey + 14221*grey) / 32768 + 128;\
|
||||
v = (20218*grey - 16941*grey - 3277*grey) / 32768 + 128;\
|
||||
y = y < 0 ? 0 : y;\
|
||||
u = u < 0 ? 0 : u;\
|
||||
v = v < 0 ? 0 : v;\
|
||||
y = y > 255 ? 255 : y;\
|
||||
u = u > 255 ? 255 : u;\
|
||||
v = v > 255 ? 255 : v
|
||||
|
||||
static void grey2yuy2 (unsigned char *grey, char *YUV, int num) {
|
||||
int i, j;
|
||||
int y0, y1, u0, u1, v0, v1;
|
||||
uint64_t gval;
|
||||
|
||||
for (i = 0, j = 0; i < num; i += 2, j += 4)
|
||||
{
|
||||
gval = grey[i];
|
||||
GREY2YUV (gval, y0, u0 , v0);
|
||||
gval = grey[i + 1];
|
||||
GREY2YUV (gval, y1, u1 , v1);
|
||||
YUV[j + 0] = y0;
|
||||
YUV[j + 1] = (u0+u1)/2;
|
||||
YUV[j + 2] = y1;
|
||||
YUV[j + 3] = (v0+v1)/2;
|
||||
}
|
||||
}
|
||||
|
||||
static void display_frame(struct fp_img *img)
|
||||
{
|
||||
int width = fp_img_get_width(img);
|
||||
int height = fp_img_get_height(img);
|
||||
unsigned char *data = fp_img_get_data(img);
|
||||
|
||||
if (adaptor < 0)
|
||||
return;
|
||||
|
||||
grey2yuy2(data, framebuffer, width * height);
|
||||
xv_image = XvCreateImage(display, info[adaptor].base_id, FORMAT,
|
||||
framebuffer, width, height);
|
||||
XvPutImage(display, info[adaptor].base_id, window, gc, xv_image,
|
||||
0, 0, width, height, 0, 0, width, height);
|
||||
}
|
||||
|
||||
static void QueryXv(void)
|
||||
{
|
||||
unsigned int num_adaptors;
|
||||
int num_formats;
|
||||
XvImageFormatValues *formats = NULL;
|
||||
int i,j;
|
||||
char xv_name[5];
|
||||
|
||||
XvQueryAdaptors(display, DefaultRootWindow(display), &num_adaptors,
|
||||
&info);
|
||||
|
||||
for(i = 0; i < num_adaptors; i++) {
|
||||
formats = XvListImageFormats(display, info[i].base_id,
|
||||
&num_formats);
|
||||
for(j = 0; j < num_formats; j++) {
|
||||
xv_name[4] = 0;
|
||||
memcpy(xv_name, &formats[j].id, 4);
|
||||
if(formats[j].id == FORMAT) {
|
||||
printf("using Xv format 0x%x %s %s\n",
|
||||
formats[j].id, xv_name,
|
||||
(formats[j].format==XvPacked)
|
||||
? "packed" : "planar");
|
||||
if (adaptor < 0)
|
||||
adaptor = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
XFree(formats);
|
||||
if (adaptor < 0)
|
||||
printf("No suitable Xv adaptor found\n");
|
||||
}
|
||||
|
||||
struct fp_dscv_dev *discover_device(struct fp_dscv_dev **discovered_devs)
|
||||
{
|
||||
struct fp_dscv_dev *ddev = discovered_devs[0];
|
||||
struct fp_driver *drv;
|
||||
if (!ddev)
|
||||
return NULL;
|
||||
|
||||
drv = fp_dscv_dev_get_driver(ddev);
|
||||
printf("Found device claimed by %s driver\n", fp_driver_get_full_name(drv));
|
||||
return ddev;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int r = 1;
|
||||
XEvent xev;
|
||||
XGCValues xgcv;
|
||||
long background=0x010203;
|
||||
struct fp_dscv_dev *ddev;
|
||||
struct fp_dscv_dev **discovered_devs;
|
||||
struct fp_dev *dev;
|
||||
int img_width;
|
||||
int img_height;
|
||||
int standardize = 0;
|
||||
|
||||
setenv ("G_MESSAGES_DEBUG", "all", 0);
|
||||
setenv ("LIBUSB_DEBUG", "3", 0);
|
||||
|
||||
r = fp_init();
|
||||
if (r < 0) {
|
||||
fprintf(stderr, "Failed to initialize libfprint\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
discovered_devs = fp_discover_devs();
|
||||
if (!discovered_devs) {
|
||||
fprintf(stderr, "Could not discover devices\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
ddev = discover_device(discovered_devs);
|
||||
if (!ddev) {
|
||||
fprintf(stderr, "No devices detected.\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
dev = fp_dev_open(ddev);
|
||||
fp_dscv_devs_free(discovered_devs);
|
||||
if (!dev) {
|
||||
fprintf(stderr, "Could not open device.\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!fp_dev_supports_imaging(dev)) {
|
||||
fprintf(stderr, "this device does not have imaging capabilities.\n");
|
||||
goto out_close;
|
||||
}
|
||||
|
||||
img_width = fp_dev_get_img_width(dev);
|
||||
img_height = fp_dev_get_img_height(dev);
|
||||
if (img_width <= 0 || img_height <= 0) {
|
||||
fprintf(stderr, "this device returns images with variable dimensions,"
|
||||
" this example does not support that.\n");
|
||||
goto out_close;
|
||||
}
|
||||
framebuffer = malloc(img_width * img_height * 2);
|
||||
if (!framebuffer)
|
||||
goto out_close;
|
||||
|
||||
/* make the window */
|
||||
display = XOpenDisplay(getenv("DISPLAY"));
|
||||
if(display == NULL) {
|
||||
fprintf(stderr,"Could not open display \"%s\"\n",
|
||||
getenv("DISPLAY"));
|
||||
goto out_close;
|
||||
}
|
||||
|
||||
QueryXv();
|
||||
|
||||
if (adaptor < 0)
|
||||
goto out_close;
|
||||
|
||||
window = XCreateSimpleWindow(display, DefaultRootWindow(display), 0, 0,
|
||||
img_width, img_height, 0,
|
||||
WhitePixel(display, DefaultScreen(display)), background);
|
||||
|
||||
XSelectInput(display, window, StructureNotifyMask | KeyPressMask);
|
||||
XMapWindow(display, window);
|
||||
connection = ConnectionNumber(display);
|
||||
|
||||
gc = XCreateGC(display, window, 0, &xgcv);
|
||||
|
||||
printf("Press S to toggle standardized mode, Q to quit\n");
|
||||
|
||||
while (1) { /* event loop */
|
||||
struct fp_img *img;
|
||||
|
||||
r = fp_dev_img_capture(dev, 1, &img);
|
||||
if (r) {
|
||||
fprintf(stderr, "image capture failed, code %d\n", r);
|
||||
goto out_close;
|
||||
}
|
||||
if (standardize)
|
||||
fp_img_standardize(img);
|
||||
|
||||
display_frame(img);
|
||||
fp_img_free(img);
|
||||
XFlush(display);
|
||||
|
||||
while (XPending(display) > 0) {
|
||||
XNextEvent(display, &xev);
|
||||
if (xev.type != KeyPress)
|
||||
continue;
|
||||
|
||||
switch (XKeycodeToKeysym(display, xev.xkey.keycode, 0)) {
|
||||
case XK_q:
|
||||
case XK_Q:
|
||||
r = 0;
|
||||
goto out_close;
|
||||
break;
|
||||
case XK_s:
|
||||
case XK_S:
|
||||
standardize = !standardize;
|
||||
break;
|
||||
}
|
||||
} /* XPending */
|
||||
}
|
||||
|
||||
r = 0;
|
||||
out_close:
|
||||
if (framebuffer)
|
||||
free(framebuffer);
|
||||
fp_dev_close(dev);
|
||||
if ((void *) window != NULL)
|
||||
XUnmapWindow(display, window);
|
||||
if (display != NULL)
|
||||
XFlush(display);
|
||||
out:
|
||||
fp_exit();
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,283 +0,0 @@
|
||||
/*
|
||||
* Example fingerprint device prints listing and deletion
|
||||
* Enrolls your right index finger and saves the print to disk
|
||||
* Copyright (C) 2019 Marco Trevisan <marco.trevisan@canonical.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define FP_COMPONENT "example-mange-prints"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <libfprint/fprint.h>
|
||||
#include "utilities.h"
|
||||
|
||||
typedef struct _ListData
|
||||
{
|
||||
GMainLoop *loop;
|
||||
int ret_value;
|
||||
GList *to_delete;
|
||||
gboolean any_failed;
|
||||
} ListData;
|
||||
|
||||
static void
|
||||
list_data_free (ListData *list_data)
|
||||
{
|
||||
g_list_free_full (list_data->to_delete, g_object_unref);
|
||||
g_main_loop_unref (list_data->loop);
|
||||
g_free (list_data);
|
||||
}
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ListData, list_data_free)
|
||||
|
||||
static void
|
||||
on_device_closed (FpDevice *dev,
|
||||
GAsyncResult *res,
|
||||
gpointer user_data)
|
||||
{
|
||||
ListData *list_data = user_data;
|
||||
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
fp_device_close_finish (dev, res, &error);
|
||||
|
||||
if (error)
|
||||
g_warning ("Failed closing device %s", error->message);
|
||||
|
||||
g_main_loop_quit (list_data->loop);
|
||||
}
|
||||
|
||||
typedef struct _DeleteData
|
||||
{
|
||||
ListData *list_data;
|
||||
FpPrint *print;
|
||||
} DeleteData;
|
||||
|
||||
static void
|
||||
delete_data_free (DeleteData *delete_data)
|
||||
{
|
||||
g_object_unref (delete_data->print);
|
||||
g_free (delete_data);
|
||||
}
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DeleteData, delete_data_free);
|
||||
|
||||
static void on_print_deleted (FpDevice *dev,
|
||||
GAsyncResult *res,
|
||||
gpointer user_data);
|
||||
|
||||
static void
|
||||
delete_next_print (FpDevice *dev,
|
||||
ListData *list_data)
|
||||
{
|
||||
FpPrint *print;
|
||||
|
||||
g_assert_nonnull (list_data->to_delete);
|
||||
print = list_data->to_delete->data;
|
||||
|
||||
g_debug ("Deleting print %s", fp_print_get_description (print));
|
||||
fp_device_delete_print (dev, print, NULL,
|
||||
(GAsyncReadyCallback) on_print_deleted, list_data);
|
||||
}
|
||||
|
||||
static void
|
||||
on_print_deleted (FpDevice *dev,
|
||||
GAsyncResult *res,
|
||||
gpointer user_data)
|
||||
{
|
||||
ListData *list_data = user_data;
|
||||
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(FpPrint) print = NULL;
|
||||
GList *deleted_link;
|
||||
|
||||
fp_device_delete_print_finish (dev, res, &error);
|
||||
|
||||
deleted_link = list_data->to_delete;
|
||||
print = g_steal_pointer (&deleted_link->data);
|
||||
list_data->to_delete = g_list_delete_link (list_data->to_delete, deleted_link);
|
||||
|
||||
if (error)
|
||||
{
|
||||
g_warning ("Failed to remove print %s: %s",
|
||||
fp_print_get_description (print), error->message);
|
||||
list_data->any_failed = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_debug ("Deleted print %s from device", fp_print_get_description (print));
|
||||
}
|
||||
|
||||
if (list_data->to_delete != NULL)
|
||||
{
|
||||
delete_next_print (dev, list_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!list_data->any_failed)
|
||||
list_data->ret_value = EXIT_SUCCESS;
|
||||
|
||||
fp_device_close (dev, NULL, (GAsyncReadyCallback) on_device_closed,
|
||||
list_data);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_list_completed (FpDevice *dev,
|
||||
GAsyncResult *res,
|
||||
gpointer user_data)
|
||||
{
|
||||
ListData *list_data = user_data;
|
||||
|
||||
g_autoptr(GPtrArray) prints = NULL;
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
prints = fp_device_list_prints_finish (dev, res, &error);
|
||||
|
||||
if (!error)
|
||||
{
|
||||
guint i;
|
||||
char buf[128];
|
||||
|
||||
g_print ("Device contains %u prints\n", prints->len);
|
||||
|
||||
for (i = 0; i < prints->len; ++i)
|
||||
{
|
||||
FpPrint * print = prints->pdata[i];
|
||||
const GDate *date = fp_print_get_enroll_date (print);
|
||||
|
||||
g_print ("[%d] Print of %s finger for username %s", i + 1,
|
||||
finger_to_string (fp_print_get_finger (print)),
|
||||
fp_print_get_username (print));
|
||||
|
||||
if (date && g_date_valid (date))
|
||||
{
|
||||
g_date_strftime (buf, G_N_ELEMENTS (buf), "%Y-%m-%d\0", date);
|
||||
g_print (", enrolled on %s", buf);
|
||||
}
|
||||
|
||||
g_print (". Description: %s\n", fp_print_get_description (print));
|
||||
}
|
||||
|
||||
if (prints->len)
|
||||
{
|
||||
gint64 idx = 0;
|
||||
|
||||
g_print ("Want to delete saved print? [<number>/A/n]\n> ");
|
||||
if (fgets (buf, 3, stdin))
|
||||
idx = g_ascii_strtoll (buf, NULL, 10);
|
||||
|
||||
if (idx > 0 && idx <= prints->len)
|
||||
{
|
||||
FpPrint *print = prints->pdata[idx - 1];
|
||||
list_data->to_delete = g_list_prepend (list_data->to_delete,
|
||||
g_object_ref (print));
|
||||
}
|
||||
else if (buf[0] == 'A')
|
||||
{
|
||||
for (i = 0; i < prints->len; ++i)
|
||||
{
|
||||
FpPrint *print = prints->pdata[i];
|
||||
list_data->to_delete = g_list_prepend (list_data->to_delete,
|
||||
g_object_ref (print));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (buf[0] == 'n' || buf[0] == 'N')
|
||||
list_data->ret_value = EXIT_SUCCESS;
|
||||
else
|
||||
g_warning ("Invalid finger selected");
|
||||
}
|
||||
}
|
||||
|
||||
if (list_data->to_delete)
|
||||
delete_next_print (dev, list_data);
|
||||
else
|
||||
fp_device_close (dev, NULL, (GAsyncReadyCallback) on_device_closed,
|
||||
list_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Getting prints failed with error %s", error->message);
|
||||
g_main_loop_quit (list_data->loop);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_device_opened (FpDevice *dev,
|
||||
GAsyncResult *res,
|
||||
gpointer user_data)
|
||||
{
|
||||
ListData *list_data = user_data;
|
||||
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
if (!fp_device_open_finish (dev, res, &error))
|
||||
{
|
||||
g_warning ("Failed to open device: %s", error->message);
|
||||
g_main_loop_quit (list_data->loop);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fp_device_has_feature (dev, FP_DEVICE_FEATURE_STORAGE))
|
||||
{
|
||||
g_warning ("Device %s doesn't support storage", fp_device_get_name (dev));
|
||||
g_main_loop_quit (list_data->loop);
|
||||
return;
|
||||
}
|
||||
|
||||
fp_device_list_prints (dev, NULL,
|
||||
(GAsyncReadyCallback) on_list_completed, list_data);
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
g_autoptr(FpContext) ctx = NULL;
|
||||
g_autoptr(ListData) list_data = NULL;
|
||||
GPtrArray *devices;
|
||||
FpDevice *dev;
|
||||
|
||||
g_print ("This program will report the prints saved in device\n");
|
||||
|
||||
setenv ("G_MESSAGES_DEBUG", "all", 0);
|
||||
|
||||
ctx = fp_context_new ();
|
||||
|
||||
devices = fp_context_get_devices (ctx);
|
||||
if (!devices)
|
||||
{
|
||||
g_warning ("Impossible to get devices");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
dev = discover_device (devices);
|
||||
if (!dev)
|
||||
{
|
||||
g_warning ("No devices detected.");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
list_data = g_new0 (ListData, 1);
|
||||
list_data->ret_value = EXIT_FAILURE;
|
||||
list_data->loop = g_main_loop_new (NULL, FALSE);
|
||||
|
||||
fp_device_open (dev, NULL, (GAsyncReadyCallback) on_device_opened, list_data);
|
||||
|
||||
g_main_loop_run (list_data->loop);
|
||||
|
||||
return list_data->ret_value;
|
||||
}
|
||||
@@ -1,38 +1,29 @@
|
||||
|
||||
examples = [
|
||||
'enroll',
|
||||
'identify',
|
||||
'img-capture',
|
||||
'manage-prints',
|
||||
'verify',
|
||||
]
|
||||
|
||||
examples = [ 'verify_live', 'enroll', 'verify', 'img_capture', 'delete' ]
|
||||
foreach example: examples
|
||||
executable(example,
|
||||
[ example + '.c', 'storage.c', 'utilities.c' ],
|
||||
dependencies: [
|
||||
libfprint_dep,
|
||||
glib_dep,
|
||||
example + '.c',
|
||||
dependencies: libfprint_dep,
|
||||
include_directories: [
|
||||
root_inc,
|
||||
],
|
||||
)
|
||||
c_args: common_cflags)
|
||||
endforeach
|
||||
|
||||
executable('cpp-test',
|
||||
'cpp-test.cpp',
|
||||
dependencies: libfprint_dep,
|
||||
)
|
||||
|
||||
if installed_tests
|
||||
install_subdir('prints',
|
||||
install_dir: installed_tests_testdir)
|
||||
endif
|
||||
|
||||
if get_option('tod')
|
||||
executable('tod-inspector',
|
||||
sources: 'tod-inspector.c',
|
||||
dependencies: [
|
||||
libfprint_dep,
|
||||
tod_dep,
|
||||
include_directories: [
|
||||
root_inc,
|
||||
],
|
||||
)
|
||||
c_args: common_cflags)
|
||||
|
||||
if get_option('x11-examples')
|
||||
executable('img_capture_continuous',
|
||||
'img_capture_continuous.c',
|
||||
dependencies: [ libfprint_dep, xv_dep, x11_dep ],
|
||||
include_directories: [
|
||||
root_inc,
|
||||
],
|
||||
c_args: common_cflags)
|
||||
endif
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
These are example images from NIST and are in the public domain.
|
||||
|
||||
The PNG files have been generated by using the greyscale data as a mask.
|
||||
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 102 KiB |
@@ -1,111 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# This script can be used together with the virtual_imgdev to simulate an
|
||||
# image based fingerprint reader.
|
||||
#
|
||||
# To use, set the FP_VIRTUAL_IMAGE environment variable for both the
|
||||
# libfprint using program (e.g. fprintd) and this script.
|
||||
#
|
||||
# Usually this would work by adding it into the systemd unit file. The
|
||||
# best way of doing so is to create
|
||||
# /etc/systemd/system/fprintd.service.d/fprintd-test.conf
|
||||
#
|
||||
# [Service]
|
||||
# RuntimeDirectory=fprint
|
||||
# Environment=FP_VIRTUAL_IMAGE=/run/fprint/virtimg_sock
|
||||
# Environment=G_MESSAGES_DEBUG=all
|
||||
# ReadWritePaths=$RUNTIME_DIR
|
||||
#
|
||||
# After that run:
|
||||
#
|
||||
# systemctl daemon-reload
|
||||
# systemctl restart fprintd.service
|
||||
#
|
||||
# You may also need to disable selinux.
|
||||
#
|
||||
# Then run this script with e.g.
|
||||
# FP_VIRTUAL_IMAGE=/run/fprint/virtimg_sock ./sendvirtimg.py prints/whorl.png
|
||||
|
||||
|
||||
|
||||
import cairo
|
||||
import sys
|
||||
import os
|
||||
import socket
|
||||
import struct
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
sys.stderr.write('You need to pass a PNG with an alpha channel!\n')
|
||||
sys.exit(1)
|
||||
|
||||
# Just copied from the C file, we could also use the introspection data for
|
||||
# this. Also, most of them do *not* make any sense.
|
||||
commands = {
|
||||
'retry' : struct.pack('ii', -1, 0),
|
||||
'retry-too-short' : struct.pack('ii', -1, 1),
|
||||
'retry-center-finger' : struct.pack('ii', -1, 2),
|
||||
'retry-remove-finger' : struct.pack('ii', -1, 3),
|
||||
|
||||
'error' : struct.pack('ii', -2, 0),
|
||||
'error-not-supported' : struct.pack('ii', -2, 1),
|
||||
'error-not-open' : struct.pack('ii', -2, 2),
|
||||
'error-already-open' : struct.pack('ii', -2, 3),
|
||||
'error-busy' : struct.pack('ii', -2, 4),
|
||||
'error-proto' : struct.pack('ii', -2, 5),
|
||||
'error-data-invalid' : struct.pack('ii', -2, 6),
|
||||
'error-data-not-found' : struct.pack('ii', -2, 7),
|
||||
'error-data-full' : struct.pack('ii', -2, 8),
|
||||
}
|
||||
|
||||
|
||||
if sys.argv[1] in commands:
|
||||
command = commands[sys.argv[1]]
|
||||
else:
|
||||
png = cairo.ImageSurface.create_from_png(sys.argv[1])
|
||||
|
||||
# Cairo wants 4 byte aligned rows, so just add a few pixel if necessary
|
||||
w = png.get_width()
|
||||
h = png.get_height()
|
||||
w = (w + 3) // 4 * 4
|
||||
h = (h + 3) // 4 * 4
|
||||
img = cairo.ImageSurface(cairo.Format.A8, w, h)
|
||||
cr = cairo.Context(img)
|
||||
|
||||
cr.set_source_rgba(1, 1, 1, 1)
|
||||
cr.paint()
|
||||
|
||||
cr.set_source_rgba(0, 0, 0, 0)
|
||||
cr.set_operator(cairo.OPERATOR_SOURCE)
|
||||
|
||||
cr.set_source_surface(png)
|
||||
cr.paint()
|
||||
|
||||
mem = img.get_data()
|
||||
mem = mem.tobytes()
|
||||
assert len(mem) == img.get_width() * img.get_height()
|
||||
|
||||
command = struct.pack('ii', img.get_width(), img.get_height())
|
||||
command += mem
|
||||
|
||||
|
||||
|
||||
def write_dbg_img():
|
||||
dbg_img_rgb = cairo.ImageSurface(cairo.Format.RGB24, img.get_width(), img.get_height())
|
||||
dbg_cr = cairo.Context(dbg_img_rgb)
|
||||
dbg_cr.set_source_rgb(0, 0, 0)
|
||||
dbg_cr.paint()
|
||||
dbg_cr.set_source_rgb(1, 1, 1)
|
||||
dbg_cr.mask_surface(img, 0, 0)
|
||||
|
||||
dbg_img_rgb.write_to_png('/tmp/test.png')
|
||||
|
||||
#write_dbg_img()
|
||||
|
||||
# Send image through socket
|
||||
sockaddr = os.environ['FP_VIRTUAL_IMAGE']
|
||||
|
||||
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
sock.connect(sockaddr)
|
||||
|
||||
sock.sendall(command)
|
||||
|
||||
@@ -1,296 +0,0 @@
|
||||
/*
|
||||
* Trivial storage driver for example programs
|
||||
*
|
||||
* Copyright (C) 2019 Benjamin Berg <bberg@redhat.com>
|
||||
* Copyright (C) 2019-2020 Marco Trevisan <marco.trevisan@canonical.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define FP_COMPONENT "example-storage"
|
||||
|
||||
#include <libfprint/fprint.h>
|
||||
#include <libfprint/fpi-compat.h>
|
||||
#include "storage.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define STORAGE_FILE "test-storage.variant"
|
||||
|
||||
static char *
|
||||
get_print_data_descriptor (FpPrint *print, FpDevice *dev, FpFinger finger)
|
||||
{
|
||||
const char *driver;
|
||||
const char *dev_id;
|
||||
|
||||
if (print)
|
||||
{
|
||||
driver = fp_print_get_driver (print);
|
||||
dev_id = fp_print_get_device_id (print);
|
||||
}
|
||||
else
|
||||
{
|
||||
driver = fp_device_get_driver (dev);
|
||||
dev_id = fp_device_get_device_id (dev);
|
||||
}
|
||||
|
||||
return g_strdup_printf ("%s/%s/%x",
|
||||
driver,
|
||||
dev_id,
|
||||
finger);
|
||||
}
|
||||
|
||||
static GVariantDict *
|
||||
load_data (void)
|
||||
{
|
||||
GVariantDict *res;
|
||||
GVariant *var;
|
||||
gchar *contents = NULL;
|
||||
gsize length = 0;
|
||||
|
||||
if (!g_file_get_contents (STORAGE_FILE, &contents, &length, NULL))
|
||||
{
|
||||
g_warning ("Error loading storage, assuming it is empty");
|
||||
return g_variant_dict_new (NULL);
|
||||
}
|
||||
|
||||
var = g_variant_new_from_data (G_VARIANT_TYPE_VARDICT,
|
||||
contents,
|
||||
length,
|
||||
FALSE,
|
||||
g_free,
|
||||
contents);
|
||||
|
||||
res = g_variant_dict_new (var);
|
||||
g_variant_unref (var);
|
||||
return res;
|
||||
}
|
||||
|
||||
static int
|
||||
save_data (GVariant *data)
|
||||
{
|
||||
const gchar *contents = NULL;
|
||||
gsize length;
|
||||
|
||||
length = g_variant_get_size (data);
|
||||
contents = (gchar *) g_variant_get_data (data);
|
||||
|
||||
if (!g_file_set_contents (STORAGE_FILE, contents, length, NULL))
|
||||
{
|
||||
g_warning ("Error saving storage,!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
g_variant_ref_sink (data);
|
||||
g_variant_unref (data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static FpPrint *
|
||||
load_print_from_data (GVariant *data)
|
||||
{
|
||||
const guchar *stored_data = NULL;
|
||||
gsize stored_len;
|
||||
FpPrint *print;
|
||||
|
||||
g_autoptr(GError) error = NULL;
|
||||
stored_data = (const guchar *) g_variant_get_fixed_array (data, &stored_len, 1);
|
||||
print = fp_print_deserialize (stored_data, stored_len, &error);
|
||||
if (error)
|
||||
g_warning ("Error deserializing data: %s", error->message);
|
||||
return print;
|
||||
}
|
||||
|
||||
int
|
||||
print_data_save (FpPrint *print, FpFinger finger, gboolean update_fingerprint)
|
||||
{
|
||||
g_autofree gchar *descr = get_print_data_descriptor (print, NULL, finger);
|
||||
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(GVariantDict) dict = NULL;
|
||||
g_autofree guchar *data = NULL;
|
||||
GVariant *val;
|
||||
gsize size;
|
||||
int res;
|
||||
|
||||
dict = load_data ();
|
||||
|
||||
fp_print_serialize (print, &data, &size, &error);
|
||||
if (error)
|
||||
{
|
||||
g_warning ("Error serializing data: %s", error->message);
|
||||
return -1;
|
||||
}
|
||||
val = g_variant_new_fixed_array (G_VARIANT_TYPE ("y"), data, size, 1);
|
||||
g_variant_dict_insert_value (dict, descr, val);
|
||||
|
||||
res = save_data (g_variant_dict_end (dict));
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
FpPrint *
|
||||
print_data_load (FpDevice *dev, FpFinger finger)
|
||||
{
|
||||
g_autofree gchar *descr = get_print_data_descriptor (NULL, dev, finger);
|
||||
|
||||
g_autoptr(GVariant) val = NULL;
|
||||
g_autoptr(GVariantDict) dict = NULL;
|
||||
|
||||
dict = load_data ();
|
||||
val = g_variant_dict_lookup_value (dict, descr, G_VARIANT_TYPE ("ay"));
|
||||
|
||||
if (val)
|
||||
return load_print_from_data (val);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GPtrArray *
|
||||
gallery_data_load (FpDevice *dev)
|
||||
{
|
||||
g_autoptr(GVariantDict) dict = NULL;
|
||||
g_autoptr(GVariant) dict_variant = NULL;
|
||||
g_autofree char *dev_prefix = NULL;
|
||||
GPtrArray *gallery;
|
||||
const char *driver;
|
||||
const char *dev_id;
|
||||
GVariantIter iter;
|
||||
GVariant *value;
|
||||
gchar *key;
|
||||
|
||||
gallery = g_ptr_array_new_with_free_func (g_object_unref);
|
||||
dict = load_data ();
|
||||
dict_variant = g_variant_dict_end (dict);
|
||||
driver = fp_device_get_driver (dev);
|
||||
dev_id = fp_device_get_device_id (dev);
|
||||
dev_prefix = g_strdup_printf ("%s/%s/", driver, dev_id);
|
||||
|
||||
g_variant_iter_init (&iter, dict_variant);
|
||||
while (g_variant_iter_loop (&iter, "{sv}", &key, &value))
|
||||
{
|
||||
FpPrint *print;
|
||||
const guchar *stored_data;
|
||||
g_autoptr(GError) error = NULL;
|
||||
gsize stored_len;
|
||||
|
||||
if (!g_str_has_prefix (key, dev_prefix))
|
||||
continue;
|
||||
|
||||
stored_data = (const guchar *) g_variant_get_fixed_array (value, &stored_len, 1);
|
||||
print = fp_print_deserialize (stored_data, stored_len, &error);
|
||||
|
||||
if (error)
|
||||
{
|
||||
g_warning ("Error deserializing data: %s", error->message);
|
||||
continue;
|
||||
}
|
||||
|
||||
g_ptr_array_add (gallery, print);
|
||||
}
|
||||
|
||||
return gallery;
|
||||
}
|
||||
|
||||
FpPrint *
|
||||
print_create_template (FpDevice *dev, FpFinger finger, gboolean load_existing)
|
||||
{
|
||||
g_autoptr(GVariantDict) dict = NULL;
|
||||
g_autoptr(GDateTime) datetime = NULL;
|
||||
g_autoptr(GDate) date = NULL;
|
||||
g_autoptr(GVariant) existing_val = NULL;
|
||||
g_autofree gchar *descr = get_print_data_descriptor (NULL, dev, finger);
|
||||
FpPrint *template = NULL;
|
||||
gint year, month, day;
|
||||
|
||||
if (load_existing)
|
||||
{
|
||||
dict = load_data ();
|
||||
existing_val = g_variant_dict_lookup_value (dict, descr, G_VARIANT_TYPE ("ay"));
|
||||
if (existing_val != NULL)
|
||||
template = load_print_from_data (existing_val);
|
||||
}
|
||||
if (template == NULL)
|
||||
{
|
||||
template = fp_print_new (dev);
|
||||
fp_print_set_finger (template, finger);
|
||||
fp_print_set_username (template, g_get_user_name ());
|
||||
}
|
||||
|
||||
datetime = g_date_time_new_now_local ();
|
||||
g_date_time_get_ymd (datetime, &year, &month, &day);
|
||||
date = g_date_new_dmy (day, month, year);
|
||||
fp_print_set_enroll_date (template, date);
|
||||
|
||||
return template;
|
||||
}
|
||||
|
||||
|
||||
gboolean
|
||||
save_image_to_pgm (FpImage *img, const char *path)
|
||||
{
|
||||
FILE *fd = fopen (path, "w");
|
||||
size_t write_size;
|
||||
const guchar *data = fp_image_get_data (img, &write_size);
|
||||
int r;
|
||||
|
||||
if (!fd)
|
||||
{
|
||||
g_warning ("could not open '%s' for writing: %d", path, errno);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
r = fprintf (fd, "P5 %d %d 255\n",
|
||||
fp_image_get_width (img), fp_image_get_height (img));
|
||||
if (r < 0)
|
||||
{
|
||||
fclose (fd);
|
||||
g_critical ("pgm header write failed, error %d", r);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
r = fwrite (data, 1, write_size, fd);
|
||||
if (r < write_size)
|
||||
{
|
||||
fclose (fd);
|
||||
g_critical ("short write (%d)", r);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
fclose (fd);
|
||||
g_debug ("written to '%s'", path);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
print_image_save (FpPrint *print, const char *path)
|
||||
{
|
||||
FpImage *img = NULL;
|
||||
|
||||
g_return_val_if_fail (FP_IS_PRINT (print), FALSE);
|
||||
g_return_val_if_fail (path != NULL, FALSE);
|
||||
|
||||
img = fp_print_get_image (print);
|
||||
|
||||
if (img)
|
||||
return save_image_to_pgm (img, path);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Trivial storage driver for example programs
|
||||
*
|
||||
* Copyright (C) 2019 Benjamin Berg <bberg@redhat.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
int print_data_save (FpPrint *print,
|
||||
FpFinger finger,
|
||||
gboolean update_fingerprint);
|
||||
FpPrint * print_data_load (FpDevice *dev,
|
||||
FpFinger finger);
|
||||
GPtrArray * gallery_data_load (FpDevice *dev);
|
||||
FpPrint * print_create_template (FpDevice *dev,
|
||||
FpFinger finger,
|
||||
const gboolean load_existing);
|
||||
gboolean print_image_save (FpPrint *print,
|
||||
const char *path);
|
||||
gboolean save_image_to_pgm (FpImage *img,
|
||||
const char *path);
|
||||
@@ -1,161 +0,0 @@
|
||||
/*
|
||||
* Shared library loader for libfprint
|
||||
* Copyright (C) 2021 Marco Trevisan <marco.trevisan@canonical.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <libfprint/fprint.h>
|
||||
|
||||
#include "libfprint/tod/tod-shared-loader.h"
|
||||
#include "libfprint/fpi-device.h"
|
||||
|
||||
static char *
|
||||
id_table_to_string (FpDeviceType device_type,
|
||||
const FpIdEntry *id_table)
|
||||
{
|
||||
const FpIdEntry *entry;
|
||||
char *str = NULL;
|
||||
|
||||
if (!id_table)
|
||||
return g_strdup ("INVALID: Empty ID table");
|
||||
|
||||
entry = id_table;
|
||||
while (TRUE)
|
||||
{
|
||||
g_autofree char *value = NULL;
|
||||
|
||||
if (device_type == FP_DEVICE_TYPE_VIRTUAL)
|
||||
{
|
||||
if (entry->virtual_envvar)
|
||||
value = g_strdup (entry->virtual_envvar);
|
||||
}
|
||||
else if (device_type == FP_DEVICE_TYPE_USB)
|
||||
{
|
||||
if (entry->vid)
|
||||
value = g_strdup_printf ("%04x:%04x", entry->vid, entry->pid);
|
||||
}
|
||||
else if (device_type == FP_DEVICE_TYPE_UDEV)
|
||||
{
|
||||
if (entry->hid_id.vid)
|
||||
{
|
||||
g_autofree gchar *udev_flags = NULL;
|
||||
|
||||
udev_flags = g_flags_to_string (fpi_device_udev_subtype_flags_get_type (),
|
||||
entry->udev_types);
|
||||
value = g_strdup_printf ("%s (%04x:%04x) [%s]",
|
||||
entry->spi_acpi_id,
|
||||
entry->hid_id.vid, entry->hid_id.pid,
|
||||
udev_flags);
|
||||
}
|
||||
else
|
||||
{
|
||||
value = g_strdup (entry->spi_acpi_id);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return g_strdup ("Unsupported device type");
|
||||
}
|
||||
|
||||
if (!value)
|
||||
return str;
|
||||
|
||||
if (!str)
|
||||
{
|
||||
str = g_steal_pointer (&value);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_autofree char *tmp = g_steal_pointer (&str);
|
||||
str = g_strconcat (tmp, ", ", value, NULL);
|
||||
}
|
||||
|
||||
entry++;
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
static const char *
|
||||
device_type_to_string (FpDeviceType device_type)
|
||||
{
|
||||
g_autoptr(GEnumClass) device_types = g_type_class_ref (fp_device_type_get_type ());
|
||||
GEnumValue *value = g_enum_get_value (device_types, device_type);
|
||||
|
||||
return value->value_nick;
|
||||
}
|
||||
|
||||
static const char *
|
||||
scan_type_to_string (FpScanType scan_type)
|
||||
{
|
||||
g_autoptr(GEnumClass) scan_types = g_type_class_ref (fp_scan_type_get_type ());
|
||||
GEnumValue *value = g_enum_get_value (scan_types, scan_type);
|
||||
|
||||
return value->value_nick;
|
||||
}
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
g_autoptr(GArray) shared_drivers = NULL;
|
||||
guint i;
|
||||
|
||||
tod_shared_drivers_register ();
|
||||
|
||||
shared_drivers = tod_shared_drivers_get ();
|
||||
g_print ("Found %u drivers\n", shared_drivers->len);
|
||||
|
||||
for (i = 0; i < shared_drivers->len; i++)
|
||||
{
|
||||
GType driver = g_array_index (shared_drivers, GType, i);
|
||||
g_autoptr(FpDeviceClass) cls = g_type_class_ref (driver);
|
||||
g_autofree char *id_table = NULL;
|
||||
g_autofree char *features = NULL;
|
||||
|
||||
id_table = id_table_to_string (cls->type, cls->id_table);
|
||||
features = g_flags_to_string (fp_device_feature_get_type (), cls->features);
|
||||
|
||||
g_print ("ID: %s\n", cls->id);
|
||||
g_print ("Full Name: %s\n", cls->full_name);
|
||||
g_print ("Type: %s\n", device_type_to_string (cls->type));
|
||||
g_print ("Enroll stages: %d\n", cls->nr_enroll_stages);
|
||||
g_print ("Scan type: %s\n", scan_type_to_string (cls->scan_type));
|
||||
g_print ("Seconds to get Hot: %d\n", cls->temp_hot_seconds);
|
||||
g_print ("Seconds to get Cold: %d\n", cls->temp_cold_seconds);
|
||||
g_print ("Supported Devices: %s\n", id_table);
|
||||
g_print ("Supported features: %s\n", features);
|
||||
g_print ("Implemented VFuncs:\n");
|
||||
g_print (" usb_discover: %s\n", cls->usb_discover ? "true" : "false");
|
||||
g_print (" probe: %s\n", cls->probe ? "true" : "false");
|
||||
g_print (" open: %s\n", cls->open ? "true" : "false");
|
||||
g_print (" close: %s\n", cls->close ? "true" : "false");
|
||||
g_print (" suspend: %s\n", cls->suspend ? "true" : "false");
|
||||
g_print (" resume: %s\n", cls->resume ? "true" : "false");
|
||||
g_print (" enroll: %s\n", cls->enroll ? "true" : "false");
|
||||
g_print (" verify: %s\n", cls->verify ? "true" : "false");
|
||||
g_print (" identify: %s\n", cls->identify ? "true" : "false");
|
||||
g_print (" capture: %s\n", cls->capture ? "true" : "false");
|
||||
g_print (" list: %s\n", cls->list ? "true" : "false");
|
||||
g_print (" delete: %s\n", cls->delete ? "true" : "false");
|
||||
g_print (" clear_storage: %s\n", cls->clear_storage ? "true" : "false");
|
||||
g_print (" cancel: %s\n", cls->cancel ? "true" : "false");
|
||||
|
||||
if (i < shared_drivers->len - 1)
|
||||
g_print ("------------\n");
|
||||
}
|
||||
|
||||
tod_shared_drivers_unregister ();
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
/*
|
||||
* Utilities for example programs
|
||||
*
|
||||
* Copyright (C) 2019 Marco Trevisan <marco.trevisan@canonical.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define FP_COMPONENT "example-utilities"
|
||||
|
||||
#include <libfprint/fprint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "utilities.h"
|
||||
|
||||
FpDevice *
|
||||
discover_device (GPtrArray * devices)
|
||||
{
|
||||
FpDevice *dev;
|
||||
int i;
|
||||
|
||||
if (!devices->len)
|
||||
return NULL;
|
||||
|
||||
if (devices->len == 1)
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_print ("Multiple devices found, choose one\n");
|
||||
|
||||
for (i = 0; i < devices->len; ++i)
|
||||
{
|
||||
dev = g_ptr_array_index (devices, i);
|
||||
g_print ("[%d] %s (%s) - driver %s\n", i,
|
||||
fp_device_get_device_id (dev), fp_device_get_name (dev),
|
||||
fp_device_get_driver (dev));
|
||||
}
|
||||
|
||||
g_print ("> ");
|
||||
if (!scanf ("%d%*c", &i))
|
||||
return NULL;
|
||||
|
||||
if (i < 0 || i >= devices->len)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dev = g_ptr_array_index (devices, i);
|
||||
g_print ("Selected device %s (%s) claimed by %s driver\n",
|
||||
fp_device_get_device_id (dev), fp_device_get_name (dev),
|
||||
fp_device_get_driver (dev));
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
||||
const char *
|
||||
finger_to_string (FpFinger finger)
|
||||
{
|
||||
switch (finger)
|
||||
{
|
||||
case FP_FINGER_LEFT_THUMB:
|
||||
return "left thumb";
|
||||
|
||||
case FP_FINGER_LEFT_INDEX:
|
||||
return "left index";
|
||||
|
||||
case FP_FINGER_LEFT_MIDDLE:
|
||||
return "left middle";
|
||||
|
||||
case FP_FINGER_LEFT_RING:
|
||||
return "left ring";
|
||||
|
||||
case FP_FINGER_LEFT_LITTLE:
|
||||
return "left little";
|
||||
|
||||
case FP_FINGER_RIGHT_THUMB:
|
||||
return "right thumb";
|
||||
|
||||
case FP_FINGER_RIGHT_INDEX:
|
||||
return "right index";
|
||||
|
||||
case FP_FINGER_RIGHT_MIDDLE:
|
||||
return "right middle";
|
||||
|
||||
case FP_FINGER_RIGHT_RING:
|
||||
return "right ring";
|
||||
|
||||
case FP_FINGER_RIGHT_LITTLE:
|
||||
return "right little";
|
||||
|
||||
case FP_FINGER_UNKNOWN:
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
FpFinger
|
||||
finger_chooser (void)
|
||||
{
|
||||
int i = FP_FINGER_UNKNOWN;
|
||||
|
||||
for (i = FP_FINGER_FIRST; i <= FP_FINGER_LAST; ++i)
|
||||
g_print (" [%d] %s\n", (i - FP_FINGER_FIRST), finger_to_string (i));
|
||||
|
||||
g_print ("> ");
|
||||
if (!scanf ("%d%*c", &i))
|
||||
return FP_FINGER_UNKNOWN;
|
||||
|
||||
i += FP_FINGER_FIRST;
|
||||
|
||||
if (i < FP_FINGER_FIRST || i > FP_FINGER_LAST)
|
||||
return FP_FINGER_UNKNOWN;
|
||||
|
||||
return i;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Trivial storage driver for example programs
|
||||
*
|
||||
* Copyright (C) 2019 Marco Trevisan <marco.trevisan@canonical.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
FpDevice * discover_device (GPtrArray *devices);
|
||||
FpFinger finger_chooser (void);
|
||||
const char * finger_to_string (FpFinger finger);
|
||||
@@ -1,8 +1,7 @@
|
||||
/*
|
||||
* Example fingerprint verification program, which verifies the
|
||||
* Example fingerprint verification program, which verifies the right index
|
||||
* finger which has been previously enrolled to disk.
|
||||
* Copyright (C) 2007 Daniel Drake <dsd@gentoo.org>
|
||||
* Copyright (C) 2019 Marco Trevisan <marco.trevisan@canonical.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -19,344 +18,133 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define FP_COMPONENT "example-verify"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <libfprint/fprint.h>
|
||||
#include <glib-unix.h>
|
||||
|
||||
#include "storage.h"
|
||||
#include "utilities.h"
|
||||
|
||||
typedef struct _VerifyData
|
||||
struct fp_dscv_dev *discover_device(struct fp_dscv_dev **discovered_devs)
|
||||
{
|
||||
GMainLoop *loop;
|
||||
GCancellable *cancellable;
|
||||
unsigned int sigint_handler;
|
||||
FpFinger finger;
|
||||
int ret_value;
|
||||
} VerifyData;
|
||||
struct fp_dscv_dev *ddev = discovered_devs[0];
|
||||
struct fp_driver *drv;
|
||||
if (!ddev)
|
||||
return NULL;
|
||||
|
||||
static void
|
||||
verify_data_free (VerifyData *verify_data)
|
||||
{
|
||||
g_clear_handle_id (&verify_data->sigint_handler, g_source_remove);
|
||||
g_clear_object (&verify_data->cancellable);
|
||||
g_main_loop_unref (verify_data->loop);
|
||||
g_free (verify_data);
|
||||
}
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (VerifyData, verify_data_free)
|
||||
|
||||
static void
|
||||
on_device_closed (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
{
|
||||
VerifyData *verify_data = user_data;
|
||||
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
fp_device_close_finish (dev, res, &error);
|
||||
|
||||
if (error)
|
||||
g_warning ("Failed closing device %s", error->message);
|
||||
|
||||
g_main_loop_quit (verify_data->loop);
|
||||
drv = fp_dscv_dev_get_driver(ddev);
|
||||
printf("Found device claimed by %s driver\n", fp_driver_get_full_name(drv));
|
||||
return ddev;
|
||||
}
|
||||
|
||||
static void
|
||||
verify_quit (FpDevice *dev,
|
||||
VerifyData *verify_data)
|
||||
int verify(struct fp_dev *dev, struct fp_print_data *data)
|
||||
{
|
||||
if (!fp_device_is_open (dev))
|
||||
{
|
||||
g_main_loop_quit (verify_data->loop);
|
||||
return;
|
||||
int r;
|
||||
|
||||
do {
|
||||
struct fp_img *img = NULL;
|
||||
|
||||
sleep(1);
|
||||
printf("\nScan your finger now.\n");
|
||||
r = fp_verify_finger_img(dev, data, &img);
|
||||
if (img) {
|
||||
fp_img_save_to_file(img, "verify.pgm");
|
||||
printf("Wrote scanned image to verify.pgm\n");
|
||||
fp_img_free(img);
|
||||
}
|
||||
if (r < 0) {
|
||||
printf("verification failed with error %d :(\n", r);
|
||||
return r;
|
||||
}
|
||||
switch (r) {
|
||||
case FP_VERIFY_NO_MATCH:
|
||||
printf("NO MATCH!\n");
|
||||
return 0;
|
||||
case FP_VERIFY_MATCH:
|
||||
printf("MATCH!\n");
|
||||
return 0;
|
||||
case FP_VERIFY_RETRY:
|
||||
printf("Scan didn't quite work. Please try again.\n");
|
||||
break;
|
||||
case FP_VERIFY_RETRY_TOO_SHORT:
|
||||
printf("Swipe was too short, please try again.\n");
|
||||
break;
|
||||
case FP_VERIFY_RETRY_CENTER_FINGER:
|
||||
printf("Please center your finger on the sensor and try again.\n");
|
||||
break;
|
||||
case FP_VERIFY_RETRY_REMOVE_FINGER:
|
||||
printf("Please remove finger from the sensor and try again.\n");
|
||||
break;
|
||||
}
|
||||
} while (1);
|
||||
}
|
||||
|
||||
fp_device_close (dev, NULL, (GAsyncReadyCallback) on_device_closed, verify_data);
|
||||
}
|
||||
|
||||
static void start_verification (FpDevice *dev,
|
||||
VerifyData *verify_data);
|
||||
|
||||
static void
|
||||
on_verify_completed (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
int main(void)
|
||||
{
|
||||
VerifyData *verify_data = user_data;
|
||||
|
||||
g_autoptr(FpPrint) print = NULL;
|
||||
g_autoptr(GError) error = NULL;
|
||||
char buffer[20];
|
||||
gboolean match;
|
||||
|
||||
if (!fp_device_verify_finish (dev, res, &match, &print, &error))
|
||||
{
|
||||
g_warning ("Failed to verify print: %s", error->message);
|
||||
verify_data->ret_value = EXIT_FAILURE;
|
||||
|
||||
if (error->domain != FP_DEVICE_RETRY)
|
||||
{
|
||||
verify_quit (dev, verify_data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
g_print ("Verify again? [Y/n]? ");
|
||||
if (fgets (buffer, sizeof (buffer), stdin) &&
|
||||
(buffer[0] == 'Y' || buffer[0] == 'y' || buffer[0] == '\n'))
|
||||
{
|
||||
start_verification (dev, verify_data);
|
||||
return;
|
||||
}
|
||||
|
||||
verify_quit (dev, verify_data);
|
||||
}
|
||||
|
||||
static void
|
||||
on_match_cb (FpDevice *dev, FpPrint *match, FpPrint *print,
|
||||
gpointer user_data, GError *error)
|
||||
{
|
||||
VerifyData *verify_data = user_data;
|
||||
|
||||
if (error)
|
||||
{
|
||||
g_warning ("Match report: Finger not matched, retry error reported: %s",
|
||||
error->message);
|
||||
return;
|
||||
}
|
||||
|
||||
if (print && fp_print_get_image (print) &&
|
||||
print_image_save (print, "verify.pgm"))
|
||||
g_print ("Print image saved as verify.pgm\n");
|
||||
|
||||
if (match)
|
||||
{
|
||||
const GDate *date = fp_print_get_enroll_date (match);
|
||||
char date_str[128] = "<unknown>";
|
||||
|
||||
verify_data->ret_value = EXIT_SUCCESS;
|
||||
|
||||
if (date && g_date_valid (date))
|
||||
g_date_strftime (date_str, G_N_ELEMENTS (date_str), "%Y-%m-%d\0",
|
||||
fp_print_get_enroll_date (match));
|
||||
g_debug ("Match report: device %s matched finger %s successifully "
|
||||
"with print %s, enrolled on date %s by user %s",
|
||||
fp_device_get_name (dev),
|
||||
finger_to_string (fp_print_get_finger (match)),
|
||||
fp_print_get_description (match), date_str,
|
||||
fp_print_get_username (match));
|
||||
|
||||
g_print ("MATCH!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
g_debug ("Match report: Finger not matched");
|
||||
g_print ("NO MATCH!\n");
|
||||
}
|
||||
}
|
||||
|
||||
static FpPrint *
|
||||
get_stored_print (FpDevice *dev, VerifyData *verify_data)
|
||||
{
|
||||
FpPrint *verify_print;
|
||||
|
||||
g_print ("Loading previously enrolled %s finger data...\n",
|
||||
finger_to_string (verify_data->finger));
|
||||
|
||||
verify_print = print_data_load (dev, verify_data->finger);
|
||||
|
||||
if (!verify_print)
|
||||
{
|
||||
g_warning ("Failed to load fingerprint data");
|
||||
g_warning ("Did you remember to enroll your %s finger first?",
|
||||
finger_to_string (verify_data->finger));
|
||||
}
|
||||
|
||||
return verify_print;
|
||||
}
|
||||
|
||||
static void
|
||||
on_list_completed (FpDevice *dev, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
VerifyData *verify_data = user_data;
|
||||
|
||||
g_autoptr(GPtrArray) prints = NULL;
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
prints = fp_device_list_prints_finish (dev, res, &error);
|
||||
|
||||
if (!error)
|
||||
{
|
||||
FpPrint *verify_print = NULL;
|
||||
g_autoptr(FpPrint) stored_print = NULL;
|
||||
guint i;
|
||||
|
||||
if (!prints->len)
|
||||
{
|
||||
g_warning ("No prints saved on device");
|
||||
verify_quit (dev, verify_data);
|
||||
return;
|
||||
}
|
||||
|
||||
stored_print = get_stored_print (dev, verify_data);
|
||||
|
||||
for (i = 0; i < prints->len; ++i)
|
||||
{
|
||||
FpPrint *print = prints->pdata[i];
|
||||
|
||||
if (stored_print && fp_print_equal (stored_print, print))
|
||||
/* If the private print data matches, let's use the stored print
|
||||
* as it contains more metadata to show */
|
||||
print = stored_print;
|
||||
|
||||
if (fp_print_get_finger (print) == verify_data->finger &&
|
||||
g_strcmp0 (fp_print_get_username (print), g_get_user_name ()) == 0)
|
||||
{
|
||||
const GDate *verify_print_date = NULL;
|
||||
const GDate *print_date = fp_print_get_enroll_date (print);
|
||||
|
||||
if (verify_print)
|
||||
verify_print_date = fp_print_get_enroll_date (verify_print);
|
||||
|
||||
if (!verify_print || !print_date || !verify_print_date ||
|
||||
g_date_compare (print_date, verify_print_date) >= 0)
|
||||
verify_print = print;
|
||||
}
|
||||
}
|
||||
|
||||
if (!verify_print)
|
||||
{
|
||||
verify_quit (dev, verify_data);
|
||||
return;
|
||||
}
|
||||
|
||||
g_debug ("Comparing print with %s",
|
||||
fp_print_get_description (verify_print));
|
||||
|
||||
g_print ("Print loaded. Time to verify!\n");
|
||||
fp_device_verify (dev, verify_print, verify_data->cancellable,
|
||||
on_match_cb, verify_data, NULL,
|
||||
(GAsyncReadyCallback) on_verify_completed,
|
||||
verify_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Loading prints failed with error %s", error->message);
|
||||
verify_quit (dev, verify_data);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
start_verification (FpDevice *dev, VerifyData *verify_data)
|
||||
{
|
||||
if (verify_data->finger == FP_FINGER_UNKNOWN)
|
||||
{
|
||||
g_print ("Choose the finger to verify:\n");
|
||||
verify_data->finger = finger_chooser ();
|
||||
}
|
||||
|
||||
if (verify_data->finger == FP_FINGER_UNKNOWN)
|
||||
{
|
||||
g_warning ("Unknown finger selected");
|
||||
verify_data->ret_value = EXIT_FAILURE;
|
||||
verify_quit (dev, verify_data);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fp_device_has_feature (dev, FP_DEVICE_FEATURE_STORAGE))
|
||||
{
|
||||
g_print ("Creating finger template, using device storage...\n");
|
||||
fp_device_list_prints (dev, NULL,
|
||||
(GAsyncReadyCallback) on_list_completed,
|
||||
verify_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_autoptr(FpPrint) verify_print = get_stored_print (dev, verify_data);
|
||||
|
||||
if (!verify_print)
|
||||
{
|
||||
verify_quit (dev, verify_data);
|
||||
return;
|
||||
}
|
||||
|
||||
g_print ("Print loaded. Time to verify!\n");
|
||||
fp_device_verify (dev, verify_print, verify_data->cancellable,
|
||||
on_match_cb, verify_data, NULL,
|
||||
(GAsyncReadyCallback) on_verify_completed,
|
||||
verify_data);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_device_opened (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
{
|
||||
VerifyData *verify_data = user_data;
|
||||
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
if (!fp_device_open_finish (dev, res, &error))
|
||||
{
|
||||
g_warning ("Failed to open device: %s", error->message);
|
||||
verify_quit (dev, verify_data);
|
||||
return;
|
||||
}
|
||||
|
||||
g_print ("Opened device. ");
|
||||
|
||||
start_verification (dev, verify_data);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
sigint_cb (void *user_data)
|
||||
{
|
||||
VerifyData *verify_data = user_data;
|
||||
|
||||
g_cancellable_cancel (verify_data->cancellable);
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
g_autoptr(FpContext) ctx = NULL;
|
||||
g_autoptr(VerifyData) verify_data = NULL;
|
||||
GPtrArray *devices;
|
||||
FpDevice *dev;
|
||||
int r = 1;
|
||||
struct fp_dscv_dev *ddev;
|
||||
struct fp_dscv_dev **discovered_devs;
|
||||
struct fp_dev *dev;
|
||||
struct fp_print_data *data;
|
||||
|
||||
setenv ("G_MESSAGES_DEBUG", "all", 0);
|
||||
setenv ("LIBUSB_DEBUG", "3", 0);
|
||||
|
||||
ctx = fp_context_new ();
|
||||
|
||||
devices = fp_context_get_devices (ctx);
|
||||
if (!devices)
|
||||
{
|
||||
g_warning ("Impossible to get devices");
|
||||
return EXIT_FAILURE;
|
||||
r = fp_init();
|
||||
if (r < 0) {
|
||||
fprintf(stderr, "Failed to initialize libfprint\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
dev = discover_device (devices);
|
||||
if (!dev)
|
||||
{
|
||||
g_warning ("No devices detected.");
|
||||
return EXIT_FAILURE;
|
||||
discovered_devs = fp_discover_devs();
|
||||
if (!discovered_devs) {
|
||||
fprintf(stderr, "Could not discover devices\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
verify_data = g_new0 (VerifyData, 1);
|
||||
verify_data->ret_value = EXIT_FAILURE;
|
||||
verify_data->loop = g_main_loop_new (NULL, FALSE);
|
||||
verify_data->cancellable = g_cancellable_new ();
|
||||
verify_data->sigint_handler = g_unix_signal_add_full (G_PRIORITY_HIGH,
|
||||
SIGINT,
|
||||
sigint_cb,
|
||||
verify_data,
|
||||
NULL);
|
||||
fp_device_open (dev, verify_data->cancellable,
|
||||
(GAsyncReadyCallback) on_device_opened,
|
||||
verify_data);
|
||||
|
||||
g_main_loop_run (verify_data->loop);
|
||||
|
||||
return verify_data->ret_value;
|
||||
ddev = discover_device(discovered_devs);
|
||||
if (!ddev) {
|
||||
fprintf(stderr, "No devices detected.\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
dev = fp_dev_open(ddev);
|
||||
fp_dscv_devs_free(discovered_devs);
|
||||
if (!dev) {
|
||||
fprintf(stderr, "Could not open device.\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
printf("Opened device. Loading previously enrolled right index finger "
|
||||
"data...\n");
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
r = fp_print_data_load(dev, RIGHT_INDEX, &data);
|
||||
#pragma GCC diagnostic pop
|
||||
if (r != 0) {
|
||||
fprintf(stderr, "Failed to load fingerprint, error %d\n", r);
|
||||
fprintf(stderr, "Did you remember to enroll your right index finger "
|
||||
"first?\n");
|
||||
goto out_close;
|
||||
}
|
||||
|
||||
printf("Print loaded. Time to verify!\n");
|
||||
do {
|
||||
char buffer[20];
|
||||
|
||||
verify(dev, data);
|
||||
printf("Verify again? [Y/n]? ");
|
||||
fgets(buffer, sizeof(buffer), stdin);
|
||||
if (buffer[0] != '\n' && buffer[0] != 'y' && buffer[0] != 'Y')
|
||||
break;
|
||||
} while (1);
|
||||
|
||||
fp_print_data_free(data);
|
||||
out_close:
|
||||
fp_dev_close(dev);
|
||||
out:
|
||||
fp_exit();
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
/*
|
||||
* Example fingerprint verification program
|
||||
* Copyright (C) 2007 Daniel Drake <dsd@gentoo.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <libfprint/fprint.h>
|
||||
|
||||
struct fp_dscv_dev *discover_device(struct fp_dscv_dev **discovered_devs)
|
||||
{
|
||||
struct fp_dscv_dev *ddev = discovered_devs[0];
|
||||
struct fp_driver *drv;
|
||||
if (!ddev)
|
||||
return NULL;
|
||||
|
||||
drv = fp_dscv_dev_get_driver(ddev);
|
||||
printf("Found device claimed by %s driver\n", fp_driver_get_full_name(drv));
|
||||
return ddev;
|
||||
}
|
||||
|
||||
struct fp_print_data *enroll(struct fp_dev *dev) {
|
||||
struct fp_print_data *enrolled_print = NULL;
|
||||
int r;
|
||||
|
||||
printf("You will need to successfully scan your finger %d times to "
|
||||
"complete the process.\n", fp_dev_get_nr_enroll_stages(dev));
|
||||
|
||||
do {
|
||||
printf("\nScan your finger now.\n");
|
||||
r = fp_enroll_finger(dev, &enrolled_print);
|
||||
if (r < 0) {
|
||||
printf("Enroll failed with error %d\n", r);
|
||||
return NULL;
|
||||
}
|
||||
switch (r) {
|
||||
case FP_ENROLL_COMPLETE:
|
||||
printf("Enroll complete!\n");
|
||||
break;
|
||||
case FP_ENROLL_FAIL:
|
||||
printf("Enroll failed, something wen't wrong :(\n");
|
||||
return NULL;
|
||||
case FP_ENROLL_PASS:
|
||||
printf("Enroll stage passed. Yay!\n");
|
||||
break;
|
||||
case FP_ENROLL_RETRY:
|
||||
printf("Didn't quite catch that. Please try again.\n");
|
||||
break;
|
||||
case FP_ENROLL_RETRY_TOO_SHORT:
|
||||
printf("Your swipe was too short, please try again.\n");
|
||||
break;
|
||||
case FP_ENROLL_RETRY_CENTER_FINGER:
|
||||
printf("Didn't catch that, please center your finger on the "
|
||||
"sensor and try again.\n");
|
||||
break;
|
||||
case FP_ENROLL_RETRY_REMOVE_FINGER:
|
||||
printf("Scan failed, please remove your finger and then try "
|
||||
"again.\n");
|
||||
break;
|
||||
}
|
||||
} while (r != FP_ENROLL_COMPLETE);
|
||||
|
||||
if (!enrolled_print) {
|
||||
fprintf(stderr, "Enroll complete but no print?\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
printf("Enrollment completed!\n\n");
|
||||
return enrolled_print;
|
||||
}
|
||||
|
||||
int verify(struct fp_dev *dev, struct fp_print_data *data)
|
||||
{
|
||||
int r;
|
||||
|
||||
do {
|
||||
sleep(1);
|
||||
printf("\nScan your finger now.\n");
|
||||
r = fp_verify_finger(dev, data);
|
||||
if (r < 0) {
|
||||
printf("verification failed with error %d :(\n", r);
|
||||
return r;
|
||||
}
|
||||
switch (r) {
|
||||
case FP_VERIFY_NO_MATCH:
|
||||
printf("NO MATCH!\n");
|
||||
return 0;
|
||||
case FP_VERIFY_MATCH:
|
||||
printf("MATCH!\n");
|
||||
return 0;
|
||||
case FP_VERIFY_RETRY:
|
||||
printf("Scan didn't quite work. Please try again.\n");
|
||||
break;
|
||||
case FP_VERIFY_RETRY_TOO_SHORT:
|
||||
printf("Swipe was too short, please try again.\n");
|
||||
break;
|
||||
case FP_VERIFY_RETRY_CENTER_FINGER:
|
||||
printf("Please center your finger on the sensor and try again.\n");
|
||||
break;
|
||||
case FP_VERIFY_RETRY_REMOVE_FINGER:
|
||||
printf("Please remove finger from the sensor and try again.\n");
|
||||
break;
|
||||
}
|
||||
} while (1);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int r = 1;
|
||||
struct fp_dscv_dev *ddev;
|
||||
struct fp_dscv_dev **discovered_devs;
|
||||
struct fp_dev *dev;
|
||||
struct fp_print_data *data;
|
||||
|
||||
setenv ("G_MESSAGES_DEBUG", "all", 0);
|
||||
setenv ("LIBUSB_DEBUG", "3", 0);
|
||||
|
||||
r = fp_init();
|
||||
if (r < 0) {
|
||||
fprintf(stderr, "Failed to initialize libfprint\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
discovered_devs = fp_discover_devs();
|
||||
if (!discovered_devs) {
|
||||
fprintf(stderr, "Could not discover devices\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
ddev = discover_device(discovered_devs);
|
||||
if (!ddev) {
|
||||
fprintf(stderr, "No devices detected.\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
dev = fp_dev_open(ddev);
|
||||
fp_dscv_devs_free(discovered_devs);
|
||||
if (!dev) {
|
||||
fprintf(stderr, "Could not open device.\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
printf("Opened device. It's now time to enroll your finger.\n\n");
|
||||
data = enroll(dev);
|
||||
if (!data)
|
||||
goto out_close;
|
||||
|
||||
|
||||
printf("Normally we'd save that print to disk, and recall it at some "
|
||||
"point later when we want to authenticate the user who just "
|
||||
"enrolled. In the interests of demonstration, we'll authenticate "
|
||||
"that user immediately.\n");
|
||||
|
||||
do {
|
||||
char buffer[20];
|
||||
|
||||
verify(dev, data);
|
||||
printf("Verify again? [Y/n]? ");
|
||||
fgets(buffer, sizeof(buffer), stdin);
|
||||
if (buffer[0] != '\n' && buffer[0] != 'y' && buffer[0] != 'Y')
|
||||
break;
|
||||
} while (1);
|
||||
|
||||
fp_print_data_free(data);
|
||||
out_close:
|
||||
fp_dev_close(dev);
|
||||
out:
|
||||
fp_exit();
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,10 +28,9 @@
|
||||
#include "drivers_api.h"
|
||||
#include "aeslib.h"
|
||||
|
||||
static void start_capture (FpImageDevice *dev);
|
||||
static void complete_deactivation (FpImageDevice *dev);
|
||||
static int adjust_gain (unsigned char *buffer,
|
||||
int status);
|
||||
static void start_capture(struct fp_img_dev *dev);
|
||||
static void complete_deactivation(struct fp_img_dev *dev);
|
||||
static int adjust_gain(unsigned char *buffer, int status);
|
||||
|
||||
#define FIRST_AES1610_REG 0x1B
|
||||
#define LAST_AES1610_REG 0xFF
|
||||
@@ -40,8 +39,8 @@ static int adjust_gain (unsigned char *buffer,
|
||||
#define GAIN_STATUS_NORMAL 2
|
||||
|
||||
/* FIXME these need checking */
|
||||
#define EP_IN (1 | FPI_USB_ENDPOINT_IN)
|
||||
#define EP_OUT (2 | FPI_USB_ENDPOINT_OUT)
|
||||
#define EP_IN (1 | LIBUSB_ENDPOINT_IN)
|
||||
#define EP_OUT (2 | LIBUSB_ENDPOINT_OUT)
|
||||
|
||||
#define BULK_TIMEOUT 4000
|
||||
|
||||
@@ -70,19 +69,13 @@ static int adjust_gain (unsigned char *buffer,
|
||||
|
||||
/****** GENERAL FUNCTIONS ******/
|
||||
|
||||
struct _FpiDeviceAes1610
|
||||
{
|
||||
FpImageDevice parent;
|
||||
|
||||
guint8 read_regs_retry_count;
|
||||
struct aes1610_dev {
|
||||
uint8_t read_regs_retry_count;
|
||||
GSList *strips;
|
||||
gsize strips_len;
|
||||
size_t strips_len;
|
||||
gboolean deactivating;
|
||||
guint8 blanks_count;
|
||||
uint8_t blanks_count;
|
||||
};
|
||||
G_DECLARE_FINAL_TYPE (FpiDeviceAes1610, fpi_device_aes1610, FPI, DEVICE_AES1610,
|
||||
FpImageDevice);
|
||||
G_DEFINE_TYPE (FpiDeviceAes1610, fpi_device_aes1610, FP_TYPE_IMAGE_DEVICE);
|
||||
|
||||
static struct fpi_frame_asmbl_ctx assembling_ctx = {
|
||||
.frame_width = FRAME_WIDTH,
|
||||
@@ -91,56 +84,67 @@ static struct fpi_frame_asmbl_ctx assembling_ctx = {
|
||||
.get_pixel = aes_get_pixel,
|
||||
};
|
||||
|
||||
typedef void (*aes1610_read_regs_cb)(FpImageDevice *dev,
|
||||
int status,
|
||||
unsigned char *regs,
|
||||
void *user_data);
|
||||
typedef void (*aes1610_read_regs_cb)(struct fp_img_dev *dev, int status,
|
||||
unsigned char *regs, void *user_data);
|
||||
|
||||
struct aes1610_read_regs
|
||||
{
|
||||
FpImageDevice *dev;
|
||||
struct aes1610_read_regs {
|
||||
struct fp_img_dev *dev;
|
||||
aes1610_read_regs_cb callback;
|
||||
struct aes_regwrite *regwrite;
|
||||
void *user_data;
|
||||
};
|
||||
|
||||
/* FIXME: what to do here? */
|
||||
static void
|
||||
stub_capture_stop_cb (FpImageDevice *dev, GError *error,
|
||||
void *user_data)
|
||||
static void stub_capture_stop_cb(struct fp_img_dev *dev, int result, void *user_data)
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
fp_warn ("Error stopping capture: %s", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
generic_write_regv_cb (FpImageDevice *dev, GError *error,
|
||||
|
||||
/* check that read succeeded but ignore all data */
|
||||
static void generic_ignore_data_cb(struct libusb_transfer *transfer)
|
||||
{
|
||||
fpi_ssm *ssm = transfer->user_data;
|
||||
|
||||
if (transfer->status != LIBUSB_TRANSFER_COMPLETED)
|
||||
fpi_ssm_mark_failed(ssm, -EIO);
|
||||
else if (transfer->length != transfer->actual_length)
|
||||
fpi_ssm_mark_failed(ssm, -EPROTO);
|
||||
else
|
||||
fpi_ssm_next_state(ssm);
|
||||
|
||||
g_free(transfer->buffer);
|
||||
libusb_free_transfer(transfer);
|
||||
}
|
||||
|
||||
static void generic_write_regv_cb(struct fp_img_dev *dev, int result,
|
||||
void *user_data)
|
||||
{
|
||||
FpiSsm *ssm = user_data;
|
||||
|
||||
if (!error)
|
||||
fpi_ssm *ssm = user_data;
|
||||
if (result == 0)
|
||||
fpi_ssm_next_state(ssm);
|
||||
else
|
||||
fpi_ssm_mark_failed (ssm, error);
|
||||
fpi_ssm_mark_failed(ssm, result);
|
||||
}
|
||||
|
||||
/* read the specified number of bytes from the IN endpoint but throw them
|
||||
* away, then increment the SSM */
|
||||
static void
|
||||
generic_read_ignore_data (FpiSsm *ssm, FpDevice *dev,
|
||||
size_t bytes)
|
||||
static void generic_read_ignore_data(fpi_ssm *ssm, struct fp_dev *dev, size_t bytes)
|
||||
{
|
||||
FpiUsbTransfer *transfer = fpi_usb_transfer_new (dev);
|
||||
struct libusb_transfer *transfer = fpi_usb_alloc();
|
||||
unsigned char *data;
|
||||
int r;
|
||||
|
||||
fpi_usb_transfer_fill_bulk (transfer, EP_IN, bytes);
|
||||
transfer->ssm = ssm;
|
||||
transfer->short_is_error = TRUE;
|
||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
||||
fpi_ssm_usb_transfer_cb, NULL);
|
||||
data = g_malloc(bytes);
|
||||
libusb_fill_bulk_transfer(transfer, fpi_dev_get_usb_dev(dev), EP_IN, data, bytes,
|
||||
generic_ignore_data_cb, ssm, BULK_TIMEOUT);
|
||||
|
||||
r = libusb_submit_transfer(transfer);
|
||||
if (r < 0) {
|
||||
g_free(data);
|
||||
libusb_free_transfer(transfer);
|
||||
fpi_ssm_mark_failed(ssm, r);
|
||||
}
|
||||
}
|
||||
|
||||
/****** FINGER PRESENCE DETECTION ******/
|
||||
@@ -171,67 +175,72 @@ static const struct aes_regwrite finger_det_reqs[] = {
|
||||
{ 0x81, 0x04 }
|
||||
};
|
||||
|
||||
static void start_finger_detection (FpImageDevice *dev);
|
||||
static void start_finger_detection(struct fp_img_dev *dev);
|
||||
|
||||
static void
|
||||
finger_det_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
gpointer user_data, GError *error)
|
||||
static void finger_det_data_cb(struct libusb_transfer *transfer)
|
||||
{
|
||||
FpImageDevice *dev = FP_IMAGE_DEVICE (device);
|
||||
struct fp_img_dev *dev = transfer->user_data;
|
||||
unsigned char *data = transfer->buffer;
|
||||
int i;
|
||||
int sum = 0;
|
||||
|
||||
if (error)
|
||||
{
|
||||
fpi_image_device_session_error (dev, error);
|
||||
return;
|
||||
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
|
||||
fpi_imgdev_session_error(dev, -EIO);
|
||||
goto out;
|
||||
} else if (transfer->length != transfer->actual_length) {
|
||||
fpi_imgdev_session_error(dev, -EPROTO);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* examine histogram to determine finger presence */
|
||||
for (i = 3; i < 17; i++)
|
||||
sum += (data[i] & 0xf) + (data[i] >> 4);
|
||||
if (sum > 20)
|
||||
{
|
||||
if (sum > 20) {
|
||||
/* reset default gain */
|
||||
adjust_gain(data,GAIN_STATUS_FIRST);
|
||||
/* finger present, start capturing */
|
||||
fpi_image_device_report_finger_status (dev, TRUE);
|
||||
fpi_imgdev_report_finger_status(dev, TRUE);
|
||||
start_capture(dev);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
/* no finger, poll for a new histogram */
|
||||
start_finger_detection(dev);
|
||||
}
|
||||
|
||||
out:
|
||||
g_free(data);
|
||||
libusb_free_transfer(transfer);
|
||||
}
|
||||
|
||||
static void
|
||||
finger_det_reqs_cb (FpImageDevice *dev, GError *error,
|
||||
void *user_data)
|
||||
static void finger_det_reqs_cb(struct fp_img_dev *dev, int result, void *user_data)
|
||||
{
|
||||
FpiUsbTransfer *transfer;
|
||||
struct libusb_transfer *transfer;
|
||||
unsigned char *data;
|
||||
int r;
|
||||
|
||||
if (error)
|
||||
{
|
||||
fpi_image_device_session_error (dev, error);
|
||||
if (result) {
|
||||
fpi_imgdev_session_error(dev, result);
|
||||
return;
|
||||
}
|
||||
|
||||
transfer = fpi_usb_transfer_new (FP_DEVICE (dev));
|
||||
fpi_usb_transfer_fill_bulk (transfer, EP_IN, FINGER_DETECTION_LEN);
|
||||
transfer->short_is_error = TRUE;
|
||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
||||
finger_det_data_cb, NULL);
|
||||
transfer = fpi_usb_alloc();
|
||||
data = g_malloc(FINGER_DETECTION_LEN);
|
||||
libusb_fill_bulk_transfer(transfer, fpi_dev_get_usb_dev(FP_DEV(dev)), EP_IN, data, FINGER_DETECTION_LEN,
|
||||
finger_det_data_cb, dev, BULK_TIMEOUT);
|
||||
|
||||
r = libusb_submit_transfer(transfer);
|
||||
if (r < 0) {
|
||||
g_free(data);
|
||||
libusb_free_transfer(transfer);
|
||||
fpi_imgdev_session_error(dev, r);
|
||||
}
|
||||
|
||||
static void
|
||||
start_finger_detection (FpImageDevice *dev)
|
||||
{
|
||||
FpiDeviceAes1610 *self = FPI_DEVICE_AES1610 (dev);
|
||||
}
|
||||
|
||||
if (self->deactivating)
|
||||
static void start_finger_detection(struct fp_img_dev *dev)
|
||||
{
|
||||
struct aes1610_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
|
||||
if (aesdev->deactivating) {
|
||||
complete_deactivation(dev);
|
||||
return;
|
||||
}
|
||||
@@ -395,42 +404,36 @@ static unsigned char list_BD_values[10] = {
|
||||
/*
|
||||
* Adjust the gain according to the histogram data
|
||||
* 0xbd, 0xbe, 0x29 and 0x2A registers are affected
|
||||
* Returns 0 if no problem occurred
|
||||
* Returns 0 if no problem occured
|
||||
* TODO: This is a basic support for gain. It needs testing/tweaking. */
|
||||
static int
|
||||
adjust_gain (unsigned char *buffer, int status)
|
||||
static int adjust_gain(unsigned char *buffer, int status)
|
||||
{
|
||||
// The position in the array of possible values for 0xBE and 0xBD registers
|
||||
static int pos_list_BE = 0;
|
||||
static int pos_list_BD = 0;
|
||||
|
||||
// This is the first adjustment (we begin acquisition)
|
||||
// This is the first adjustement (we begin acquisition)
|
||||
// We adjust strip_scan_reqs for future strips and capture_reqs that is sent just after this step
|
||||
if (status == GAIN_STATUS_FIRST)
|
||||
{
|
||||
if (buffer[1] > 0x78) // maximum gain needed
|
||||
{
|
||||
if (status == GAIN_STATUS_FIRST) {
|
||||
if (buffer[1] > 0x78) { // maximum gain needed
|
||||
strip_scan_reqs[0].value = 0x6B;
|
||||
strip_scan_reqs[1].value = 0x06;
|
||||
strip_scan_reqs[2].value = 0x35;
|
||||
strip_scan_reqs[3].value = 0x4B;
|
||||
}
|
||||
else if (buffer[1] > 0x55)
|
||||
{
|
||||
else if (buffer[1] > 0x55) {
|
||||
strip_scan_reqs[0].value = 0x63;
|
||||
strip_scan_reqs[1].value = 0x15;
|
||||
strip_scan_reqs[2].value = 0x35;
|
||||
strip_scan_reqs[3].value = 0x3b;
|
||||
}
|
||||
else if (buffer[1] > 0x40 || buffer[16] > 0x19)
|
||||
{
|
||||
else if (buffer[1] > 0x40 || buffer[16] > 0x19) {
|
||||
strip_scan_reqs[0].value = 0x43;
|
||||
strip_scan_reqs[1].value = 0x13;
|
||||
strip_scan_reqs[2].value = 0x35;
|
||||
strip_scan_reqs[3].value = 0x30;
|
||||
}
|
||||
else // minimum gain needed
|
||||
{
|
||||
else { // minimum gain needed
|
||||
strip_scan_reqs[0].value = 0x23;
|
||||
strip_scan_reqs[1].value = 0x07;
|
||||
strip_scan_reqs[2].value = 0x35;
|
||||
@@ -445,13 +448,12 @@ adjust_gain (unsigned char *buffer, int status)
|
||||
|
||||
fp_dbg("first gain: %x %x %x %x %x %x %x %x", strip_scan_reqs[0].reg, strip_scan_reqs[0].value, strip_scan_reqs[1].reg, strip_scan_reqs[1].value, strip_scan_reqs[2].reg, strip_scan_reqs[2].value, strip_scan_reqs[3].reg, strip_scan_reqs[3].value);
|
||||
}
|
||||
|
||||
// Every 2/3 strips
|
||||
// We try to soften big changes of the gain (at least for 0xBE and 0xBD
|
||||
// FIXME: This softenning will need testing and tweaking too
|
||||
else if (status == GAIN_STATUS_NORMAL)
|
||||
{
|
||||
if (buffer[514] > 0x78) // maximum gain needed
|
||||
{
|
||||
else if (status == GAIN_STATUS_NORMAL) {
|
||||
if (buffer[514] > 0x78) { // maximum gain needed
|
||||
if (pos_list_BE < 7)
|
||||
pos_list_BE++;
|
||||
|
||||
@@ -461,8 +463,7 @@ adjust_gain (unsigned char *buffer, int status)
|
||||
strip_scan_reqs[1].value = 0x04;
|
||||
strip_scan_reqs[2].value = 0x35;
|
||||
}
|
||||
else if (buffer[514] > 0x55)
|
||||
{
|
||||
else if (buffer[514] > 0x55) {
|
||||
if (pos_list_BE < 2)
|
||||
pos_list_BE++;
|
||||
else if (pos_list_BE > 2)
|
||||
@@ -476,8 +477,7 @@ adjust_gain (unsigned char *buffer, int status)
|
||||
strip_scan_reqs[1].value = 0x15;
|
||||
strip_scan_reqs[2].value = 0x35;
|
||||
}
|
||||
else if (buffer[514] > 0x40 || buffer[529] > 0x19)
|
||||
{
|
||||
else if (buffer[514] > 0x40 || buffer[529] > 0x19) {
|
||||
if (pos_list_BE < 1)
|
||||
pos_list_BE++;
|
||||
else if (pos_list_BE > 1)
|
||||
@@ -491,8 +491,7 @@ adjust_gain (unsigned char *buffer, int status)
|
||||
strip_scan_reqs[1].value = 0x13;
|
||||
strip_scan_reqs[2].value = 0x35;
|
||||
}
|
||||
else // minimum gain needed
|
||||
{
|
||||
else { // minimum gain needed
|
||||
if (pos_list_BE > 0)
|
||||
pos_list_BE--;
|
||||
|
||||
@@ -509,8 +508,7 @@ adjust_gain (unsigned char *buffer, int status)
|
||||
fp_dbg("gain: %x %x %x %x %x %x %x %x", strip_scan_reqs[0].reg, strip_scan_reqs[0].value, strip_scan_reqs[1].reg, strip_scan_reqs[1].value, strip_scan_reqs[2].reg, strip_scan_reqs[2].value, strip_scan_reqs[3].reg, strip_scan_reqs[3].value);
|
||||
}
|
||||
// Unknown status
|
||||
else
|
||||
{
|
||||
else {
|
||||
fp_err("Unexpected gain status.");
|
||||
return 1;
|
||||
}
|
||||
@@ -520,8 +518,7 @@ adjust_gain (unsigned char *buffer, int status)
|
||||
|
||||
/*
|
||||
* Restore the default gain values */
|
||||
static void
|
||||
restore_gain (void)
|
||||
static void restore_gain(void)
|
||||
{
|
||||
strip_scan_reqs[0].value = list_BE_values[0];
|
||||
strip_scan_reqs[1].value = 0x04;
|
||||
@@ -537,7 +534,7 @@ restore_gain (void)
|
||||
|
||||
/* capture SM movement:
|
||||
* request and read strip,
|
||||
* jump back to request UNLESS there's no finger, in which case exit SM,
|
||||
* jump back to request UNLESS theres no finger, in which case exit SM,
|
||||
* report lack of finger presence, and move to finger detection */
|
||||
|
||||
enum capture_states {
|
||||
@@ -548,168 +545,163 @@ enum capture_states {
|
||||
CAPTURE_NUM_STATES,
|
||||
};
|
||||
|
||||
static void
|
||||
capture_read_strip_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
gpointer user_data, GError *error)
|
||||
static void capture_read_strip_cb(struct libusb_transfer *transfer)
|
||||
{
|
||||
unsigned char *stripdata;
|
||||
FpImageDevice *dev = FP_IMAGE_DEVICE (device);
|
||||
FpiDeviceAes1610 *self = FPI_DEVICE_AES1610 (dev);
|
||||
fpi_ssm *ssm = transfer->user_data;
|
||||
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
|
||||
struct aes1610_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
unsigned char *data = transfer->buffer;
|
||||
gint sum, i;
|
||||
int sum, i;
|
||||
|
||||
if (error)
|
||||
{
|
||||
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||
return;
|
||||
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
|
||||
fpi_ssm_mark_failed(ssm, -EIO);
|
||||
goto out;
|
||||
} else if (transfer->length != transfer->actual_length) {
|
||||
fpi_ssm_mark_failed(ssm, -EPROTO);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* FIXME: would preallocating strip buffers be a decent optimization? */
|
||||
|
||||
sum = 0;
|
||||
for (i = 516; i < 530; i++)
|
||||
{
|
||||
/* histogram[i] = number of pixels of value i
|
||||
Only the pixel values from 10 to 15 are used to detect finger. */
|
||||
sum += data[i];
|
||||
}
|
||||
|
||||
fp_dbg ("sum=%d", sum);
|
||||
if (sum > 0)
|
||||
{
|
||||
if (sum > 0) {
|
||||
/* FIXME: would preallocating strip buffers be a decent optimization? */
|
||||
struct fpi_frame *stripe = g_malloc(FRAME_WIDTH * (FRAME_HEIGHT / 2) + sizeof(struct fpi_frame));
|
||||
stripe->delta_x = 0;
|
||||
stripe->delta_y = 0;
|
||||
stripdata = stripe->data;
|
||||
memcpy(stripdata, data + 1, FRAME_WIDTH * (FRAME_HEIGHT / 2));
|
||||
self->strips = g_slist_prepend (self->strips, stripe);
|
||||
self->strips_len++;
|
||||
self->blanks_count = 0;
|
||||
aesdev->strips = g_slist_prepend(aesdev->strips, stripe);
|
||||
aesdev->strips_len++;
|
||||
aesdev->blanks_count = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (sum < 0) {
|
||||
fpi_ssm_mark_failed(ssm, sum);
|
||||
goto out;
|
||||
}
|
||||
fp_dbg("sum=%d", sum);
|
||||
|
||||
/* FIXME: 0 might be too low as a threshold */
|
||||
/* FIXME: sometimes we get 0 in the middle of a scan, should we wait for
|
||||
* a few consecutive zeroes? */
|
||||
|
||||
/* sum cannot be negative, so is 0 */
|
||||
self->blanks_count++;
|
||||
/* If sum is 0 for a reasonable # of frames, finger has been removed */
|
||||
if (sum == 0) {
|
||||
aesdev->blanks_count++;
|
||||
fp_dbg("got blank frame");
|
||||
}
|
||||
|
||||
|
||||
/* use histogram data above for gain calibration (0xbd, 0xbe, 0x29 and 0x2A ) */
|
||||
adjust_gain(data, GAIN_STATUS_NORMAL);
|
||||
|
||||
/* stop capturing if MAX_FRAMES is reached */
|
||||
if (self->blanks_count > 10 || g_slist_length (self->strips) >= MAX_FRAMES)
|
||||
{
|
||||
FpImage *img;
|
||||
if (aesdev->blanks_count > 10 || g_slist_length(aesdev->strips) >= MAX_FRAMES) {
|
||||
struct fp_img *img;
|
||||
|
||||
fp_dbg ("sending stop capture.... blanks=%d frames=%d",
|
||||
self->blanks_count, g_slist_length (self->strips));
|
||||
fp_dbg("sending stop capture.... blanks=%d frames=%d", aesdev->blanks_count, g_slist_length(aesdev->strips));
|
||||
/* send stop capture bits */
|
||||
aes_write_regv(dev, capture_stop, G_N_ELEMENTS(capture_stop), stub_capture_stop_cb, NULL);
|
||||
self->strips = g_slist_reverse (self->strips);
|
||||
fpi_do_movement_estimation (&assembling_ctx, self->strips);
|
||||
img = fpi_assemble_frames (&assembling_ctx, self->strips);
|
||||
img->flags |= FPI_IMAGE_PARTIAL;
|
||||
|
||||
g_slist_free_full (self->strips, g_free);
|
||||
self->strips = NULL;
|
||||
self->strips_len = 0;
|
||||
self->blanks_count = 0;
|
||||
fpi_image_device_image_captured (dev, img);
|
||||
fpi_image_device_report_finger_status (dev, FALSE);
|
||||
aesdev->strips = g_slist_reverse(aesdev->strips);
|
||||
fpi_do_movement_estimation(&assembling_ctx, aesdev->strips, aesdev->strips_len);
|
||||
img = fpi_assemble_frames(&assembling_ctx, aesdev->strips, aesdev->strips_len);
|
||||
img->flags |= FP_IMG_PARTIAL;
|
||||
g_slist_free_full(aesdev->strips, g_free);
|
||||
aesdev->strips = NULL;
|
||||
aesdev->strips_len = 0;
|
||||
aesdev->blanks_count = 0;
|
||||
fpi_imgdev_image_captured(dev, img);
|
||||
fpi_imgdev_report_finger_status(dev, FALSE);
|
||||
/* marking machine complete will re-trigger finger detection loop */
|
||||
fpi_ssm_mark_completed (transfer->ssm);
|
||||
fpi_ssm_mark_completed(ssm);
|
||||
/* Acquisition finished: restore default gain values */
|
||||
restore_gain();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
/* obtain next strip */
|
||||
fpi_ssm_jump_to_state (transfer->ssm, CAPTURE_REQUEST_STRIP);
|
||||
}
|
||||
fpi_ssm_jump_to_state(ssm, CAPTURE_REQUEST_STRIP);
|
||||
}
|
||||
|
||||
static void
|
||||
capture_run_state (FpiSsm *ssm, FpDevice *_dev)
|
||||
{
|
||||
FpImageDevice *dev = FP_IMAGE_DEVICE (_dev);
|
||||
FpiDeviceAes1610 *self = FPI_DEVICE_AES1610 (_dev);
|
||||
out:
|
||||
g_free(data);
|
||||
libusb_free_transfer(transfer);
|
||||
}
|
||||
|
||||
switch (fpi_ssm_get_cur_state (ssm))
|
||||
static void capture_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data)
|
||||
{
|
||||
struct fp_img_dev *dev = user_data;
|
||||
struct aes1610_dev *aesdev = FP_INSTANCE_DATA(_dev);
|
||||
int r;
|
||||
|
||||
switch (fpi_ssm_get_cur_state(ssm)) {
|
||||
case CAPTURE_WRITE_REQS:
|
||||
fp_dbg("write reqs");
|
||||
aes_write_regv(dev, capture_reqs, G_N_ELEMENTS(capture_reqs),
|
||||
generic_write_regv_cb, ssm);
|
||||
break;
|
||||
|
||||
case CAPTURE_READ_DATA:
|
||||
fp_dbg("read data");
|
||||
generic_read_ignore_data(ssm, _dev, STRIP_CAPTURE_LEN);
|
||||
break;
|
||||
|
||||
case CAPTURE_REQUEST_STRIP:
|
||||
fp_dbg("request strip");
|
||||
if (self->deactivating)
|
||||
if (aesdev->deactivating)
|
||||
fpi_ssm_mark_completed(ssm);
|
||||
else
|
||||
aes_write_regv(dev, strip_scan_reqs, G_N_ELEMENTS(strip_scan_reqs),
|
||||
generic_write_regv_cb, ssm);
|
||||
break;
|
||||
|
||||
case CAPTURE_READ_STRIP: ;
|
||||
FpiUsbTransfer *transfer = fpi_usb_transfer_new (_dev);
|
||||
struct libusb_transfer *transfer = fpi_usb_alloc();
|
||||
unsigned char *data;
|
||||
|
||||
fpi_usb_transfer_fill_bulk (transfer, EP_IN, STRIP_CAPTURE_LEN);
|
||||
transfer->ssm = ssm;
|
||||
transfer->short_is_error = TRUE;
|
||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
||||
capture_read_strip_cb, NULL);
|
||||
data = g_malloc(STRIP_CAPTURE_LEN);
|
||||
libusb_fill_bulk_transfer(transfer, fpi_dev_get_usb_dev(FP_DEV(dev)), EP_IN, data, STRIP_CAPTURE_LEN,
|
||||
capture_read_strip_cb, ssm, BULK_TIMEOUT);
|
||||
|
||||
r = libusb_submit_transfer(transfer);
|
||||
if (r < 0) {
|
||||
g_free(data);
|
||||
libusb_free_transfer(transfer);
|
||||
fpi_ssm_mark_failed(ssm, r);
|
||||
}
|
||||
break;
|
||||
}
|
||||
;
|
||||
};
|
||||
}
|
||||
|
||||
static void
|
||||
capture_sm_complete (FpiSsm *ssm, FpDevice *_dev, GError *error)
|
||||
static void capture_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data)
|
||||
{
|
||||
FpImageDevice *dev = FP_IMAGE_DEVICE (_dev);
|
||||
FpiDeviceAes1610 *self = FPI_DEVICE_AES1610 (_dev);
|
||||
struct fp_img_dev *dev = user_data;
|
||||
struct aes1610_dev *aesdev = FP_INSTANCE_DATA(_dev);
|
||||
|
||||
G_DEBUG_HERE();
|
||||
if (self->deactivating)
|
||||
{
|
||||
if (aesdev->deactivating)
|
||||
complete_deactivation(dev);
|
||||
if (error)
|
||||
g_error_free (error);
|
||||
}
|
||||
else if (error)
|
||||
{
|
||||
fpi_image_device_session_error (dev, error);
|
||||
}
|
||||
else if (fpi_ssm_get_error(ssm))
|
||||
fpi_imgdev_session_error(dev, fpi_ssm_get_error(ssm));
|
||||
else
|
||||
{
|
||||
start_finger_detection(dev);
|
||||
}
|
||||
fpi_ssm_free(ssm);
|
||||
}
|
||||
|
||||
static void
|
||||
start_capture (FpImageDevice *dev)
|
||||
static void start_capture(struct fp_img_dev *dev)
|
||||
{
|
||||
FpiDeviceAes1610 *self = FPI_DEVICE_AES1610 (dev);
|
||||
FpiSsm *ssm;
|
||||
struct aes1610_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
fpi_ssm *ssm;
|
||||
|
||||
if (self->deactivating)
|
||||
{
|
||||
if (aesdev->deactivating) {
|
||||
complete_deactivation(dev);
|
||||
return;
|
||||
}
|
||||
|
||||
ssm = fpi_ssm_new (FP_DEVICE (dev), capture_run_state,
|
||||
CAPTURE_NUM_STATES);
|
||||
ssm = fpi_ssm_new(FP_DEV(dev), capture_run_state, CAPTURE_NUM_STATES, dev);
|
||||
G_DEBUG_HERE();
|
||||
fpi_ssm_start(ssm, capture_sm_complete);
|
||||
}
|
||||
@@ -731,15 +723,13 @@ enum activate_states {
|
||||
ACTIVATE_NUM_STATES,
|
||||
};
|
||||
|
||||
static void
|
||||
activate_run_state (FpiSsm *ssm, FpDevice *_dev)
|
||||
static void activate_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data)
|
||||
{
|
||||
FpImageDevice *dev = FP_IMAGE_DEVICE (_dev);
|
||||
struct fp_img_dev *dev = user_data;
|
||||
|
||||
/* activation on aes1610 seems much more straightforward compared to aes2501 */
|
||||
/* verify there's anything missing here */
|
||||
switch (fpi_ssm_get_cur_state (ssm))
|
||||
{
|
||||
/* verify theres anything missing here */
|
||||
switch (fpi_ssm_get_cur_state(ssm)) {
|
||||
case WRITE_INIT:
|
||||
fp_dbg("write init");
|
||||
aes_write_regv(dev, init, G_N_ELEMENTS(init), generic_write_regv_cb, ssm);
|
||||
@@ -748,110 +738,100 @@ activate_run_state (FpiSsm *ssm, FpDevice *_dev)
|
||||
}
|
||||
|
||||
/* jump to finger detection */
|
||||
static void
|
||||
activate_sm_complete (FpiSsm *ssm, FpDevice *_dev, GError *error)
|
||||
static void activate_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data)
|
||||
{
|
||||
FpImageDevice *dev = FP_IMAGE_DEVICE (_dev);
|
||||
struct fp_img_dev *dev = user_data;
|
||||
fp_dbg("status %d", fpi_ssm_get_error(ssm));
|
||||
fpi_imgdev_activate_complete(dev, fpi_ssm_get_error(ssm));
|
||||
|
||||
fpi_image_device_activate_complete (dev, error);
|
||||
|
||||
if (!error)
|
||||
if (!fpi_ssm_get_error(ssm))
|
||||
start_finger_detection(dev);
|
||||
fpi_ssm_free(ssm);
|
||||
}
|
||||
|
||||
static void
|
||||
dev_activate (FpImageDevice *dev)
|
||||
static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
|
||||
{
|
||||
FpiDeviceAes1610 *self = FPI_DEVICE_AES1610 (dev);
|
||||
FpiSsm *ssm = fpi_ssm_new (FP_DEVICE (dev), activate_run_state,
|
||||
ACTIVATE_NUM_STATES);
|
||||
|
||||
self->read_regs_retry_count = 0;
|
||||
struct aes1610_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
fpi_ssm *ssm = fpi_ssm_new(FP_DEV(dev), activate_run_state,
|
||||
ACTIVATE_NUM_STATES, dev);
|
||||
aesdev->read_regs_retry_count = 0;
|
||||
fpi_ssm_start(ssm, activate_sm_complete);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
dev_deactivate (FpImageDevice *dev)
|
||||
static void dev_deactivate(struct fp_img_dev *dev)
|
||||
{
|
||||
FpiDeviceAes1610 *self = FPI_DEVICE_AES1610 (dev);
|
||||
|
||||
struct aes1610_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
/* FIXME: audit cancellation points, probably need more, specifically
|
||||
* in error handling paths? */
|
||||
self->deactivating = TRUE;
|
||||
aesdev->deactivating = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
complete_deactivation (FpImageDevice *dev)
|
||||
static void complete_deactivation(struct fp_img_dev *dev)
|
||||
{
|
||||
FpiDeviceAes1610 *self = FPI_DEVICE_AES1610 (dev);
|
||||
|
||||
struct aes1610_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
G_DEBUG_HERE();
|
||||
|
||||
/* FIXME: if we're in the middle of a scan, we should cancel the scan.
|
||||
* maybe we can do this with a master reset, unconditionally? */
|
||||
|
||||
self->deactivating = FALSE;
|
||||
g_slist_free (self->strips);
|
||||
self->strips = NULL;
|
||||
self->strips_len = 0;
|
||||
self->blanks_count = 0;
|
||||
fpi_image_device_deactivate_complete (dev, NULL);
|
||||
aesdev->deactivating = FALSE;
|
||||
g_slist_free(aesdev->strips);
|
||||
aesdev->strips = NULL;
|
||||
aesdev->strips_len = 0;
|
||||
aesdev->blanks_count = 0;
|
||||
fpi_imgdev_deactivate_complete(dev);
|
||||
}
|
||||
|
||||
static void
|
||||
dev_init (FpImageDevice *dev)
|
||||
static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
/* FIXME check endpoints */
|
||||
int r;
|
||||
struct aes1610_dev *aesdev;
|
||||
|
||||
if (!g_usb_device_claim_interface (fpi_device_get_usb_device (FP_DEVICE (dev)), 0, 0, &error))
|
||||
r = libusb_claim_interface(fpi_dev_get_usb_dev(FP_DEV(dev)), 0);
|
||||
if (r < 0) {
|
||||
fp_err("could not claim interface 0: %s", libusb_error_name(r));
|
||||
return r;
|
||||
}
|
||||
|
||||
aesdev = g_malloc0(sizeof(struct aes1610_dev));
|
||||
fp_dev_set_instance_data(FP_DEV(dev), aesdev);
|
||||
fpi_imgdev_open_complete(dev, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void dev_deinit(struct fp_img_dev *dev)
|
||||
{
|
||||
fpi_image_device_open_complete (dev, error);
|
||||
return;
|
||||
struct aes1610_dev *aesdev;
|
||||
aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
g_free(aesdev);
|
||||
libusb_release_interface(fpi_dev_get_usb_dev(FP_DEV(dev)), 0);
|
||||
fpi_imgdev_close_complete(dev);
|
||||
}
|
||||
|
||||
fpi_image_device_open_complete (dev, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
dev_deinit (FpImageDevice *dev)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_usb_device_release_interface (fpi_device_get_usb_device (FP_DEVICE (dev)),
|
||||
0, 0, &error);
|
||||
fpi_image_device_close_complete (dev, error);
|
||||
}
|
||||
|
||||
static const FpIdEntry id_table[] = {
|
||||
{ .vid = 0x08ff, .pid = 0x1600, },/* AES1600 */
|
||||
{ .vid = 0, .pid = 0, .driver_data = 0 },
|
||||
static const struct usb_id id_table[] = {
|
||||
{ .vendor = 0x08ff, .product = 0x1600 }, /* AES1600 */
|
||||
{ 0, 0, 0, },
|
||||
};
|
||||
|
||||
static void
|
||||
fpi_device_aes1610_init (FpiDeviceAes1610 *self)
|
||||
{
|
||||
}
|
||||
static void
|
||||
fpi_device_aes1610_class_init (FpiDeviceAes1610Class *klass)
|
||||
{
|
||||
FpDeviceClass *dev_class = FP_DEVICE_CLASS (klass);
|
||||
FpImageDeviceClass *img_class = FP_IMAGE_DEVICE_CLASS (klass);
|
||||
struct fp_img_driver aes1610_driver = {
|
||||
.driver = {
|
||||
.id = AES1610_ID,
|
||||
.name = FP_COMPONENT,
|
||||
.full_name = "AuthenTec AES1610",
|
||||
.id_table = id_table,
|
||||
.scan_type = FP_SCAN_TYPE_SWIPE,
|
||||
},
|
||||
.flags = 0,
|
||||
.img_height = -1,
|
||||
.img_width = IMAGE_WIDTH,
|
||||
|
||||
dev_class->id = "aes1610";
|
||||
dev_class->full_name = "AuthenTec AES1610";
|
||||
dev_class->type = FP_DEVICE_TYPE_USB;
|
||||
dev_class->id_table = id_table;
|
||||
dev_class->scan_type = FP_SCAN_TYPE_SWIPE;
|
||||
.bz3_threshold = 20,
|
||||
|
||||
img_class->img_open = dev_init;
|
||||
img_class->img_close = dev_deinit;
|
||||
img_class->activate = dev_activate;
|
||||
img_class->deactivate = dev_deactivate;
|
||||
.open = dev_init,
|
||||
.close = dev_deinit,
|
||||
.activate = dev_activate,
|
||||
.deactivate = dev_deactivate,
|
||||
};
|
||||
|
||||
img_class->bz3_threshold = 20;
|
||||
|
||||
img_class->img_width = IMAGE_WIDTH;
|
||||
img_class->img_height = -1;
|
||||
}
|
||||
|
||||
@@ -27,14 +27,6 @@
|
||||
#define FRAME_WIDTH 128
|
||||
#define IMAGE_WIDTH (FRAME_WIDTH + (FRAME_WIDTH / 2))
|
||||
|
||||
struct _FpiDeviceAes1660
|
||||
{
|
||||
FpiDeviceAesX660 parent;
|
||||
};
|
||||
G_DECLARE_FINAL_TYPE (FpiDeviceAes1660, fpi_device_aes1660, FPI,
|
||||
DEVICE_AES1660, FpiDeviceAesX660);
|
||||
G_DEFINE_TYPE (FpiDeviceAes1660, fpi_device_aes1660, FPI_TYPE_DEVICE_AES_X660);
|
||||
|
||||
static struct fpi_frame_asmbl_ctx assembling_ctx = {
|
||||
.frame_width = FRAME_WIDTH,
|
||||
.frame_height = AESX660_FRAME_HEIGHT,
|
||||
@@ -42,54 +34,79 @@ static struct fpi_frame_asmbl_ctx assembling_ctx = {
|
||||
.get_pixel = aes_get_pixel,
|
||||
};
|
||||
|
||||
static const FpIdEntry id_table[] = {
|
||||
{ .vid = 0x08ff, .pid = 0x1660, },
|
||||
{ .vid = 0x08ff, .pid = 0x1680, },
|
||||
{ .vid = 0x08ff, .pid = 0x1681, },
|
||||
{ .vid = 0x08ff, .pid = 0x1682, },
|
||||
{ .vid = 0x08ff, .pid = 0x1683, },
|
||||
{ .vid = 0x08ff, .pid = 0x1684, },
|
||||
{ .vid = 0x08ff, .pid = 0x1685, },
|
||||
{ .vid = 0x08ff, .pid = 0x1686, },
|
||||
{ .vid = 0x08ff, .pid = 0x1687, },
|
||||
{ .vid = 0x08ff, .pid = 0x1688, },
|
||||
{ .vid = 0x08ff, .pid = 0x1689, },
|
||||
{ .vid = 0x08ff, .pid = 0x168a, },
|
||||
{ .vid = 0x08ff, .pid = 0x168b, },
|
||||
{ .vid = 0x08ff, .pid = 0x168c, },
|
||||
{ .vid = 0x08ff, .pid = 0x168d, },
|
||||
{ .vid = 0x08ff, .pid = 0x168e, },
|
||||
{ .vid = 0x08ff, .pid = 0x168f, },
|
||||
{ .vid = 0, .pid = 0, .driver_data = 0 },
|
||||
static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
|
||||
{
|
||||
/* TODO check that device has endpoints we're using */
|
||||
int r;
|
||||
struct aesX660_dev *aesdev;
|
||||
|
||||
r = libusb_claim_interface(fpi_dev_get_usb_dev(FP_DEV(dev)), 0);
|
||||
if (r < 0) {
|
||||
fp_err("could not claim interface 0: %s", libusb_error_name(r));
|
||||
return r;
|
||||
}
|
||||
|
||||
aesdev = g_malloc0(sizeof(struct aesX660_dev));
|
||||
fp_dev_set_instance_data(FP_DEV(dev), aesdev);
|
||||
aesdev->buffer = g_malloc0(AES1660_FRAME_SIZE + AESX660_HEADER_SIZE);
|
||||
aesdev->init_seqs[0] = aes1660_init_1;
|
||||
aesdev->init_seqs_len[0] = G_N_ELEMENTS(aes1660_init_1);
|
||||
aesdev->init_seqs[1] = aes1660_init_2;
|
||||
aesdev->init_seqs_len[1] = G_N_ELEMENTS(aes1660_init_2);
|
||||
aesdev->start_imaging_cmd = (unsigned char *)aes1660_start_imaging_cmd;
|
||||
aesdev->start_imaging_cmd_len = sizeof(aes1660_start_imaging_cmd);
|
||||
aesdev->assembling_ctx = &assembling_ctx;
|
||||
aesdev->extra_img_flags = FP_IMG_PARTIAL;
|
||||
|
||||
fpi_imgdev_open_complete(dev, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void dev_deinit(struct fp_img_dev *dev)
|
||||
{
|
||||
struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
g_free(aesdev->buffer);
|
||||
g_free(aesdev);
|
||||
libusb_release_interface(fpi_dev_get_usb_dev(FP_DEV(dev)), 0);
|
||||
fpi_imgdev_close_complete(dev);
|
||||
}
|
||||
|
||||
static const struct usb_id id_table[] = {
|
||||
{ .vendor = 0x08ff, .product = 0x1660 },
|
||||
{ .vendor = 0x08ff, .product = 0x1680 },
|
||||
{ .vendor = 0x08ff, .product = 0x1681 },
|
||||
{ .vendor = 0x08ff, .product = 0x1682 },
|
||||
{ .vendor = 0x08ff, .product = 0x1683 },
|
||||
{ .vendor = 0x08ff, .product = 0x1684 },
|
||||
{ .vendor = 0x08ff, .product = 0x1685 },
|
||||
{ .vendor = 0x08ff, .product = 0x1686 },
|
||||
{ .vendor = 0x08ff, .product = 0x1687 },
|
||||
{ .vendor = 0x08ff, .product = 0x1688 },
|
||||
{ .vendor = 0x08ff, .product = 0x1689 },
|
||||
{ .vendor = 0x08ff, .product = 0x168a },
|
||||
{ .vendor = 0x08ff, .product = 0x168b },
|
||||
{ .vendor = 0x08ff, .product = 0x168c },
|
||||
{ .vendor = 0x08ff, .product = 0x168d },
|
||||
{ .vendor = 0x08ff, .product = 0x168e },
|
||||
{ .vendor = 0x08ff, .product = 0x168f },
|
||||
{ 0, 0, 0, },
|
||||
};
|
||||
|
||||
static void
|
||||
fpi_device_aes1660_init (FpiDeviceAes1660 *self)
|
||||
{
|
||||
}
|
||||
static void
|
||||
fpi_device_aes1660_class_init (FpiDeviceAes1660Class *klass)
|
||||
{
|
||||
FpDeviceClass *dev_class = FP_DEVICE_CLASS (klass);
|
||||
FpImageDeviceClass *img_class = FP_IMAGE_DEVICE_CLASS (klass);
|
||||
FpiDeviceAesX660Class *aes_class = FPI_DEVICE_AES_X660_CLASS (klass);
|
||||
struct fp_img_driver aes1660_driver = {
|
||||
.driver = {
|
||||
.id = AES1660_ID,
|
||||
.name = FP_COMPONENT,
|
||||
.full_name = "AuthenTec AES1660",
|
||||
.id_table = id_table,
|
||||
.scan_type = FP_SCAN_TYPE_SWIPE,
|
||||
},
|
||||
.flags = 0,
|
||||
.img_height = -1,
|
||||
.img_width = FRAME_WIDTH + FRAME_WIDTH / 2,
|
||||
.bz3_threshold = 20,
|
||||
|
||||
dev_class->id = "aes1660";
|
||||
dev_class->full_name = "AuthenTec AES1660";
|
||||
dev_class->type = FP_DEVICE_TYPE_USB;
|
||||
dev_class->id_table = id_table;
|
||||
dev_class->scan_type = FP_SCAN_TYPE_SWIPE;
|
||||
|
||||
img_class->bz3_threshold = 20;
|
||||
|
||||
img_class->img_width = FRAME_WIDTH + FRAME_WIDTH / 2;
|
||||
img_class->img_height = -1;
|
||||
|
||||
aes_class->init_seqs[0] = aes1660_init_1;
|
||||
aes_class->init_seqs_len[0] = G_N_ELEMENTS (aes1660_init_1);
|
||||
aes_class->init_seqs[1] = aes1660_init_2;
|
||||
aes_class->init_seqs_len[1] = G_N_ELEMENTS (aes1660_init_2);
|
||||
aes_class->start_imaging_cmd = (unsigned char *) aes1660_start_imaging_cmd;
|
||||
aes_class->start_imaging_cmd_len = sizeof (aes1660_start_imaging_cmd);
|
||||
aes_class->assembling_ctx = &assembling_ctx;
|
||||
}
|
||||
.open = dev_init,
|
||||
.close = dev_deinit,
|
||||
.activate = aesX660_dev_activate,
|
||||
.deactivate = aesX660_dev_deactivate,
|
||||
};
|
||||
|
||||
@@ -18,12 +18,11 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef __AES1660_H
|
||||
#define __AES1660_H
|
||||
|
||||
#define AES1660_FRAME_SIZE 0x244
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
|
||||
/* First init sequence, 0x07 cmd returns following before INIT1:
|
||||
* { 0x07, 0x05, 0x00, 0x8f, 0x16, 0x25, 0x01, 0x00 }
|
||||
*/
|
||||
@@ -1987,3 +1986,5 @@ static const unsigned char aes1660_start_imaging_cmd[] = {
|
||||
0x55, 0x07, 0x00, 0x80, 0x42, 0x00, 0x7f, 0x00, 0x00, 0x14,
|
||||
0x49, 0x03, 0x00, 0x20, 0x00, 0xc8
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
#include "aeslib.h"
|
||||
#include "aes2501.h"
|
||||
|
||||
static void start_capture (FpImageDevice *dev);
|
||||
static void complete_deactivation (FpImageDevice *dev);
|
||||
static void start_capture(struct fp_img_dev *dev);
|
||||
static void complete_deactivation(struct fp_img_dev *dev);
|
||||
|
||||
/* FIXME these need checking */
|
||||
#define EP_IN (1 | FPI_USB_ENDPOINT_IN)
|
||||
#define EP_OUT (2 | FPI_USB_ENDPOINT_OUT)
|
||||
#define EP_IN (1 | LIBUSB_ENDPOINT_IN)
|
||||
#define EP_OUT (2 | LIBUSB_ENDPOINT_OUT)
|
||||
|
||||
#define BULK_TIMEOUT 4000
|
||||
|
||||
@@ -63,19 +63,13 @@ static void complete_deactivation (FpImageDevice *dev);
|
||||
|
||||
/****** GENERAL FUNCTIONS ******/
|
||||
|
||||
struct _FpiDeviceAes2501
|
||||
{
|
||||
FpImageDevice parent;
|
||||
|
||||
guint8 read_regs_retry_count;
|
||||
struct aes2501_dev {
|
||||
uint8_t read_regs_retry_count;
|
||||
GSList *strips;
|
||||
size_t strips_len;
|
||||
gboolean deactivating;
|
||||
int no_finger_cnt;
|
||||
};
|
||||
G_DECLARE_FINAL_TYPE (FpiDeviceAes2501, fpi_device_aes2501, FPI, DEVICE_AES2501,
|
||||
FpImageDevice);
|
||||
G_DEFINE_TYPE (FpiDeviceAes2501, fpi_device_aes2501, FP_TYPE_IMAGE_DEVICE);
|
||||
|
||||
static struct fpi_frame_asmbl_ctx assembling_ctx = {
|
||||
.frame_width = FRAME_WIDTH,
|
||||
@@ -84,52 +78,72 @@ static struct fpi_frame_asmbl_ctx assembling_ctx = {
|
||||
.get_pixel = aes_get_pixel,
|
||||
};
|
||||
|
||||
typedef void (*aes2501_read_regs_cb)(FpImageDevice *dev,
|
||||
GError *error,
|
||||
unsigned char *regs,
|
||||
void *user_data);
|
||||
typedef void (*aes2501_read_regs_cb)(struct fp_img_dev *dev, int status,
|
||||
unsigned char *regs, void *user_data);
|
||||
|
||||
struct aes2501_read_regs
|
||||
{
|
||||
FpImageDevice *dev;
|
||||
struct aes2501_read_regs {
|
||||
struct fp_img_dev *dev;
|
||||
aes2501_read_regs_cb callback;
|
||||
struct aes_regwrite *regwrite;
|
||||
void *user_data;
|
||||
};
|
||||
|
||||
static void
|
||||
read_regs_data_cb (FpiUsbTransfer *transfer, FpDevice *dev,
|
||||
gpointer user_data, GError *error)
|
||||
static void read_regs_data_cb(struct libusb_transfer *transfer,
|
||||
struct fp_dev *dev,
|
||||
fpi_ssm *ssm,
|
||||
void *user_data)
|
||||
{
|
||||
struct aes2501_read_regs *rdata = user_data;
|
||||
unsigned char *retdata = NULL;
|
||||
int r;
|
||||
|
||||
rdata->callback (rdata->dev, error, transfer->buffer, rdata->user_data);
|
||||
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
|
||||
r = -EIO;
|
||||
} else if (transfer->length != transfer->actual_length) {
|
||||
r = -EPROTO;
|
||||
} else {
|
||||
r = 0;
|
||||
retdata = transfer->buffer;
|
||||
}
|
||||
|
||||
rdata->callback(rdata->dev, r, retdata, rdata->user_data);
|
||||
g_free(rdata);
|
||||
}
|
||||
|
||||
static void
|
||||
read_regs_rq_cb (FpImageDevice *dev, GError *error, void *user_data)
|
||||
static void read_regs_rq_cb(struct fp_img_dev *dev, int result, void *user_data)
|
||||
{
|
||||
struct aes2501_read_regs *rdata = user_data;
|
||||
FpiUsbTransfer *transfer;
|
||||
fpi_usb_transfer *transfer;
|
||||
unsigned char *data;
|
||||
int r;
|
||||
|
||||
g_free(rdata->regwrite);
|
||||
if (error)
|
||||
{
|
||||
rdata->callback (dev, error, NULL, rdata->user_data);
|
||||
g_free (rdata);
|
||||
if (result != 0)
|
||||
goto err;
|
||||
|
||||
data = g_malloc(READ_REGS_LEN);
|
||||
transfer = fpi_usb_fill_bulk_transfer(FP_DEV(dev),
|
||||
NULL,
|
||||
EP_IN,
|
||||
data,
|
||||
READ_REGS_LEN,
|
||||
read_regs_data_cb,
|
||||
rdata,
|
||||
BULK_TIMEOUT);
|
||||
|
||||
r = fpi_usb_submit_transfer(transfer);
|
||||
if (r < 0) {
|
||||
result = -EIO;
|
||||
goto err;
|
||||
}
|
||||
|
||||
return;
|
||||
err:
|
||||
rdata->callback(dev, result, NULL, rdata->user_data);
|
||||
g_free(rdata);
|
||||
}
|
||||
|
||||
transfer = fpi_usb_transfer_new (FP_DEVICE (dev));
|
||||
transfer->short_is_error = TRUE;
|
||||
fpi_usb_transfer_fill_bulk (transfer, EP_IN, READ_REGS_LEN);
|
||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
||||
read_regs_data_cb, rdata);
|
||||
}
|
||||
|
||||
static void
|
||||
read_regs (FpImageDevice *dev, aes2501_read_regs_cb callback,
|
||||
static void read_regs(struct fp_img_dev *dev, aes2501_read_regs_cb callback,
|
||||
void *user_data)
|
||||
{
|
||||
/* FIXME: regwrite is dynamic because of asynchronity. is this really
|
||||
@@ -150,19 +164,16 @@ read_regs (FpImageDevice *dev, aes2501_read_regs_cb callback,
|
||||
}
|
||||
|
||||
/* Read the value of a specific register from a register dump */
|
||||
static int
|
||||
regval_from_dump (unsigned char *data, guint8 target)
|
||||
{
|
||||
if (*data != FIRST_AES2501_REG)
|
||||
static int regval_from_dump(unsigned char *data, uint8_t target)
|
||||
{
|
||||
if (*data != FIRST_AES2501_REG) {
|
||||
fp_err("not a register dump");
|
||||
return -1;
|
||||
return -EILSEQ;
|
||||
}
|
||||
|
||||
if (!(FIRST_AES2501_REG <= target && target <= LAST_AES2501_REG))
|
||||
{
|
||||
if (!(FIRST_AES2501_REG <= target && target <= LAST_AES2501_REG)) {
|
||||
fp_err("out of range");
|
||||
return -1;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
target -= FIRST_AES2501_REG;
|
||||
@@ -170,48 +181,66 @@ regval_from_dump (unsigned char *data, guint8 target)
|
||||
return data[target + 1];
|
||||
}
|
||||
|
||||
static void
|
||||
generic_write_regv_cb (FpImageDevice *dev, GError *error,
|
||||
static void generic_write_regv_cb(struct fp_img_dev *dev, int result,
|
||||
void *user_data)
|
||||
{
|
||||
FpiSsm *ssm = user_data;
|
||||
|
||||
if (!error)
|
||||
fpi_ssm *ssm = user_data;
|
||||
if (result == 0)
|
||||
fpi_ssm_next_state(ssm);
|
||||
else
|
||||
fpi_ssm_mark_failed (ssm, error);
|
||||
fpi_ssm_mark_failed(ssm, result);
|
||||
}
|
||||
|
||||
/* check that read succeeded but ignore all data */
|
||||
static void generic_ignore_data_cb(struct libusb_transfer *transfer,
|
||||
struct fp_dev *dev,
|
||||
fpi_ssm *ssm,
|
||||
void *user_data)
|
||||
{
|
||||
if (transfer->status != LIBUSB_TRANSFER_COMPLETED)
|
||||
fpi_ssm_mark_failed(ssm, -EIO);
|
||||
else if (transfer->length != transfer->actual_length)
|
||||
fpi_ssm_mark_failed(ssm, -EPROTO);
|
||||
else
|
||||
fpi_ssm_next_state(ssm);
|
||||
}
|
||||
|
||||
/* read the specified number of bytes from the IN endpoint but throw them
|
||||
* away, then increment the SSM */
|
||||
static void
|
||||
generic_read_ignore_data (FpiSsm *ssm, FpDevice *dev,
|
||||
size_t bytes)
|
||||
static void generic_read_ignore_data(fpi_ssm *ssm, struct fp_dev *dev, size_t bytes)
|
||||
{
|
||||
FpiUsbTransfer *transfer;
|
||||
fpi_usb_transfer *transfer;
|
||||
unsigned char *data;
|
||||
int r;
|
||||
|
||||
transfer = fpi_usb_transfer_new (dev);
|
||||
transfer->ssm = ssm;
|
||||
transfer->short_is_error = TRUE;
|
||||
fpi_usb_transfer_fill_bulk (transfer, EP_IN, bytes);
|
||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
||||
fpi_ssm_usb_transfer_cb, NULL);
|
||||
data = g_malloc(bytes);
|
||||
transfer = fpi_usb_fill_bulk_transfer(dev,
|
||||
ssm,
|
||||
EP_IN,
|
||||
data,
|
||||
bytes,
|
||||
generic_ignore_data_cb,
|
||||
NULL,
|
||||
BULK_TIMEOUT);
|
||||
|
||||
r = fpi_usb_submit_transfer(transfer);
|
||||
if (r < 0)
|
||||
fpi_ssm_mark_failed(ssm, r);
|
||||
}
|
||||
|
||||
/****** IMAGE PROCESSING ******/
|
||||
|
||||
static int
|
||||
sum_histogram_values (unsigned char *data, guint8 threshold)
|
||||
static int sum_histogram_values(unsigned char *data, uint8_t threshold)
|
||||
{
|
||||
int r = 0;
|
||||
int i;
|
||||
guint16 *histogram = (guint16 *) (data + 1);
|
||||
uint16_t *histogram = (uint16_t *)(data + 1);
|
||||
|
||||
if (*data != 0xde)
|
||||
return -1;
|
||||
return -EILSEQ;
|
||||
|
||||
if (threshold > 0x0f)
|
||||
return -1;
|
||||
return -EINVAL;
|
||||
|
||||
/* FIXME endianness */
|
||||
for (i = threshold; i < 16; i++)
|
||||
@@ -250,67 +279,72 @@ static const struct aes_regwrite finger_det_reqs[] = {
|
||||
{ AES2501_REG_LPONT, AES2501_LPONT_MIN_VALUE },
|
||||
};
|
||||
|
||||
static void start_finger_detection (FpImageDevice *dev);
|
||||
static void start_finger_detection(struct fp_img_dev *dev);
|
||||
|
||||
static void
|
||||
finger_det_data_cb (FpiUsbTransfer *transfer, FpDevice *_dev,
|
||||
gpointer user_data, GError *error)
|
||||
static void finger_det_data_cb(struct libusb_transfer *transfer,
|
||||
struct fp_dev *_dev,
|
||||
fpi_ssm *ssm,
|
||||
void *user_data)
|
||||
{
|
||||
FpImageDevice *dev = FP_IMAGE_DEVICE (_dev);
|
||||
struct fp_img_dev *dev = FP_IMG_DEV(_dev);
|
||||
unsigned char *data = transfer->buffer;
|
||||
int i;
|
||||
int sum = 0;
|
||||
|
||||
if (error)
|
||||
{
|
||||
fpi_image_device_session_error (dev, error);
|
||||
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
|
||||
fpi_imgdev_session_error(dev, -EIO);
|
||||
return;
|
||||
} else if (transfer->length != transfer->actual_length) {
|
||||
fpi_imgdev_session_error(dev, -EPROTO);
|
||||
return;
|
||||
}
|
||||
|
||||
/* examine histogram to determine finger presence */
|
||||
for (i = 1; i < 9; i++)
|
||||
sum += (data[i] & 0xf) + (data[i] >> 4);
|
||||
if (sum > 20)
|
||||
{
|
||||
if (sum > 20) {
|
||||
/* finger present, start capturing */
|
||||
fpi_image_device_report_finger_status (dev, TRUE);
|
||||
fpi_imgdev_report_finger_status(dev, TRUE);
|
||||
start_capture(dev);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
/* no finger, poll for a new histogram */
|
||||
start_finger_detection(dev);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
finger_det_reqs_cb (FpImageDevice *dev, GError *error,
|
||||
static void finger_det_reqs_cb(struct fp_img_dev *dev, int result,
|
||||
void *user_data)
|
||||
{
|
||||
FpiUsbTransfer *transfer;
|
||||
fpi_usb_transfer *transfer;
|
||||
unsigned char *data;
|
||||
int r;
|
||||
|
||||
if (error)
|
||||
{
|
||||
fpi_image_device_session_error (dev, error);
|
||||
if (result) {
|
||||
fpi_imgdev_session_error(dev, result);
|
||||
return;
|
||||
}
|
||||
|
||||
transfer = fpi_usb_transfer_new (FP_DEVICE (dev));
|
||||
transfer->short_is_error = TRUE;
|
||||
fpi_usb_transfer_fill_bulk (transfer, EP_IN, FINGER_DETECTION_LEN);
|
||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
||||
finger_det_data_cb, NULL);
|
||||
data = g_malloc(FINGER_DETECTION_LEN);
|
||||
transfer = fpi_usb_fill_bulk_transfer(FP_DEV(dev),
|
||||
NULL,
|
||||
EP_IN,
|
||||
data,
|
||||
FINGER_DETECTION_LEN,
|
||||
finger_det_data_cb,
|
||||
NULL,
|
||||
BULK_TIMEOUT);
|
||||
|
||||
r = fpi_usb_submit_transfer(transfer);
|
||||
if (r < 0)
|
||||
fpi_imgdev_session_error(dev, r);
|
||||
}
|
||||
|
||||
static void
|
||||
start_finger_detection (FpImageDevice *dev)
|
||||
static void start_finger_detection(struct fp_img_dev *dev)
|
||||
{
|
||||
FpiDeviceAes2501 *self = FPI_DEVICE_AES2501 (dev);
|
||||
|
||||
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
G_DEBUG_HERE();
|
||||
|
||||
if (self->deactivating)
|
||||
{
|
||||
if (aesdev->deactivating) {
|
||||
complete_deactivation(dev);
|
||||
return;
|
||||
}
|
||||
@@ -381,7 +415,7 @@ static struct aes_regwrite strip_scan_reqs[] = {
|
||||
/* capture SM movement:
|
||||
* write reqs and read data 1 + 2,
|
||||
* request and read strip,
|
||||
* jump back to request UNLESS there's no finger, in which case exit SM,
|
||||
* jump back to request UNLESS theres no finger, in which case exit SM,
|
||||
* report lack of finger presence, and move to finger detection */
|
||||
|
||||
enum capture_states {
|
||||
@@ -394,50 +428,45 @@ enum capture_states {
|
||||
CAPTURE_NUM_STATES,
|
||||
};
|
||||
|
||||
static void
|
||||
capture_read_strip_cb (FpiUsbTransfer *transfer, FpDevice *_dev,
|
||||
gpointer user_data, GError *error)
|
||||
static void capture_read_strip_cb(struct libusb_transfer *transfer,
|
||||
struct fp_dev *_dev,
|
||||
fpi_ssm *ssm,
|
||||
void *user_data)
|
||||
{
|
||||
FpiSsm *ssm = transfer->ssm;
|
||||
unsigned char *stripdata;
|
||||
FpImageDevice *dev = FP_IMAGE_DEVICE (_dev);
|
||||
FpiDeviceAes2501 *self = FPI_DEVICE_AES2501 (_dev);
|
||||
struct fp_img_dev *dev = FP_IMG_DEV(_dev);
|
||||
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(_dev);
|
||||
unsigned char *data = transfer->buffer;
|
||||
int sum;
|
||||
int threshold;
|
||||
|
||||
if (error)
|
||||
{
|
||||
fpi_ssm_mark_failed (ssm, error);
|
||||
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
|
||||
fpi_ssm_mark_failed(ssm, -EIO);
|
||||
return;
|
||||
} else if (transfer->length != transfer->actual_length) {
|
||||
fpi_ssm_mark_failed(ssm, -EPROTO);
|
||||
return;
|
||||
}
|
||||
|
||||
threshold = regval_from_dump(data + 1 + 192*8 + 1 + 16*2 + 1 + 8,
|
||||
AES2501_REG_DATFMT);
|
||||
if (threshold < 0)
|
||||
{
|
||||
fpi_ssm_mark_failed (ssm,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_PROTO));
|
||||
if (threshold < 0) {
|
||||
fpi_ssm_mark_failed(ssm, threshold);
|
||||
return;
|
||||
}
|
||||
|
||||
sum = sum_histogram_values(data + 1 + 192*8, threshold & 0x0f);
|
||||
if (sum < 0)
|
||||
{
|
||||
fpi_ssm_mark_failed (ssm,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_PROTO));
|
||||
if (sum < 0) {
|
||||
fpi_ssm_mark_failed(ssm, sum);
|
||||
return;
|
||||
}
|
||||
fp_dbg("sum=%d", sum);
|
||||
|
||||
if (sum < AES2501_SUM_LOW_THRESH)
|
||||
{
|
||||
if (sum < AES2501_SUM_LOW_THRESH) {
|
||||
strip_scan_reqs[4].value -= 0x8;
|
||||
if (strip_scan_reqs[4].value < AES2501_ADREFHI_MIN_VALUE)
|
||||
strip_scan_reqs[4].value = AES2501_ADREFHI_MIN_VALUE;
|
||||
}
|
||||
else if (sum > AES2501_SUM_HIGH_THRESH)
|
||||
{
|
||||
} else if (sum > AES2501_SUM_HIGH_THRESH) {
|
||||
strip_scan_reqs[4].value += 0x8;
|
||||
if (strip_scan_reqs[4].value > AES2501_ADREFHI_MAX_VALUE)
|
||||
strip_scan_reqs[4].value = AES2501_ADREFHI_MAX_VALUE;
|
||||
@@ -447,33 +476,28 @@ capture_read_strip_cb (FpiUsbTransfer *transfer, FpDevice *_dev,
|
||||
/* Sum is 0, maybe finger was removed? Wait for 3 empty frames
|
||||
* to ensure
|
||||
*/
|
||||
if (sum == 0)
|
||||
{
|
||||
self->no_finger_cnt++;
|
||||
if (self->no_finger_cnt == 3)
|
||||
{
|
||||
FpImage *img;
|
||||
if (sum == 0) {
|
||||
aesdev->no_finger_cnt++;
|
||||
if (aesdev->no_finger_cnt == 3) {
|
||||
struct fp_img *img;
|
||||
|
||||
self->strips = g_slist_reverse (self->strips);
|
||||
fpi_do_movement_estimation (&assembling_ctx, self->strips);
|
||||
aesdev->strips = g_slist_reverse(aesdev->strips);
|
||||
fpi_do_movement_estimation(&assembling_ctx,
|
||||
aesdev->strips, aesdev->strips_len);
|
||||
img = fpi_assemble_frames(&assembling_ctx,
|
||||
self->strips);
|
||||
img->flags |= FPI_IMAGE_PARTIAL;
|
||||
g_slist_free_full (self->strips, g_free);
|
||||
self->strips = NULL;
|
||||
self->strips_len = 0;
|
||||
fpi_image_device_image_captured (dev, img);
|
||||
fpi_image_device_report_finger_status (dev, FALSE);
|
||||
aesdev->strips, aesdev->strips_len);
|
||||
img->flags |= FP_IMG_PARTIAL;
|
||||
g_slist_free_full(aesdev->strips, g_free);
|
||||
aesdev->strips = NULL;
|
||||
aesdev->strips_len = 0;
|
||||
fpi_imgdev_image_captured(dev, img);
|
||||
fpi_imgdev_report_finger_status(dev, FALSE);
|
||||
/* marking machine complete will re-trigger finger detection loop */
|
||||
fpi_ssm_mark_completed(ssm);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
fpi_ssm_jump_to_state(ssm, CAPTURE_REQUEST_STRIP);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
/* obtain next strip */
|
||||
/* FIXME: would preallocating strip buffers be a decent optimization? */
|
||||
struct fpi_frame *stripe = g_malloc(FRAME_WIDTH * FRAME_HEIGHT / 2 + sizeof(struct fpi_frame));
|
||||
@@ -481,103 +505,92 @@ capture_read_strip_cb (FpiUsbTransfer *transfer, FpDevice *_dev,
|
||||
stripe->delta_y = 0;
|
||||
stripdata = stripe->data;
|
||||
memcpy(stripdata, data + 1, 192*8);
|
||||
self->no_finger_cnt = 0;
|
||||
self->strips = g_slist_prepend (self->strips, stripe);
|
||||
self->strips_len++;
|
||||
aesdev->no_finger_cnt = 0;
|
||||
aesdev->strips = g_slist_prepend(aesdev->strips, stripe);
|
||||
aesdev->strips_len++;
|
||||
|
||||
fpi_ssm_jump_to_state(ssm, CAPTURE_REQUEST_STRIP);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
capture_run_state (FpiSsm *ssm, FpDevice *device)
|
||||
static void capture_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data)
|
||||
{
|
||||
FpImageDevice *dev = FP_IMAGE_DEVICE (device);
|
||||
FpiDeviceAes2501 *self = FPI_DEVICE_AES2501 (device);
|
||||
struct fp_img_dev *dev = user_data;
|
||||
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(_dev);
|
||||
int r;
|
||||
|
||||
switch (fpi_ssm_get_cur_state (ssm))
|
||||
{
|
||||
switch (fpi_ssm_get_cur_state(ssm)) {
|
||||
case CAPTURE_WRITE_REQS_1:
|
||||
aes_write_regv(dev, capture_reqs_1, G_N_ELEMENTS(capture_reqs_1),
|
||||
generic_write_regv_cb, ssm);
|
||||
break;
|
||||
|
||||
case CAPTURE_READ_DATA_1:
|
||||
generic_read_ignore_data (ssm, device, READ_REGS_RESP_LEN);
|
||||
generic_read_ignore_data(ssm, _dev, READ_REGS_RESP_LEN);
|
||||
break;
|
||||
|
||||
case CAPTURE_WRITE_REQS_2:
|
||||
aes_write_regv(dev, capture_reqs_2, G_N_ELEMENTS(capture_reqs_2),
|
||||
generic_write_regv_cb, ssm);
|
||||
break;
|
||||
|
||||
case CAPTURE_READ_DATA_2:
|
||||
generic_read_ignore_data (ssm, device, READ_REGS_RESP_LEN);
|
||||
generic_read_ignore_data(ssm, _dev, READ_REGS_RESP_LEN);
|
||||
break;
|
||||
|
||||
case CAPTURE_REQUEST_STRIP:
|
||||
if (self->deactivating)
|
||||
if (aesdev->deactivating)
|
||||
fpi_ssm_mark_completed(ssm);
|
||||
else
|
||||
aes_write_regv(dev, strip_scan_reqs, G_N_ELEMENTS(strip_scan_reqs),
|
||||
generic_write_regv_cb, ssm);
|
||||
break;
|
||||
case CAPTURE_READ_STRIP: ;
|
||||
fpi_usb_transfer *transfer;
|
||||
unsigned char *data;
|
||||
|
||||
case CAPTURE_READ_STRIP: {
|
||||
FpiUsbTransfer *transfer;
|
||||
data = g_malloc(STRIP_CAPTURE_LEN);
|
||||
transfer = fpi_usb_fill_bulk_transfer(FP_DEV(dev),
|
||||
ssm,
|
||||
EP_IN,
|
||||
data,
|
||||
STRIP_CAPTURE_LEN,
|
||||
capture_read_strip_cb,
|
||||
NULL,
|
||||
BULK_TIMEOUT);
|
||||
|
||||
transfer = fpi_usb_transfer_new (device);
|
||||
transfer->ssm = ssm;
|
||||
transfer->short_is_error = TRUE;
|
||||
fpi_usb_transfer_fill_bulk (transfer, EP_IN, STRIP_CAPTURE_LEN);
|
||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
||||
capture_read_strip_cb, NULL);
|
||||
r = fpi_usb_submit_transfer(transfer);
|
||||
if (r < 0)
|
||||
fpi_ssm_mark_failed(ssm, r);
|
||||
break;
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
}
|
||||
|
||||
static void
|
||||
capture_sm_complete (FpiSsm *ssm, FpDevice *_dev, GError *error)
|
||||
static void capture_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data)
|
||||
{
|
||||
FpImageDevice *dev = FP_IMAGE_DEVICE (_dev);
|
||||
FpiDeviceAes2501 *self = FPI_DEVICE_AES2501 (_dev);
|
||||
struct fp_img_dev *dev = user_data;
|
||||
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(_dev);
|
||||
|
||||
G_DEBUG_HERE();
|
||||
|
||||
if (self->deactivating)
|
||||
{
|
||||
if (aesdev->deactivating)
|
||||
complete_deactivation(dev);
|
||||
g_clear_pointer (&error, g_error_free);
|
||||
}
|
||||
else if (error)
|
||||
{
|
||||
fpi_image_device_session_error (dev, error);
|
||||
}
|
||||
else if (fpi_ssm_get_error(ssm))
|
||||
fpi_imgdev_session_error(dev, fpi_ssm_get_error(ssm));
|
||||
else
|
||||
{
|
||||
start_finger_detection(dev);
|
||||
}
|
||||
fpi_ssm_free(ssm);
|
||||
}
|
||||
|
||||
static void
|
||||
start_capture (FpImageDevice *dev)
|
||||
static void start_capture(struct fp_img_dev *dev)
|
||||
{
|
||||
FpiDeviceAes2501 *self = FPI_DEVICE_AES2501 (dev);
|
||||
FpiSsm *ssm;
|
||||
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
fpi_ssm *ssm;
|
||||
|
||||
if (self->deactivating)
|
||||
{
|
||||
if (aesdev->deactivating) {
|
||||
complete_deactivation(dev);
|
||||
return;
|
||||
}
|
||||
|
||||
self->no_finger_cnt = 0;
|
||||
aesdev->no_finger_cnt = 0;
|
||||
/* Reset gain */
|
||||
strip_scan_reqs[4].value = AES2501_ADREFHI_MAX_VALUE;
|
||||
ssm = fpi_ssm_new (FP_DEVICE (dev), capture_run_state,
|
||||
CAPTURE_NUM_STATES);
|
||||
ssm = fpi_ssm_new(FP_DEV(dev), capture_run_state, CAPTURE_NUM_STATES, dev);
|
||||
G_DEBUG_HERE();
|
||||
fpi_ssm_start(ssm, capture_sm_complete);
|
||||
}
|
||||
@@ -687,43 +700,36 @@ enum activate_states {
|
||||
ACTIVATE_NUM_STATES,
|
||||
};
|
||||
|
||||
static void
|
||||
activate_read_regs_cb (FpImageDevice *dev, GError *error,
|
||||
void activate_read_regs_cb(struct fp_img_dev *dev, int status,
|
||||
unsigned char *regs, void *user_data)
|
||||
{
|
||||
FpiSsm *ssm = user_data;
|
||||
FpiDeviceAes2501 *self = FPI_DEVICE_AES2501 (dev);
|
||||
fpi_ssm *ssm = user_data;
|
||||
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
|
||||
if (error)
|
||||
{
|
||||
fpi_ssm_mark_failed (ssm, error);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (status != 0) {
|
||||
fpi_ssm_mark_failed(ssm, status);
|
||||
} else {
|
||||
fp_dbg("reg 0xaf = %x", regs[0x5f]);
|
||||
if (regs[0x5f] != 0x6b || ++self->read_regs_retry_count == 13)
|
||||
if (regs[0x5f] != 0x6b || ++aesdev->read_regs_retry_count == 13)
|
||||
fpi_ssm_jump_to_state(ssm, WRITE_INIT_4);
|
||||
else
|
||||
fpi_ssm_next_state(ssm);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
activate_init3_cb (FpImageDevice *dev, GError *error,
|
||||
static void activate_init3_cb(struct fp_img_dev *dev, int result,
|
||||
void *user_data)
|
||||
{
|
||||
FpiSsm *ssm = user_data;
|
||||
|
||||
if (!error)
|
||||
fpi_ssm *ssm = user_data;
|
||||
if (result == 0)
|
||||
fpi_ssm_jump_to_state(ssm, READ_REGS);
|
||||
else
|
||||
fpi_ssm_mark_failed (ssm, error);
|
||||
fpi_ssm_mark_failed(ssm, result);
|
||||
}
|
||||
|
||||
static void
|
||||
activate_run_state (FpiSsm *ssm, FpDevice *_dev)
|
||||
static void activate_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data)
|
||||
{
|
||||
FpImageDevice *dev = FP_IMAGE_DEVICE (_dev);
|
||||
struct fp_img_dev *dev = user_data;
|
||||
|
||||
/* This state machine isn't as linear as it may appear. After doing init1
|
||||
* and init2 register configuration writes, we have to poll a register
|
||||
@@ -744,37 +750,30 @@ activate_run_state (FpiSsm *ssm, FpDevice *_dev)
|
||||
aes_write_regv(init_4);
|
||||
*/
|
||||
|
||||
switch (fpi_ssm_get_cur_state (ssm))
|
||||
{
|
||||
switch (fpi_ssm_get_cur_state(ssm)) {
|
||||
case WRITE_INIT_1:
|
||||
aes_write_regv(dev, init_1, G_N_ELEMENTS(init_1),
|
||||
generic_write_regv_cb, ssm);
|
||||
break;
|
||||
|
||||
case READ_DATA_1:
|
||||
fp_dbg("read data 1");
|
||||
generic_read_ignore_data(ssm, _dev, FINGER_DETECTION_LEN);
|
||||
break;
|
||||
|
||||
case WRITE_INIT_2:
|
||||
aes_write_regv(dev, init_2, G_N_ELEMENTS(init_2),
|
||||
generic_write_regv_cb, ssm);
|
||||
break;
|
||||
|
||||
case READ_REGS:
|
||||
read_regs(dev, activate_read_regs_cb, ssm);
|
||||
break;
|
||||
|
||||
case WRITE_INIT_3:
|
||||
aes_write_regv(dev, init_3, G_N_ELEMENTS(init_3),
|
||||
activate_init3_cb, ssm);
|
||||
break;
|
||||
|
||||
case WRITE_INIT_4:
|
||||
aes_write_regv(dev, init_4, G_N_ELEMENTS(init_4),
|
||||
generic_write_regv_cb, ssm);
|
||||
break;
|
||||
|
||||
case WRITE_INIT_5:
|
||||
aes_write_regv(dev, init_5, G_N_ELEMENTS(init_5),
|
||||
generic_write_regv_cb, ssm);
|
||||
@@ -782,101 +781,97 @@ activate_run_state (FpiSsm *ssm, FpDevice *_dev)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
activate_sm_complete (FpiSsm *ssm, FpDevice *dev, GError *error)
|
||||
static void activate_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data)
|
||||
{
|
||||
fpi_image_device_activate_complete (FP_IMAGE_DEVICE (dev), error);
|
||||
struct fp_img_dev *dev = user_data;
|
||||
fp_dbg("status %d", fpi_ssm_get_error(ssm));
|
||||
fpi_imgdev_activate_complete(dev, fpi_ssm_get_error(ssm));
|
||||
|
||||
if (!error)
|
||||
start_finger_detection (FP_IMAGE_DEVICE (dev));
|
||||
if (!fpi_ssm_get_error(ssm))
|
||||
start_finger_detection(dev);
|
||||
fpi_ssm_free(ssm);
|
||||
}
|
||||
|
||||
static void
|
||||
dev_activate (FpImageDevice *dev)
|
||||
static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
|
||||
{
|
||||
FpiDeviceAes2501 *self = FPI_DEVICE_AES2501 (dev);
|
||||
FpiSsm *ssm = fpi_ssm_new (FP_DEVICE (dev), activate_run_state,
|
||||
ACTIVATE_NUM_STATES);
|
||||
|
||||
self->read_regs_retry_count = 0;
|
||||
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
fpi_ssm *ssm = fpi_ssm_new(FP_DEV(dev), activate_run_state,
|
||||
ACTIVATE_NUM_STATES, dev);
|
||||
aesdev->read_regs_retry_count = 0;
|
||||
fpi_ssm_start(ssm, activate_sm_complete);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
dev_deactivate (FpImageDevice *dev)
|
||||
static void dev_deactivate(struct fp_img_dev *dev)
|
||||
{
|
||||
FpiDeviceAes2501 *self = FPI_DEVICE_AES2501 (dev);
|
||||
|
||||
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
/* FIXME: audit cancellation points, probably need more, specifically
|
||||
* in error handling paths? */
|
||||
self->deactivating = TRUE;
|
||||
aesdev->deactivating = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
complete_deactivation (FpImageDevice *dev)
|
||||
static void complete_deactivation(struct fp_img_dev *dev)
|
||||
{
|
||||
FpiDeviceAes2501 *self = FPI_DEVICE_AES2501 (dev);
|
||||
|
||||
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
G_DEBUG_HERE();
|
||||
|
||||
/* FIXME: if we're in the middle of a scan, we should cancel the scan.
|
||||
* maybe we can do this with a master reset, unconditionally? */
|
||||
|
||||
self->deactivating = FALSE;
|
||||
g_slist_free (self->strips);
|
||||
self->strips = NULL;
|
||||
self->strips_len = 0;
|
||||
fpi_image_device_deactivate_complete (dev, NULL);
|
||||
aesdev->deactivating = FALSE;
|
||||
g_slist_free(aesdev->strips);
|
||||
aesdev->strips = NULL;
|
||||
aesdev->strips_len = 0;
|
||||
fpi_imgdev_deactivate_complete(dev);
|
||||
}
|
||||
|
||||
static void
|
||||
dev_init (FpImageDevice *dev)
|
||||
static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
/* FIXME check endpoints */
|
||||
int r;
|
||||
struct aes2501_dev *aesdev;
|
||||
|
||||
g_usb_device_claim_interface (fpi_device_get_usb_device (FP_DEVICE (dev)), 0, 0, &error);
|
||||
fpi_image_device_open_complete (dev, error);
|
||||
r = libusb_claim_interface(fpi_dev_get_usb_dev(FP_DEV(dev)), 0);
|
||||
if (r < 0) {
|
||||
fp_err("could not claim interface 0: %s", libusb_error_name(r));
|
||||
return r;
|
||||
}
|
||||
|
||||
static void
|
||||
dev_deinit (FpImageDevice *dev)
|
||||
aesdev = g_malloc0(sizeof(struct aes2501_dev));
|
||||
fp_dev_set_instance_data(FP_DEV(dev), aesdev);
|
||||
fpi_imgdev_open_complete(dev, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void dev_deinit(struct fp_img_dev *dev)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_usb_device_release_interface (fpi_device_get_usb_device (FP_DEVICE (dev)),
|
||||
0, 0, &error);
|
||||
fpi_image_device_close_complete (dev, error);
|
||||
struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
g_free(aesdev);
|
||||
libusb_release_interface(fpi_dev_get_usb_dev(FP_DEV(dev)), 0);
|
||||
fpi_imgdev_close_complete(dev);
|
||||
}
|
||||
|
||||
static const FpIdEntry id_table[] = {
|
||||
{ .vid = 0x08ff, .pid = 0x2500, },/* AES2500 */
|
||||
{ .vid = 0x08ff, .pid = 0x2580, },/* AES2501 */
|
||||
{ .vid = 0, .pid = 0, .driver_data = 0 },
|
||||
static const struct usb_id id_table[] = {
|
||||
{ .vendor = 0x08ff, .product = 0x2500 }, /* AES2500 */
|
||||
{ .vendor = 0x08ff, .product = 0x2580 }, /* AES2501 */
|
||||
{ 0, 0, 0, },
|
||||
};
|
||||
|
||||
static void
|
||||
fpi_device_aes2501_init (FpiDeviceAes2501 *self)
|
||||
{
|
||||
}
|
||||
static void
|
||||
fpi_device_aes2501_class_init (FpiDeviceAes2501Class *klass)
|
||||
{
|
||||
FpDeviceClass *dev_class = FP_DEVICE_CLASS (klass);
|
||||
FpImageDeviceClass *img_class = FP_IMAGE_DEVICE_CLASS (klass);
|
||||
struct fp_img_driver aes2501_driver = {
|
||||
.driver = {
|
||||
.id = AES2501_ID,
|
||||
.name = FP_COMPONENT,
|
||||
.full_name = "AuthenTec AES2501",
|
||||
.id_table = id_table,
|
||||
.scan_type = FP_SCAN_TYPE_SWIPE,
|
||||
},
|
||||
.flags = 0,
|
||||
.img_height = -1,
|
||||
.img_width = IMAGE_WIDTH,
|
||||
|
||||
dev_class->id = "aes2501";
|
||||
dev_class->full_name = "AuthenTec AES2501";
|
||||
dev_class->type = FP_DEVICE_TYPE_USB;
|
||||
dev_class->id_table = id_table;
|
||||
dev_class->scan_type = FP_SCAN_TYPE_SWIPE;
|
||||
.open = dev_init,
|
||||
.close = dev_deinit,
|
||||
.activate = dev_activate,
|
||||
.deactivate = dev_deactivate,
|
||||
};
|
||||
|
||||
img_class->img_open = dev_init;
|
||||
img_class->img_close = dev_deinit;
|
||||
img_class->activate = dev_activate;
|
||||
img_class->deactivate = dev_deactivate;
|
||||
|
||||
img_class->img_width = IMAGE_WIDTH;
|
||||
img_class->img_height = -1;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef __AES2501_H
|
||||
#define __AES2501_H
|
||||
|
||||
enum aes2501_regs {
|
||||
AES2501_REG_CTRL1 = 0x80,
|
||||
@@ -108,7 +109,7 @@ enum aes2501_mesure_drive {
|
||||
|
||||
/* Select (1=square | 0=sine) wave drive during measure */
|
||||
#define AES2501_MEASDRV_SQUARE 0x20
|
||||
/* 0 = use measure drive setting, 1 = when sine wave is selected */
|
||||
/* 0 = use mesure drive setting, 1 = when sine wave is selected */
|
||||
#define AES2501_MEASDRV_MEASURE_SQUARE 0x10
|
||||
|
||||
enum aes2501_measure_freq {
|
||||
@@ -171,3 +172,5 @@ enum aes2501_sensor_gain2 {
|
||||
|
||||
#define AES2501_SUM_HIGH_THRESH 1000
|
||||
#define AES2501_SUM_LOW_THRESH 700
|
||||
|
||||
#endif /* __AES2501_H */
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
#include "aes2550.h"
|
||||
#include "aeslib.h"
|
||||
|
||||
static void start_capture (FpImageDevice *dev);
|
||||
static void complete_deactivation (FpImageDevice *dev);
|
||||
static void start_capture(struct fp_img_dev *dev);
|
||||
static void complete_deactivation(struct fp_img_dev *dev);
|
||||
|
||||
#define EP_IN (1 | FPI_USB_ENDPOINT_IN)
|
||||
#define EP_OUT (2 | FPI_USB_ENDPOINT_OUT)
|
||||
#define EP_IN (1 | LIBUSB_ENDPOINT_IN)
|
||||
#define EP_OUT (2 | LIBUSB_ENDPOINT_OUT)
|
||||
#define BULK_TIMEOUT 4000
|
||||
|
||||
/*
|
||||
@@ -51,18 +51,12 @@ static void complete_deactivation (FpImageDevice *dev);
|
||||
#define FRAME_SIZE (FRAME_WIDTH * FRAME_HEIGHT)
|
||||
#define IMAGE_WIDTH (FRAME_WIDTH + (FRAME_WIDTH / 2))
|
||||
|
||||
struct _FpiDeviceAes2550
|
||||
{
|
||||
FpImageDevice parent;
|
||||
|
||||
struct aes2550_dev {
|
||||
GSList *strips;
|
||||
size_t strips_len;
|
||||
gboolean deactivating;
|
||||
int heartbeat_cnt;
|
||||
};
|
||||
G_DECLARE_FINAL_TYPE (FpiDeviceAes2550, fpi_device_aes2550, FPI, DEVICE_AES2550,
|
||||
FpImageDevice);
|
||||
G_DEFINE_TYPE (FpiDeviceAes2550, fpi_device_aes2550, FP_TYPE_IMAGE_DEVICE);
|
||||
|
||||
static struct fpi_frame_asmbl_ctx assembling_ctx = {
|
||||
.frame_width = FRAME_WIDTH,
|
||||
@@ -84,78 +78,89 @@ static unsigned char finger_det_reqs[] = {
|
||||
AES2550_CMD_RUN_FD,
|
||||
};
|
||||
|
||||
static void start_finger_detection (FpImageDevice *dev);
|
||||
static void start_finger_detection(struct fp_img_dev *dev);
|
||||
|
||||
static void
|
||||
finger_det_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
gpointer user_data, GError *error)
|
||||
static void finger_det_data_cb(struct libusb_transfer *transfer)
|
||||
{
|
||||
FpImageDevice *dev = FP_IMAGE_DEVICE (device);
|
||||
struct fp_img_dev *dev = transfer->user_data;
|
||||
unsigned char *data = transfer->buffer;
|
||||
|
||||
if (error)
|
||||
{
|
||||
fpi_image_device_session_error (FP_IMAGE_DEVICE (device), error);
|
||||
return;
|
||||
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
|
||||
fp_dbg("data transfer status %d\n", transfer->status);
|
||||
fpi_imgdev_session_error(dev, -EIO);
|
||||
goto out;
|
||||
}
|
||||
|
||||
fp_dbg("transfer completed, len: %.4x, data: %.2x %.2x",
|
||||
(gint) transfer->actual_length, (int) data[0], (int) data[1]);
|
||||
transfer->actual_length, (int)data[0], (int)data[1]);
|
||||
|
||||
/* Check if we got 2 bytes, reg address 0x83 and its value */
|
||||
if ((transfer->actual_length >= 2) && (data[0] == 0x83) && (data[1] & AES2550_REG83_FINGER_PRESENT))
|
||||
{
|
||||
if ((transfer->actual_length >= 2) && (data[0] == 0x83) && (data[1] & AES2550_REG83_FINGER_PRESENT)) {
|
||||
/* finger present, start capturing */
|
||||
fpi_image_device_report_finger_status (dev, TRUE);
|
||||
fpi_imgdev_report_finger_status(dev, TRUE);
|
||||
start_capture(dev);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
/* no finger, poll for a new histogram */
|
||||
start_finger_detection(dev);
|
||||
}
|
||||
out:
|
||||
g_free(data);
|
||||
libusb_free_transfer(transfer);
|
||||
}
|
||||
|
||||
static void
|
||||
finger_det_reqs_cb (FpiUsbTransfer *t, FpDevice *device,
|
||||
gpointer user_data, GError *error)
|
||||
static void finger_det_reqs_cb(struct libusb_transfer *t)
|
||||
{
|
||||
FpiUsbTransfer *transfer;
|
||||
FpImageDevice *dev = FP_IMAGE_DEVICE (device);
|
||||
struct libusb_transfer *transfer;
|
||||
unsigned char *data;
|
||||
int r;
|
||||
struct fp_img_dev *dev = t->user_data;
|
||||
|
||||
if (error)
|
||||
{
|
||||
fpi_image_device_session_error (dev, error);
|
||||
return;
|
||||
if (t->status != LIBUSB_TRANSFER_COMPLETED) {
|
||||
fp_dbg("req transfer status %d\n", t->status);
|
||||
fpi_imgdev_session_error(dev, -EIO);
|
||||
goto exit_free_transfer;
|
||||
} else if (t->length != t->actual_length) {
|
||||
fp_dbg("expected %d, got %d bytes", t->length, t->actual_length);
|
||||
fpi_imgdev_session_error(dev, -EPROTO);
|
||||
goto exit_free_transfer;
|
||||
}
|
||||
|
||||
transfer = fpi_usb_transfer_new (device);
|
||||
transfer = fpi_usb_alloc();
|
||||
/* 2 bytes of result */
|
||||
fpi_usb_transfer_fill_bulk (transfer, EP_IN, AES2550_EP_IN_BUF_SIZE);
|
||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
||||
finger_det_data_cb, NULL);
|
||||
data = g_malloc(AES2550_EP_IN_BUF_SIZE);
|
||||
libusb_fill_bulk_transfer(transfer, fpi_dev_get_usb_dev(FP_DEV(dev)), EP_IN, data, AES2550_EP_IN_BUF_SIZE,
|
||||
finger_det_data_cb, dev, BULK_TIMEOUT);
|
||||
|
||||
r = libusb_submit_transfer(transfer);
|
||||
if (r < 0) {
|
||||
g_free(data);
|
||||
libusb_free_transfer(transfer);
|
||||
fpi_imgdev_session_error(dev, r);
|
||||
}
|
||||
exit_free_transfer:
|
||||
libusb_free_transfer(t);
|
||||
}
|
||||
|
||||
static void
|
||||
start_finger_detection (FpImageDevice *dev)
|
||||
static void start_finger_detection(struct fp_img_dev *dev)
|
||||
{
|
||||
FpiDeviceAes2550 *self = FPI_DEVICE_AES2550 (dev);
|
||||
FpiUsbTransfer *transfer;
|
||||
|
||||
int r;
|
||||
struct aes2550_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
struct libusb_transfer *transfer;
|
||||
G_DEBUG_HERE();
|
||||
|
||||
if (self->deactivating)
|
||||
{
|
||||
if (aesdev->deactivating) {
|
||||
complete_deactivation(dev);
|
||||
return;
|
||||
}
|
||||
|
||||
transfer = fpi_usb_transfer_new (FP_DEVICE (dev));
|
||||
transfer->short_is_error = TRUE;
|
||||
fpi_usb_transfer_fill_bulk_full (transfer, EP_OUT, finger_det_reqs,
|
||||
sizeof (finger_det_reqs), NULL);
|
||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
||||
finger_det_reqs_cb, NULL);
|
||||
transfer = fpi_usb_alloc();
|
||||
libusb_fill_bulk_transfer(transfer, fpi_dev_get_usb_dev(FP_DEV(dev)), EP_OUT, finger_det_reqs,
|
||||
sizeof(finger_det_reqs), finger_det_reqs_cb, dev, BULK_TIMEOUT);
|
||||
r = libusb_submit_transfer(transfer);
|
||||
if (r < 0) {
|
||||
libusb_free_transfer(transfer);
|
||||
fpi_imgdev_session_error(dev, r);
|
||||
}
|
||||
}
|
||||
|
||||
/****** CAPTURE ******/
|
||||
@@ -186,213 +191,207 @@ enum capture_states {
|
||||
};
|
||||
|
||||
/* Returns number of processed bytes */
|
||||
static gboolean
|
||||
process_strip_data (FpiSsm *ssm, FpImageDevice *dev,
|
||||
unsigned char *data)
|
||||
static int process_strip_data(fpi_ssm *ssm, struct fp_img_dev *dev, unsigned char *data)
|
||||
{
|
||||
unsigned char *stripdata;
|
||||
FpiDeviceAes2550 *self = FPI_DEVICE_AES2550 (dev);
|
||||
struct aes2550_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
struct fpi_frame *stripe;
|
||||
int len;
|
||||
|
||||
if (data[0] != AES2550_EDATA_MAGIC)
|
||||
{
|
||||
fp_dbg ("Bogus magic: %.2x", (int) (data[0]));
|
||||
return FALSE;
|
||||
if (data[0] != AES2550_EDATA_MAGIC) {
|
||||
fp_dbg("Bogus magic: %.2x\n", (int)(data[0]));
|
||||
return -EPROTO;
|
||||
}
|
||||
len = data[1] * 256 + data[2];
|
||||
if (len != (AES2550_STRIP_SIZE - 3))
|
||||
fp_dbg ("Bogus frame len: %.4x", len);
|
||||
stripe = g_malloc0 (FRAME_WIDTH * FRAME_HEIGHT / 2 + sizeof (struct fpi_frame)); /* 4 bits per pixel */
|
||||
if (len != (AES2550_STRIP_SIZE - 3)) {
|
||||
fp_dbg("Bogus frame len: %.4x\n", len);
|
||||
}
|
||||
stripe = g_malloc(FRAME_WIDTH * FRAME_HEIGHT / 2 + sizeof(struct fpi_frame)); /* 4 bits per pixel */
|
||||
stripe->delta_x = (int8_t)data[6];
|
||||
stripe->delta_y = -(int8_t)data[7];
|
||||
stripdata = stripe->data;
|
||||
memcpy(stripdata, data + 33, FRAME_WIDTH * FRAME_HEIGHT / 2);
|
||||
self->strips = g_slist_prepend (self->strips, stripe);
|
||||
self->strips_len++;
|
||||
aesdev->strips = g_slist_prepend(aesdev->strips, stripe);
|
||||
aesdev->strips_len++;
|
||||
|
||||
fp_dbg("deltas: %dx%d", stripe->delta_x, stripe->delta_y);
|
||||
|
||||
return TRUE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
capture_set_idle_reqs_cb (FpiUsbTransfer *transfer,
|
||||
FpDevice *device, gpointer user_data,
|
||||
GError *error)
|
||||
static void capture_reqs_cb(struct libusb_transfer *transfer)
|
||||
{
|
||||
FpImageDevice *dev = FP_IMAGE_DEVICE (device);
|
||||
FpiDeviceAes2550 *self = FPI_DEVICE_AES2550 (dev);
|
||||
fpi_ssm *ssm = transfer->user_data;
|
||||
|
||||
if (!error && self->strips_len)
|
||||
if ((transfer->status == LIBUSB_TRANSFER_COMPLETED) &&
|
||||
(transfer->length == transfer->actual_length)) {
|
||||
fpi_ssm_next_state(ssm);
|
||||
} else {
|
||||
fpi_ssm_mark_failed(ssm, -EIO);
|
||||
}
|
||||
libusb_free_transfer(transfer);
|
||||
}
|
||||
|
||||
static void capture_set_idle_reqs_cb(struct libusb_transfer *transfer)
|
||||
{
|
||||
FpImage *img;
|
||||
fpi_ssm *ssm = transfer->user_data;
|
||||
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
|
||||
struct aes2550_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
|
||||
self->strips = g_slist_reverse (self->strips);
|
||||
img = fpi_assemble_frames (&assembling_ctx, self->strips);
|
||||
img->flags |= FPI_IMAGE_PARTIAL;
|
||||
g_slist_free_full (self->strips, g_free);
|
||||
self->strips = NULL;
|
||||
self->strips_len = 0;
|
||||
fpi_image_device_image_captured (dev, img);
|
||||
fpi_image_device_report_finger_status (dev, FALSE);
|
||||
if ((transfer->status == LIBUSB_TRANSFER_COMPLETED) &&
|
||||
(transfer->length == transfer->actual_length) &&
|
||||
aesdev->strips_len) {
|
||||
struct fp_img *img;
|
||||
|
||||
aesdev->strips = g_slist_reverse(aesdev->strips);
|
||||
img = fpi_assemble_frames(&assembling_ctx,
|
||||
aesdev->strips, aesdev->strips_len);
|
||||
img->flags |= FP_IMG_PARTIAL;
|
||||
g_slist_free_full(aesdev->strips, g_free);
|
||||
aesdev->strips = NULL;
|
||||
aesdev->strips_len = 0;
|
||||
fpi_imgdev_image_captured(dev, img);
|
||||
fpi_imgdev_report_finger_status(dev, FALSE);
|
||||
/* marking machine complete will re-trigger finger detection loop */
|
||||
fpi_ssm_mark_completed (transfer->ssm);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (error)
|
||||
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||
else
|
||||
fpi_ssm_mark_failed (transfer->ssm,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_PROTO));
|
||||
fpi_ssm_mark_completed(ssm);
|
||||
} else {
|
||||
fpi_ssm_mark_failed(ssm, -EIO);
|
||||
}
|
||||
libusb_free_transfer(transfer);
|
||||
}
|
||||
|
||||
static void
|
||||
capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
gpointer user_data, GError *error)
|
||||
static void capture_read_data_cb(struct libusb_transfer *transfer)
|
||||
{
|
||||
FpImageDevice *dev = FP_IMAGE_DEVICE (device);
|
||||
FpiDeviceAes2550 *self = FPI_DEVICE_AES2550 (dev);
|
||||
fpi_ssm *ssm = transfer->user_data;
|
||||
struct fp_img_dev *dev = fpi_ssm_get_user_data(ssm);
|
||||
struct aes2550_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
unsigned char *data = transfer->buffer;
|
||||
int r;
|
||||
|
||||
if (error)
|
||||
{
|
||||
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||
return;
|
||||
if (transfer->status != LIBUSB_TRANSFER_COMPLETED) {
|
||||
fp_dbg("request is not completed, %d", transfer->status);
|
||||
fpi_ssm_mark_failed(ssm, -EIO);
|
||||
goto out;
|
||||
}
|
||||
|
||||
fp_dbg ("request completed, len: %.4x", (gint) transfer->actual_length);
|
||||
fp_dbg("request completed, len: %.4x", transfer->actual_length);
|
||||
if (transfer->actual_length >= 2)
|
||||
fp_dbg("data: %.2x %.2x", (int)data[0], (int)data[1]);
|
||||
|
||||
switch (transfer->actual_length)
|
||||
{
|
||||
switch (transfer->actual_length) {
|
||||
case AES2550_STRIP_SIZE:
|
||||
if (!process_strip_data (transfer->ssm, dev, data))
|
||||
{
|
||||
fp_dbg ("Processing strip data failed");
|
||||
fpi_ssm_mark_failed (transfer->ssm,
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_PROTO));
|
||||
return;
|
||||
r = process_strip_data(ssm, dev, data);
|
||||
if (r < 0) {
|
||||
fp_dbg("Processing strip data failed: %d", r);
|
||||
fpi_ssm_mark_failed(ssm, -EPROTO);
|
||||
goto out;
|
||||
}
|
||||
self->heartbeat_cnt = 0;
|
||||
fpi_ssm_jump_to_state (transfer->ssm, CAPTURE_READ_DATA);
|
||||
aesdev->heartbeat_cnt = 0;
|
||||
fpi_ssm_jump_to_state(ssm, CAPTURE_READ_DATA);
|
||||
break;
|
||||
|
||||
case AES2550_HEARTBEAT_SIZE:
|
||||
if (data[0] == AES2550_HEARTBEAT_MAGIC)
|
||||
{
|
||||
if (data[0] == AES2550_HEARTBEAT_MAGIC) {
|
||||
/* No data for a long time => finger was removed or there's no movement */
|
||||
self->heartbeat_cnt++;
|
||||
if (self->heartbeat_cnt == 3)
|
||||
{
|
||||
aesdev->heartbeat_cnt++;
|
||||
if (aesdev->heartbeat_cnt == 3) {
|
||||
/* Got 3 heartbeat message, that's enough to consider that finger was removed,
|
||||
* assemble image and submit it to the library */
|
||||
fp_dbg("Got 3 heartbeats => finger removed");
|
||||
fpi_ssm_next_state (transfer->ssm);
|
||||
}
|
||||
else
|
||||
{
|
||||
fpi_ssm_jump_to_state (transfer->ssm,
|
||||
CAPTURE_READ_DATA);
|
||||
fpi_ssm_next_state(ssm);
|
||||
} else {
|
||||
fpi_ssm_jump_to_state(ssm, CAPTURE_READ_DATA);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
fp_dbg ("Short frame %d, skip",
|
||||
(gint) transfer->actual_length);
|
||||
fpi_ssm_jump_to_state (transfer->ssm, CAPTURE_READ_DATA);
|
||||
fp_dbg("Short frame %d, skip", transfer->actual_length);
|
||||
fpi_ssm_jump_to_state(ssm, CAPTURE_READ_DATA);
|
||||
break;
|
||||
}
|
||||
out:
|
||||
g_free(transfer->buffer);
|
||||
libusb_free_transfer(transfer);
|
||||
}
|
||||
|
||||
static void
|
||||
capture_run_state (FpiSsm *ssm, FpDevice *dev)
|
||||
{
|
||||
switch (fpi_ssm_get_cur_state (ssm))
|
||||
static void capture_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data)
|
||||
{
|
||||
struct fp_img_dev *dev = user_data;
|
||||
int r;
|
||||
|
||||
switch (fpi_ssm_get_cur_state(ssm)) {
|
||||
case CAPTURE_WRITE_REQS:
|
||||
{
|
||||
FpiUsbTransfer *transfer = fpi_usb_transfer_new (dev);
|
||||
struct libusb_transfer *transfer = fpi_usb_alloc();
|
||||
|
||||
fpi_usb_transfer_fill_bulk_full (transfer, EP_OUT, capture_reqs,
|
||||
sizeof (capture_reqs), NULL);
|
||||
transfer->ssm = ssm;
|
||||
transfer->short_is_error = TRUE;
|
||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
||||
fpi_ssm_usb_transfer_cb, NULL);
|
||||
libusb_fill_bulk_transfer(transfer, fpi_dev_get_usb_dev(FP_DEV(dev)), EP_OUT, capture_reqs,
|
||||
sizeof(capture_reqs), capture_reqs_cb, ssm, BULK_TIMEOUT);
|
||||
r = libusb_submit_transfer(transfer);
|
||||
if (r < 0) {
|
||||
libusb_free_transfer(transfer);
|
||||
fpi_ssm_mark_failed(ssm, -ENOMEM);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case CAPTURE_READ_DATA:
|
||||
{
|
||||
FpiUsbTransfer *transfer = fpi_usb_transfer_new (dev);
|
||||
struct libusb_transfer *transfer = fpi_usb_alloc();
|
||||
unsigned char *data;
|
||||
|
||||
fpi_usb_transfer_fill_bulk (transfer, EP_IN, AES2550_EP_IN_BUF_SIZE);
|
||||
transfer->ssm = ssm;
|
||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
||||
capture_read_data_cb, NULL);
|
||||
data = g_malloc(AES2550_EP_IN_BUF_SIZE);
|
||||
libusb_fill_bulk_transfer(transfer, fpi_dev_get_usb_dev(FP_DEV(dev)), EP_IN, data, AES2550_EP_IN_BUF_SIZE,
|
||||
capture_read_data_cb, ssm, BULK_TIMEOUT);
|
||||
|
||||
r = libusb_submit_transfer(transfer);
|
||||
if (r < 0) {
|
||||
g_free(data);
|
||||
libusb_free_transfer(transfer);
|
||||
fpi_ssm_mark_failed(ssm, r);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case CAPTURE_SET_IDLE:
|
||||
{
|
||||
FpiUsbTransfer *transfer = fpi_usb_transfer_new (dev);
|
||||
struct libusb_transfer *transfer = fpi_usb_alloc();
|
||||
|
||||
fpi_usb_transfer_fill_bulk_full (transfer, EP_OUT,
|
||||
capture_set_idle_reqs,
|
||||
sizeof (capture_set_idle_reqs),
|
||||
NULL);
|
||||
transfer->ssm = ssm;
|
||||
transfer->short_is_error = TRUE;
|
||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
||||
capture_set_idle_reqs_cb, NULL);
|
||||
libusb_fill_bulk_transfer(transfer, fpi_dev_get_usb_dev(FP_DEV(dev)), EP_OUT, capture_set_idle_reqs,
|
||||
sizeof(capture_set_idle_reqs), capture_set_idle_reqs_cb, ssm, BULK_TIMEOUT);
|
||||
r = libusb_submit_transfer(transfer);
|
||||
if (r < 0) {
|
||||
libusb_free_transfer(transfer);
|
||||
fpi_ssm_mark_failed(ssm, -ENOMEM);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
;
|
||||
};
|
||||
}
|
||||
|
||||
static void
|
||||
capture_sm_complete (FpiSsm *ssm, FpDevice *_dev, GError *error)
|
||||
static void capture_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data)
|
||||
{
|
||||
FpiDeviceAes2550 *self = FPI_DEVICE_AES2550 (_dev);
|
||||
FpImageDevice *dev = FP_IMAGE_DEVICE (self);
|
||||
struct fp_img_dev *dev = user_data;
|
||||
struct aes2550_dev *aesdev = FP_INSTANCE_DATA(_dev);
|
||||
|
||||
fp_dbg("Capture completed");
|
||||
|
||||
if (self->deactivating)
|
||||
{
|
||||
if (aesdev->deactivating)
|
||||
complete_deactivation(dev);
|
||||
g_clear_pointer (&error, g_error_free);
|
||||
}
|
||||
else if (error)
|
||||
{
|
||||
fpi_image_device_session_error (dev, error);
|
||||
}
|
||||
else if (fpi_ssm_get_error(ssm))
|
||||
fpi_imgdev_session_error(dev, fpi_ssm_get_error(ssm));
|
||||
else
|
||||
{
|
||||
start_finger_detection(dev);
|
||||
}
|
||||
fpi_ssm_free(ssm);
|
||||
}
|
||||
|
||||
static void
|
||||
start_capture (FpImageDevice *dev)
|
||||
static void start_capture(struct fp_img_dev *dev)
|
||||
{
|
||||
FpiDeviceAes2550 *self = FPI_DEVICE_AES2550 (dev);
|
||||
FpiSsm *ssm;
|
||||
struct aes2550_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
fpi_ssm *ssm;
|
||||
|
||||
if (self->deactivating)
|
||||
{
|
||||
if (aesdev->deactivating) {
|
||||
complete_deactivation(dev);
|
||||
return;
|
||||
}
|
||||
|
||||
self->heartbeat_cnt = 0;
|
||||
ssm = fpi_ssm_new (FP_DEVICE (dev), capture_run_state, CAPTURE_NUM_STATES);
|
||||
aesdev->heartbeat_cnt = 0;
|
||||
ssm = fpi_ssm_new(FP_DEV(dev), capture_run_state, CAPTURE_NUM_STATES, dev);
|
||||
G_DEBUG_HERE();
|
||||
fpi_ssm_start(ssm, capture_sm_complete);
|
||||
}
|
||||
@@ -421,162 +420,201 @@ enum activate_states {
|
||||
ACTIVATE_NUM_STATES,
|
||||
};
|
||||
|
||||
/* TODO: use calibration table, datasheet is rather terse on that
|
||||
* need more info for implementation */
|
||||
static void
|
||||
calibrate_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
gpointer user_data, GError *error)
|
||||
static void init_reqs_cb(struct libusb_transfer *transfer)
|
||||
{
|
||||
fpi_ssm_usb_transfer_cb (transfer, device, user_data, error);
|
||||
fpi_ssm *ssm = transfer->user_data;
|
||||
|
||||
if ((transfer->status == LIBUSB_TRANSFER_COMPLETED) &&
|
||||
(transfer->length == transfer->actual_length)) {
|
||||
fpi_ssm_next_state(ssm);
|
||||
} else {
|
||||
fpi_ssm_mark_failed(ssm, -EIO);
|
||||
}
|
||||
libusb_free_transfer(transfer);
|
||||
}
|
||||
|
||||
static void
|
||||
activate_run_state (FpiSsm *ssm, FpDevice *dev)
|
||||
static void init_read_data_cb(struct libusb_transfer *transfer)
|
||||
{
|
||||
switch (fpi_ssm_get_cur_state (ssm))
|
||||
fpi_ssm *ssm = transfer->user_data;
|
||||
|
||||
if (transfer->status == LIBUSB_TRANSFER_COMPLETED) {
|
||||
fpi_ssm_next_state(ssm);
|
||||
} else {
|
||||
fpi_ssm_mark_failed(ssm, -EIO);
|
||||
}
|
||||
g_free(transfer->buffer);
|
||||
libusb_free_transfer(transfer);
|
||||
}
|
||||
|
||||
/* TODO: use calibration table, datasheet is rather terse on that
|
||||
* need more info for implementaion */
|
||||
static void calibrate_read_data_cb(struct libusb_transfer *transfer)
|
||||
{
|
||||
fpi_ssm *ssm = transfer->user_data;
|
||||
|
||||
if (transfer->status == LIBUSB_TRANSFER_COMPLETED) {
|
||||
fpi_ssm_next_state(ssm);
|
||||
} else {
|
||||
fpi_ssm_mark_failed(ssm, -EIO);
|
||||
}
|
||||
g_free(transfer->buffer);
|
||||
libusb_free_transfer(transfer);
|
||||
}
|
||||
|
||||
static void activate_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data)
|
||||
{
|
||||
struct fp_img_dev *dev = user_data;
|
||||
int r;
|
||||
|
||||
switch (fpi_ssm_get_cur_state(ssm)) {
|
||||
case WRITE_INIT:
|
||||
{
|
||||
FpiUsbTransfer *transfer = fpi_usb_transfer_new (dev);
|
||||
struct libusb_transfer *transfer = fpi_usb_alloc();
|
||||
|
||||
fpi_usb_transfer_fill_bulk_full (transfer, EP_OUT, init_reqs,
|
||||
sizeof (init_reqs), NULL);
|
||||
transfer->ssm = ssm;
|
||||
transfer->short_is_error = TRUE;
|
||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
||||
fpi_ssm_usb_transfer_cb, NULL);
|
||||
libusb_fill_bulk_transfer(transfer, fpi_dev_get_usb_dev(FP_DEV(dev)), EP_OUT, init_reqs,
|
||||
sizeof(init_reqs), init_reqs_cb, ssm, BULK_TIMEOUT);
|
||||
r = libusb_submit_transfer(transfer);
|
||||
if (r < 0) {
|
||||
libusb_free_transfer(transfer);
|
||||
fpi_ssm_mark_failed(ssm, -ENOMEM);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case READ_DATA:
|
||||
{
|
||||
FpiUsbTransfer *transfer = fpi_usb_transfer_new (dev);
|
||||
struct libusb_transfer *transfer = fpi_usb_alloc();
|
||||
unsigned char *data;
|
||||
|
||||
fpi_usb_transfer_fill_bulk (transfer, EP_IN, AES2550_EP_IN_BUF_SIZE);
|
||||
transfer->ssm = ssm;
|
||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
||||
fpi_ssm_usb_transfer_cb, NULL);
|
||||
data = g_malloc(AES2550_EP_IN_BUF_SIZE);
|
||||
libusb_fill_bulk_transfer(transfer, fpi_dev_get_usb_dev(FP_DEV(dev)), EP_IN, data, AES2550_EP_IN_BUF_SIZE,
|
||||
init_read_data_cb, ssm, BULK_TIMEOUT);
|
||||
|
||||
r = libusb_submit_transfer(transfer);
|
||||
if (r < 0) {
|
||||
g_free(data);
|
||||
libusb_free_transfer(transfer);
|
||||
fpi_ssm_mark_failed(ssm, r);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case CALIBRATE:
|
||||
{
|
||||
FpiUsbTransfer *transfer = fpi_usb_transfer_new (dev);
|
||||
struct libusb_transfer *transfer = fpi_usb_alloc();
|
||||
|
||||
fpi_usb_transfer_fill_bulk_full (transfer, EP_OUT,
|
||||
calibrate_reqs,
|
||||
sizeof (calibrate_reqs), NULL);
|
||||
transfer->ssm = ssm;
|
||||
transfer->short_is_error = TRUE;
|
||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
||||
fpi_ssm_usb_transfer_cb, NULL);
|
||||
libusb_fill_bulk_transfer(transfer, fpi_dev_get_usb_dev(FP_DEV(dev)), EP_OUT, calibrate_reqs,
|
||||
sizeof(calibrate_reqs), init_reqs_cb, ssm, BULK_TIMEOUT);
|
||||
r = libusb_submit_transfer(transfer);
|
||||
if (r < 0) {
|
||||
libusb_free_transfer(transfer);
|
||||
fpi_ssm_mark_failed(ssm, -ENOMEM);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case READ_CALIB_TABLE:
|
||||
{
|
||||
FpiUsbTransfer *transfer = fpi_usb_transfer_new (dev);
|
||||
struct libusb_transfer *transfer = fpi_usb_alloc();
|
||||
unsigned char *data;
|
||||
|
||||
fpi_usb_transfer_fill_bulk (transfer, EP_IN, AES2550_EP_IN_BUF_SIZE);
|
||||
transfer->ssm = ssm;
|
||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
||||
calibrate_read_data_cb, NULL);
|
||||
data = g_malloc(AES2550_EP_IN_BUF_SIZE);
|
||||
libusb_fill_bulk_transfer(transfer, fpi_dev_get_usb_dev(FP_DEV(dev)), EP_IN, data, AES2550_EP_IN_BUF_SIZE,
|
||||
calibrate_read_data_cb, ssm, BULK_TIMEOUT);
|
||||
|
||||
r = libusb_submit_transfer(transfer);
|
||||
if (r < 0) {
|
||||
g_free(data);
|
||||
libusb_free_transfer(transfer);
|
||||
fpi_ssm_mark_failed(ssm, r);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
activate_sm_complete (FpiSsm *ssm, FpDevice *_dev, GError *error)
|
||||
static void activate_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data)
|
||||
{
|
||||
FpImageDevice *dev = FP_IMAGE_DEVICE (_dev);
|
||||
struct fp_img_dev *dev = user_data;
|
||||
fp_dbg("status %d", fpi_ssm_get_error(ssm));
|
||||
fpi_imgdev_activate_complete(dev, fpi_ssm_get_error(ssm));
|
||||
|
||||
fpi_image_device_activate_complete (dev, error);
|
||||
|
||||
if (!error)
|
||||
if (!fpi_ssm_get_error(ssm))
|
||||
start_finger_detection(dev);
|
||||
fpi_ssm_free(ssm);
|
||||
}
|
||||
|
||||
static void
|
||||
dev_activate (FpImageDevice *dev)
|
||||
static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
|
||||
{
|
||||
FpiSsm *ssm = fpi_ssm_new (FP_DEVICE (dev), activate_run_state,
|
||||
ACTIVATE_NUM_STATES);
|
||||
|
||||
fpi_ssm *ssm = fpi_ssm_new(FP_DEV(dev), activate_run_state,
|
||||
ACTIVATE_NUM_STATES, dev);
|
||||
fpi_ssm_start(ssm, activate_sm_complete);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
dev_deactivate (FpImageDevice *dev)
|
||||
static void dev_deactivate(struct fp_img_dev *dev)
|
||||
{
|
||||
FpiDeviceAes2550 *self = FPI_DEVICE_AES2550 (dev);
|
||||
struct aes2550_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
|
||||
self->deactivating = TRUE;
|
||||
aesdev->deactivating = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
complete_deactivation (FpImageDevice *dev)
|
||||
static void complete_deactivation(struct fp_img_dev *dev)
|
||||
{
|
||||
FpiDeviceAes2550 *self = FPI_DEVICE_AES2550 (dev);
|
||||
|
||||
struct aes2550_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
G_DEBUG_HERE();
|
||||
|
||||
self->deactivating = FALSE;
|
||||
g_slist_free (self->strips);
|
||||
self->strips = NULL;
|
||||
self->strips_len = 0;
|
||||
fpi_image_device_deactivate_complete (dev, NULL);
|
||||
aesdev->deactivating = FALSE;
|
||||
g_slist_free(aesdev->strips);
|
||||
aesdev->strips = NULL;
|
||||
aesdev->strips_len = 0;
|
||||
fpi_imgdev_deactivate_complete(dev);
|
||||
}
|
||||
|
||||
static void
|
||||
dev_init (FpImageDevice *dev)
|
||||
static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
/* TODO check that device has endpoints we're using */
|
||||
int r;
|
||||
struct aes2550_dev *aes2550_dev;
|
||||
|
||||
g_usb_device_claim_interface (fpi_device_get_usb_device (FP_DEVICE (dev)), 0, 0, &error);
|
||||
|
||||
fpi_image_device_open_complete (dev, error);
|
||||
r = libusb_claim_interface(fpi_dev_get_usb_dev(FP_DEV(dev)), 0);
|
||||
if (r < 0) {
|
||||
fp_err("could not claim interface 0: %s", libusb_error_name(r));
|
||||
return r;
|
||||
}
|
||||
|
||||
static void
|
||||
dev_deinit (FpImageDevice *dev)
|
||||
aes2550_dev = g_malloc0(sizeof(struct aes2550_dev));
|
||||
fp_dev_set_instance_data(FP_DEV(dev), aes2550_dev);
|
||||
fpi_imgdev_open_complete(dev, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void dev_deinit(struct fp_img_dev *dev)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_usb_device_release_interface (fpi_device_get_usb_device (FP_DEVICE (dev)),
|
||||
0, 0, &error);
|
||||
fpi_image_device_close_complete (dev, error);
|
||||
struct aes2550_dev *aesdev;
|
||||
aesdev = FP_INSTANCE_DATA(FP_DEV(dev));
|
||||
g_free(aesdev);
|
||||
libusb_release_interface(fpi_dev_get_usb_dev(FP_DEV(dev)), 0);
|
||||
fpi_imgdev_close_complete(dev);
|
||||
}
|
||||
|
||||
static const FpIdEntry id_table[] = {
|
||||
{ .vid = 0x08ff, .pid = 0x2550, },/* AES2550 */
|
||||
{ .vid = 0x08ff, .pid = 0x2810, },/* AES2810 */
|
||||
{ .vid = 0, .pid = 0, .driver_data = 0 },
|
||||
static const struct usb_id id_table[] = {
|
||||
{ .vendor = 0x08ff, .product = 0x2550 }, /* AES2550 */
|
||||
{ .vendor = 0x08ff, .product = 0x2810 }, /* AES2810 */
|
||||
{ 0, 0, 0, },
|
||||
};
|
||||
|
||||
static void
|
||||
fpi_device_aes2550_init (FpiDeviceAes2550 *self)
|
||||
{
|
||||
}
|
||||
static void
|
||||
fpi_device_aes2550_class_init (FpiDeviceAes2550Class *klass)
|
||||
{
|
||||
FpDeviceClass *dev_class = FP_DEVICE_CLASS (klass);
|
||||
FpImageDeviceClass *img_class = FP_IMAGE_DEVICE_CLASS (klass);
|
||||
struct fp_img_driver aes2550_driver = {
|
||||
.driver = {
|
||||
.id = AES2550_ID,
|
||||
.name = FP_COMPONENT,
|
||||
.full_name = "AuthenTec AES2550/AES2810",
|
||||
.id_table = id_table,
|
||||
.scan_type = FP_SCAN_TYPE_SWIPE,
|
||||
},
|
||||
.flags = 0,
|
||||
.img_height = -1,
|
||||
.img_width = FRAME_WIDTH + FRAME_WIDTH / 2,
|
||||
|
||||
dev_class->id = "aes2550";
|
||||
dev_class->full_name = "AuthenTec AES2550/AES2810";
|
||||
dev_class->type = FP_DEVICE_TYPE_USB;
|
||||
dev_class->id_table = id_table;
|
||||
dev_class->scan_type = FP_SCAN_TYPE_SWIPE;
|
||||
|
||||
img_class->img_open = dev_init;
|
||||
img_class->img_close = dev_deinit;
|
||||
img_class->activate = dev_activate;
|
||||
img_class->deactivate = dev_deactivate;
|
||||
|
||||
img_class->img_width = FRAME_WIDTH + FRAME_WIDTH / 2;
|
||||
img_class->img_height = -1;
|
||||
}
|
||||
.open = dev_init,
|
||||
.close = dev_deinit,
|
||||
.activate = dev_activate,
|
||||
.deactivate = dev_deactivate,
|
||||
};
|
||||
|
||||