mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-09-10 21:06:51 +00:00
Compare commits
1204
Commits
@@ -0,0 +1,10 @@
|
|||||||
|
# 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
|
||||||
+144
-29
@@ -1,39 +1,56 @@
|
|||||||
include:
|
include:
|
||||||
|
- local: '.gitlab-ci/libfprint-image-variables.yaml'
|
||||||
- local: '.gitlab-ci/libfprint-templates.yaml'
|
- local: '.gitlab-ci/libfprint-templates.yaml'
|
||||||
- project: 'wayland/ci-templates'
|
- project: 'freedesktop/ci-templates'
|
||||||
ref: master
|
ref: master
|
||||||
file: '/templates/fedora.yml'
|
file: '/templates/fedora.yml'
|
||||||
- remote: 'https://gitlab.gnome.org/GNOME/citemplates/-/raw/master/flatpak/flatpak_ci_initiative.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:
|
variables:
|
||||||
extends: .libfprint_common_variables
|
extends: .libfprint_common_variables
|
||||||
FDO_DISTRIBUTION_TAG: latest
|
FDO_DISTRIBUTION_TAG: $LIBFPRINT_IMAGE_TAG
|
||||||
FDO_DISTRIBUTION_VERSION: rawhide
|
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"
|
FEDORA_IMAGE: "$CI_REGISTRY/libfprint/$CI_PROJECT_NAME/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG"
|
||||||
BUNDLE: "org.freedesktop.libfprint.Demo.flatpak"
|
|
||||||
LAST_ABI_BREAK: "056ea541ddc97f5806cffbd99a12dc87e4da3546"
|
LAST_ABI_BREAK: "056ea541ddc97f5806cffbd99a12dc87e4da3546"
|
||||||
|
|
||||||
|
workflow:
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
||||||
|
- if: $CI_PIPELINE_SOURCE == 'push'
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
- image-build
|
||||||
- check-source
|
- check-source
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
- flatpak
|
- flatpak
|
||||||
|
|
||||||
image: "$FEDORA_IMAGE"
|
image: $FEDORA_IMAGE
|
||||||
|
|
||||||
.build_one_driver_template: &build_one_driver
|
.build_one_driver_template: &build_one_driver
|
||||||
script:
|
script:
|
||||||
# Build with a driver that doesn't need imaging, or nss
|
# Build with a driver that doesn't need imaging, or nss
|
||||||
- meson --werror -Ddrivers=$driver . _build
|
- meson setup _build --werror -Ddrivers=$driver
|
||||||
- ninja -C _build
|
- meson compile -C _build
|
||||||
- rm -rf _build/
|
- rm -rf _build/
|
||||||
|
|
||||||
.build_template: &build
|
.build_template: &build
|
||||||
script:
|
script:
|
||||||
# And build with everything
|
# And build with everything
|
||||||
- meson --werror -Ddrivers=all . _build
|
- meson setup _build --werror -Ddrivers=all
|
||||||
- ninja -C _build
|
- meson compile -C _build
|
||||||
- ninja -C _build install
|
- meson install -C _build
|
||||||
|
|
||||||
.build_template: &check_abi
|
.build_template: &check_abi
|
||||||
script:
|
script:
|
||||||
@@ -52,7 +69,8 @@ build:
|
|||||||
artifacts:
|
artifacts:
|
||||||
expose_as: "HTML Documentation"
|
expose_as: "HTML Documentation"
|
||||||
paths:
|
paths:
|
||||||
- _build/doc/html/
|
- _build/doc/html
|
||||||
|
- _build/doc/html/index.html
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@@ -61,26 +79,67 @@ test:
|
|||||||
variables:
|
variables:
|
||||||
- $CI_PIPELINE_SOURCE == "schedule"
|
- $CI_PIPELINE_SOURCE == "schedule"
|
||||||
script:
|
script:
|
||||||
- meson --werror -Ddrivers=all -Db_coverage=true . _build
|
- meson setup _build --werror -Ddrivers=all -Db_coverage=true
|
||||||
- ninja -C _build
|
- meson test -C _build --print-errorlogs --no-stdsplit --timeout-multiplier 3
|
||||||
- meson test -C _build --verbose --no-stdsplit --timeout-multiplier 3
|
|
||||||
- ninja -C _build coverage
|
- ninja -C _build coverage
|
||||||
- cat _build/meson-logs/coverage.txt
|
- cat _build/meson-logs/coverage.txt || true
|
||||||
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'
|
||||||
|
when: always
|
||||||
paths:
|
paths:
|
||||||
- _build/meson-logs
|
- _build/meson-logs
|
||||||
|
- _build/meson-logs/coveragereport/index.html
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
coverage: '/^TOTAL.*\s+(\d+\%)$/'
|
coverage: '/^TOTAL.*\s+(\d+\%)$/'
|
||||||
|
|
||||||
test_valgrind:
|
test_valgrind:
|
||||||
stage: test
|
stage: test
|
||||||
|
allow_failure: true
|
||||||
except:
|
except:
|
||||||
variables:
|
variables:
|
||||||
- $CI_PIPELINE_SOURCE == "schedule"
|
- $CI_PIPELINE_SOURCE == "schedule"
|
||||||
script:
|
script:
|
||||||
- meson -Ddrivers=all . _build
|
- meson setup _build -Ddrivers=all
|
||||||
- ninja -C _build
|
- meson compile -C _build
|
||||||
- meson test -C _build --verbose --no-stdsplit --setup=valgrind
|
- 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:
|
test_scan_build:
|
||||||
stage: test
|
stage: test
|
||||||
@@ -89,12 +148,12 @@ test_scan_build:
|
|||||||
- $CI_PIPELINE_SOURCE == "schedule"
|
- $CI_PIPELINE_SOURCE == "schedule"
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
script:
|
script:
|
||||||
- meson -Ddrivers=all . _build
|
- meson setup _build -Ddrivers=all
|
||||||
# This is ugly, the wrapper disables the malloc checker
|
# Wrapper to add --status-bugs and disable malloc checker
|
||||||
- SCANBUILD=$CI_PROJECT_DIR/.gitlab-ci/scan-build ninja -C _build scan-build
|
- SCANBUILD=$CI_PROJECT_DIR/.gitlab-ci/scan-build
|
||||||
# Check that the directory is empty
|
ninja -C _build scan-build
|
||||||
- "! ls -A _build/meson-logs/scanbuild | grep -q ."
|
|
||||||
artifacts:
|
artifacts:
|
||||||
|
when: on_failure
|
||||||
paths:
|
paths:
|
||||||
- _build/meson-logs
|
- _build/meson-logs
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
@@ -107,38 +166,94 @@ test_indent:
|
|||||||
script:
|
script:
|
||||||
- scripts/uncrustify.sh
|
- scripts/uncrustify.sh
|
||||||
- git diff
|
- git diff
|
||||||
- "! git status -s | grep -q ."
|
- 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:
|
flatpak:
|
||||||
stage: flatpak
|
stage: flatpak
|
||||||
extends: .flatpak
|
extends: .flatpak@x86_64
|
||||||
image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.36
|
|
||||||
variables:
|
variables:
|
||||||
MANIFEST_PATH: "demo/org.freedesktop.libfprint.Demo.json"
|
MANIFEST_PATH: "demo/org.freedesktop.libfprint.Demo.json"
|
||||||
FLATPAK_MODULE: "libfprint"
|
FLATPAK_MODULE: "libfprint"
|
||||||
APP_ID: "org.freedesktop.libfprint.Demo"
|
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:
|
rules:
|
||||||
- if: '$CI_PROJECT_PATH != "libfprint/libfprint"'
|
- if: '$CI_PROJECT_PATH != "libfprint/libfprint"'
|
||||||
when: never
|
when: manual
|
||||||
|
allow_failure: true
|
||||||
- if: '$CI_PIPELINE_SOURCE == "schedule"'
|
- if: '$CI_PIPELINE_SOURCE == "schedule"'
|
||||||
when: never
|
when: never
|
||||||
- if: '$CI_COMMIT_BRANCH == "master"'
|
- if: '$CI_COMMIT_BRANCH == "master"'
|
||||||
|
allow_failure: true
|
||||||
when: always
|
when: always
|
||||||
- if: '$CI_COMMIT_TAG'
|
- if: '$CI_COMMIT_TAG'
|
||||||
|
allow_failure: true
|
||||||
when: always
|
when: always
|
||||||
# For any other (commit), allow manual run.
|
# For any other (commit), allow manual run.
|
||||||
# This excludes MRs which would create a duplicate pipeline
|
# This excludes MRs which would create a duplicate pipeline
|
||||||
- if: '$CI_COMMIT_BRANCH'
|
- if: '$CI_COMMIT_BRANCH'
|
||||||
when: manual
|
when: manual
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
- if: '$CI_MERGE_REQUEST_ID'
|
||||||
|
when: manual
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
# CONTAINERS creation stage
|
# CONTAINERS creation stage
|
||||||
container_fedora_build:
|
.container_fedora_build_base:
|
||||||
extends: .fdo.container-build@fedora
|
extends: .fdo.container-build@fedora
|
||||||
|
stage: image-build
|
||||||
only:
|
only:
|
||||||
variables:
|
variables:
|
||||||
- $CI_PIPELINE_SOURCE == "schedule" && $CRON_TASK == "BUILD_CI_IMAGES"
|
- $CI_PIPELINE_SOURCE == "never"
|
||||||
variables:
|
variables:
|
||||||
GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
|
GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
|
||||||
# a list of packages to install
|
# a list of packages to install
|
||||||
FDO_DISTRIBUTION_PACKAGES: $LIBFPRINT_DEPENDENCIES
|
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
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
variables:
|
||||||
|
LIBFPRINT_IMAGE_TAG: v3
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
|
# Bump image version on .gitlab-ci/libfprint-image-variables.yaml to trigger
|
||||||
|
# a rebuild on changes to this file
|
||||||
|
|
||||||
.libfprint_common_variables:
|
.libfprint_common_variables:
|
||||||
LIBFPRINT_DEPENDENCIES:
|
LIBFPRINT_DEPENDENCIES:
|
||||||
doxygen
|
doxygen
|
||||||
|
dnf-plugins-core
|
||||||
flatpak-builder
|
flatpak-builder
|
||||||
gcc
|
gcc
|
||||||
gcc-c++
|
gcc-c++
|
||||||
@@ -9,10 +13,12 @@
|
|||||||
glib2-devel
|
glib2-devel
|
||||||
glibc-devel
|
glibc-devel
|
||||||
gobject-introspection-devel
|
gobject-introspection-devel
|
||||||
|
gnome-desktop-testing
|
||||||
gtk-doc
|
gtk-doc
|
||||||
gtk3-devel
|
gtk3-devel
|
||||||
libabigail
|
libabigail
|
||||||
libgusb-devel
|
libgusb-devel
|
||||||
|
libgudev-devel
|
||||||
libX11-devel
|
libX11-devel
|
||||||
libXv-devel
|
libXv-devel
|
||||||
meson
|
meson
|
||||||
@@ -25,3 +31,19 @@
|
|||||||
uncrustify
|
uncrustify
|
||||||
valgrind
|
valgrind
|
||||||
clang-analyzer
|
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 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# This wrapper just disables the malloc checker
|
# This wrapper just disables the malloc checker
|
||||||
exec /usr/bin/scan-build -disable-checker unix.Malloc "$@"
|
exec /usr/bin/scan-build --status-bugs -disable-checker unix.Malloc "$@"
|
||||||
@@ -1,6 +1,210 @@
|
|||||||
This file lists notable changes in each release. For the full history of all
|
This file lists notable changes in each release. For the full history of all
|
||||||
changes, see ChangeLog.
|
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
|
2020-06-08: v1.90.3 release
|
||||||
|
|
||||||
This release mostly contains support for a number of new match-on-chip
|
This release mostly contains support for a number of new match-on-chip
|
||||||
@@ -168,7 +372,7 @@ tests of the drivers using umockdev.
|
|||||||
- Mark fp_dscv_print functions as deprecated
|
- Mark fp_dscv_print functions as deprecated
|
||||||
|
|
||||||
* Udev rules:
|
* Udev rules:
|
||||||
- Add some unsupported devices to the whitelist
|
- Add some unsupported devices to the allowlist
|
||||||
|
|
||||||
2017-05-14: v0.7.0 release
|
2017-05-14: v0.7.0 release
|
||||||
* Drivers:
|
* Drivers:
|
||||||
@@ -218,7 +422,7 @@ tests of the drivers using umockdev.
|
|||||||
- Fix possible race condition, and cancellation in uru4000 driver
|
- Fix possible race condition, and cancellation in uru4000 driver
|
||||||
|
|
||||||
* Udev rules:
|
* Udev rules:
|
||||||
- Add Microsoft keyboard to the suspend blacklist
|
- Add Microsoft keyboard to the suspend denylist
|
||||||
|
|
||||||
* Plenty of build fixes
|
* Plenty of build fixes
|
||||||
|
|
||||||
|
|||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
### 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)
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
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/
|
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
|
||||||
|
|
||||||
|
<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
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
### 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
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -0,0 +1,416 @@
|
|||||||
|
# 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
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
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
|
||||||
Vendored
+10
@@ -0,0 +1,10 @@
|
|||||||
|
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.
|
||||||
Vendored
+14
@@ -0,0 +1,14 @@
|
|||||||
|
### 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`.
|
||||||
Vendored
+1012
File diff suppressed because it is too large
Load Diff
Vendored
+203
@@ -0,0 +1,203 @@
|
|||||||
|
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.
|
||||||
Vendored
+45
@@ -0,0 +1,45 @@
|
|||||||
|
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'.
|
||||||
Vendored
+2
@@ -0,0 +1,2 @@
|
|||||||
|
NEWS
|
||||||
|
README.md
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
dch -v"$GBP_DEBIAN_VERSION" "New upstream release"
|
||||||
|
git add debian/changelog
|
||||||
|
debcommit
|
||||||
|
|
||||||
|
debian/update-udev-triggers.sh
|
||||||
Vendored
+19
@@ -0,0 +1,19 @@
|
|||||||
|
[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
|
||||||
|
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
usr/lib/${DEB_HOST_MULTIARCH}/girepository-1.0/FPrint-*.typelib
|
||||||
Vendored
+3
@@ -0,0 +1,3 @@
|
|||||||
|
usr/lib/udev/hwdb.d/
|
||||||
|
usr/lib/udev/rules.d/
|
||||||
|
usr/lib/${DEB_HOST_MULTIARCH}/libfprint-[0-9].so.*
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
# For security reasons, we don't want the fingerprint readers to be accessible
|
||||||
|
# by unprivileged users
|
||||||
|
udev-rule-missing-uaccess
|
||||||
Vendored
+315
@@ -0,0 +1,315 @@
|
|||||||
|
#!/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
|
||||||
Vendored
+17
@@ -0,0 +1,17 @@
|
|||||||
|
#!/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
|
||||||
Vendored
+94
@@ -0,0 +1,94 @@
|
|||||||
|
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
|
||||||
Vendored
+4
@@ -0,0 +1,4 @@
|
|||||||
|
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
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
usr/share/gtk-doc/*/libfprint-*
|
||||||
Vendored
+2
@@ -0,0 +1,2 @@
|
|||||||
|
usr/libexec/installed-tests/libfprint-[0-9]
|
||||||
|
usr/share/installed-tests/libfprint-[0-9]
|
||||||
Vendored
+3
@@ -0,0 +1,3 @@
|
|||||||
|
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
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
usr/lib/${DEB_HOST_MULTIARCH}/libfprint-[0-9]-tod.so.*
|
||||||
Vendored
+239
@@ -0,0 +1,239 @@
|
|||||||
|
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
|
||||||
+37
@@ -0,0 +1,37 @@
|
|||||||
|
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
|
||||||
|
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
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 */
|
||||||
|
};
|
||||||
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
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
|
||||||
|
|
||||||
+44
@@ -0,0 +1,44 @@
|
|||||||
|
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 },
|
||||||
Vendored
+7
@@ -0,0 +1,7 @@
|
|||||||
|
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
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
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
|
||||||
|
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
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
|
||||||
|
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
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 */
|
||||||
|
};
|
||||||
|
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
#!/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
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
3.0 (quilt)
|
||||||
Vendored
+3
@@ -0,0 +1,3 @@
|
|||||||
|
# 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]
|
||||||
Vendored
+6
@@ -0,0 +1,6 @@
|
|||||||
|
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
|
||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
#!/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
|
||||||
Vendored
+4
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
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
|
||||||
Vendored
+5
@@ -0,0 +1,5 @@
|
|||||||
|
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@
|
||||||
@@ -102,9 +102,9 @@ plot_minutiae (unsigned char *rgbdata,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
#define write_pixel(num) do { \
|
#define write_pixel(num) do { \
|
||||||
rgbdata[((num) * 3)] = 0xff; \
|
rgbdata[((num) * 3)] = 0xff; \
|
||||||
rgbdata[((num) * 3) + 1] = 0; \
|
rgbdata[((num) * 3) + 1] = 0; \
|
||||||
rgbdata[((num) * 3) + 2] = 0; \
|
rgbdata[((num) * 3) + 2] = 0; \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
for (i = 0; i < minutiae->len; i++)
|
for (i = 0; i < minutiae->len; i++)
|
||||||
@@ -526,7 +526,7 @@ libfprint_demo_window_init (LibfprintDemoWindow *window)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fp_device_supports_capture (g_ptr_array_index (devices, 0)))
|
if (!fp_device_has_feature (g_ptr_array_index (devices, 0), FP_DEVICE_FEATURE_CAPTURE))
|
||||||
{
|
{
|
||||||
libfprint_demo_set_mode (window, NOIMAGING_MODE);
|
libfprint_demo_set_mode (window, NOIMAGING_MODE);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"app-id": "org.freedesktop.libfprint.Demo",
|
"app-id": "org.freedesktop.libfprint.Demo",
|
||||||
"runtime": "org.gnome.Platform",
|
"runtime": "org.gnome.Platform",
|
||||||
"runtime-version": "3.36",
|
"runtime-version": "master",
|
||||||
"sdk": "org.gnome.Sdk",
|
"sdk": "org.gnome.Sdk",
|
||||||
"command": "gtk-libfprint-test",
|
"command": "gtk-libfprint-test",
|
||||||
"finish-args": [
|
"finish-args": [
|
||||||
/* X11 + XShm access */
|
/* X11 + XShm access */
|
||||||
"--share=ipc", "--socket=x11",
|
"--share=ipc", "--socket=fallback-x11",
|
||||||
/* Wayland access */
|
/* Wayland access */
|
||||||
"--socket=wayland",
|
"--socket=wayland",
|
||||||
/* OpenGL access */
|
/* OpenGL access */
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
"modules": [
|
"modules": [
|
||||||
{
|
{
|
||||||
"name": "libusb",
|
"name": "libusb",
|
||||||
"config-opts": [ "--disable-static", "--disable-udev" ],
|
"config-opts": [ "--disable-static" ],
|
||||||
"cleanup": [
|
"cleanup": [
|
||||||
"/lib/*.la",
|
"/lib/*.la",
|
||||||
"/lib/pkgconfig",
|
"/lib/pkgconfig",
|
||||||
@@ -26,36 +26,47 @@
|
|||||||
],
|
],
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"type": "archive",
|
"type": "archive",
|
||||||
"url": "https://github.com/libusb/libusb/archive/v1.0.22.tar.gz",
|
"url": "https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2",
|
||||||
"sha256": "3500f7b182750cd9ccf9be8b1df998f83df56a39ab264976bdb3307773e16f48"
|
"sha256": "12ce7a61fc9854d1d2a1ffe095f7b5fac19ddba095c259e6067a46500381b5a5"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"post-install": [
|
"post-install": [
|
||||||
"install -Dm644 COPYING /app/share/licenses/libgusb/COPYING"
|
"install -Dm644 COPYING /app/share/licenses/libusb/COPYING"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "libgusb",
|
"name": "libgusb",
|
||||||
"buildsystem": "meson",
|
"buildsystem": "meson",
|
||||||
"config-opts": [ "-Dtests=false", "-Dvapi=false", "-Ddocs=false", "-Dintrospection=false" ],
|
"config-opts": [ "-Dtests=false", "-Dvapi=false", "-Ddocs=false" ],
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"type": "archive",
|
"type": "archive",
|
||||||
"url": "https://github.com/hughsie/libgusb/archive/0.3.0.tar.gz",
|
"url": "https://github.com/hughsie/libgusb/releases/download/0.4.6/libgusb-0.4.6.tar.xz",
|
||||||
"sha256": "b36310f8405d5fd68f6caf4a829f7ab4c627b38fd3d02a139d411fce0f3a49f1"
|
"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",
|
"name": "libfprint",
|
||||||
"buildsystem": "meson",
|
"buildsystem": "meson",
|
||||||
"config-opts": [ "-Dudev_rules=false", "-Dx11-examples=false", "-Dgtk-examples=true", "-Ddrivers=all" ],
|
"config-opts": [ "-Dudev_hwdb=disabled", "-Dudev_rules=disabled", "-Dgtk-examples=true", "-Ddrivers=all" ],
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://gitlab.freedesktop.org/libfprint/libfprint.git",
|
"url": "https://gitlab.freedesktop.org/libfprint/libfprint.git"
|
||||||
"branch": "wip/benzea/v2"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,9 +20,11 @@ FP_TYPE_DEVICE
|
|||||||
FP_DEVICE_RETRY
|
FP_DEVICE_RETRY
|
||||||
FP_DEVICE_ERROR
|
FP_DEVICE_ERROR
|
||||||
FpDeviceType
|
FpDeviceType
|
||||||
|
FpDeviceFeature
|
||||||
FpScanType
|
FpScanType
|
||||||
FpDeviceRetry
|
FpDeviceRetry
|
||||||
FpDeviceError
|
FpDeviceError
|
||||||
|
FpFingerStatusFlags
|
||||||
fp_device_retry_quark
|
fp_device_retry_quark
|
||||||
fp_device_error_quark
|
fp_device_error_quark
|
||||||
FpEnrollProgress
|
FpEnrollProgress
|
||||||
@@ -32,9 +34,13 @@ fp_device_get_device_id
|
|||||||
fp_device_get_name
|
fp_device_get_name
|
||||||
fp_device_get_scan_type
|
fp_device_get_scan_type
|
||||||
fp_device_get_nr_enroll_stages
|
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_has_storage
|
||||||
fp_device_supports_identify
|
fp_device_supports_identify
|
||||||
fp_device_supports_capture
|
fp_device_supports_capture
|
||||||
|
fp_device_is_open
|
||||||
fp_device_open
|
fp_device_open
|
||||||
fp_device_close
|
fp_device_close
|
||||||
fp_device_enroll
|
fp_device_enroll
|
||||||
@@ -43,6 +49,9 @@ fp_device_identify
|
|||||||
fp_device_capture
|
fp_device_capture
|
||||||
fp_device_delete_print
|
fp_device_delete_print
|
||||||
fp_device_list_prints
|
fp_device_list_prints
|
||||||
|
fp_device_clear_storage
|
||||||
|
fp_device_suspend
|
||||||
|
fp_device_resume
|
||||||
fp_device_open_finish
|
fp_device_open_finish
|
||||||
fp_device_close_finish
|
fp_device_close_finish
|
||||||
fp_device_enroll_finish
|
fp_device_enroll_finish
|
||||||
@@ -51,6 +60,9 @@ fp_device_identify_finish
|
|||||||
fp_device_capture_finish
|
fp_device_capture_finish
|
||||||
fp_device_delete_print_finish
|
fp_device_delete_print_finish
|
||||||
fp_device_list_prints_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_open_sync
|
||||||
fp_device_close_sync
|
fp_device_close_sync
|
||||||
fp_device_enroll_sync
|
fp_device_enroll_sync
|
||||||
@@ -59,6 +71,9 @@ fp_device_identify_sync
|
|||||||
fp_device_capture_sync
|
fp_device_capture_sync
|
||||||
fp_device_delete_print_sync
|
fp_device_delete_print_sync
|
||||||
fp_device_list_prints_sync
|
fp_device_list_prints_sync
|
||||||
|
fp_device_clear_storage_sync
|
||||||
|
fp_device_suspend_sync
|
||||||
|
fp_device_resume_sync
|
||||||
FpDevice
|
FpDevice
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
@@ -91,8 +106,6 @@ FP_TYPE_PRINT
|
|||||||
FpFinger
|
FpFinger
|
||||||
FpPrint
|
FpPrint
|
||||||
fp_print_new
|
fp_print_new
|
||||||
fp_print_new_from_data
|
|
||||||
fp_print_to_data
|
|
||||||
fp_print_get_driver
|
fp_print_get_driver
|
||||||
fp_print_get_device_id
|
fp_print_get_device_id
|
||||||
fp_print_get_device_stored
|
fp_print_get_device_stored
|
||||||
@@ -132,7 +145,9 @@ FpDeviceClass
|
|||||||
FpTimeoutFunc
|
FpTimeoutFunc
|
||||||
FpiDeviceAction
|
FpiDeviceAction
|
||||||
FpIdEntry
|
FpIdEntry
|
||||||
|
FpiDeviceUdevSubtypeFlags
|
||||||
fpi_device_get_usb_device
|
fpi_device_get_usb_device
|
||||||
|
fpi_device_get_udev_data
|
||||||
fpi_device_get_virtual_env
|
fpi_device_get_virtual_env
|
||||||
fpi_device_get_current_action
|
fpi_device_get_current_action
|
||||||
fpi_device_retry_new
|
fpi_device_retry_new
|
||||||
@@ -150,6 +165,12 @@ fpi_device_action_is_cancelled
|
|||||||
fpi_device_add_timeout
|
fpi_device_add_timeout
|
||||||
fpi_device_set_nr_enroll_stages
|
fpi_device_set_nr_enroll_stages
|
||||||
fpi_device_set_scan_type
|
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_action_error
|
||||||
fpi_device_probe_complete
|
fpi_device_probe_complete
|
||||||
fpi_device_open_complete
|
fpi_device_open_complete
|
||||||
@@ -158,10 +179,15 @@ fpi_device_enroll_complete
|
|||||||
fpi_device_verify_complete
|
fpi_device_verify_complete
|
||||||
fpi_device_identify_complete
|
fpi_device_identify_complete
|
||||||
fpi_device_capture_complete
|
fpi_device_capture_complete
|
||||||
|
fpi_device_clear_storage_complete
|
||||||
fpi_device_delete_complete
|
fpi_device_delete_complete
|
||||||
|
fpi_device_list_complete
|
||||||
|
fpi_device_suspend_complete
|
||||||
|
fpi_device_resume_complete
|
||||||
fpi_device_enroll_progress
|
fpi_device_enroll_progress
|
||||||
fpi_device_verify_report
|
fpi_device_verify_report
|
||||||
fpi_device_identify_report
|
fpi_device_identify_report
|
||||||
|
fpi_device_class_auto_initialize_features
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
@@ -186,6 +212,7 @@ fpi_image_device_deactivate_complete
|
|||||||
fpi_image_device_report_finger_status
|
fpi_image_device_report_finger_status
|
||||||
fpi_image_device_image_captured
|
fpi_image_device_image_captured
|
||||||
fpi_image_device_retry_scan
|
fpi_image_device_retry_scan
|
||||||
|
fpi_image_device_set_bz3_threshold
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
@@ -229,11 +256,15 @@ fpi_ssm_mark_completed
|
|||||||
fpi_ssm_mark_failed
|
fpi_ssm_mark_failed
|
||||||
fpi_ssm_set_data
|
fpi_ssm_set_data
|
||||||
fpi_ssm_get_data
|
fpi_ssm_get_data
|
||||||
|
fpi_ssm_get_device
|
||||||
fpi_ssm_get_error
|
fpi_ssm_get_error
|
||||||
fpi_ssm_dup_error
|
fpi_ssm_dup_error
|
||||||
fpi_ssm_get_cur_state
|
fpi_ssm_get_cur_state
|
||||||
fpi_ssm_next_state_timeout_cb
|
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_cb
|
||||||
|
fpi_ssm_usb_transfer_with_weak_pointer_cb
|
||||||
FpiSsm
|
FpiSsm
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
@@ -260,3 +291,20 @@ FPI_TYPE_USB_TRANSFER
|
|||||||
fpi_usb_transfer_get_type
|
fpi_usb_transfer_get_type
|
||||||
</SECTION>
|
</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>
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#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
|
||||||
@@ -41,7 +41,8 @@
|
|||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
<chapter id="driver-helpers">
|
<chapter id="driver-helpers">
|
||||||
<title>USB and State Machine helpers</title>
|
<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-usb-transfer.xml"/>
|
||||||
<xi:include href="xml/fpi-ssm.xml"/>
|
<xi:include href="xml/fpi-ssm.xml"/>
|
||||||
<xi:include href="xml/fpi-log.xml"/>
|
<xi:include href="xml/fpi-log.xml"/>
|
||||||
|
|||||||
+4
-2
@@ -19,17 +19,19 @@ content_files = [
|
|||||||
|
|
||||||
expand_content_files = content_files
|
expand_content_files = content_files
|
||||||
|
|
||||||
glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix')
|
glib_prefix = dependency('glib-2.0').get_variable(pkgconfig: 'prefix')
|
||||||
glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
|
glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
|
||||||
docpath = join_paths(get_option('datadir'), 'gtk-doc', 'html')
|
docpath = join_paths(get_option('datadir'), 'gtk-doc', 'html')
|
||||||
|
|
||||||
gnome.gtkdoc(versioned_libname,
|
gnome.gtkdoc(versioned_libname,
|
||||||
main_xml: 'libfprint-docs.xml',
|
main_xml: 'libfprint-docs.xml',
|
||||||
src_dir: join_paths(meson.source_root(), 'libfprint'),
|
src_dir: join_paths(meson.project_source_root(), 'libfprint'),
|
||||||
|
include_directories: include_directories('../libfprint'),
|
||||||
dependencies: libfprint_dep,
|
dependencies: libfprint_dep,
|
||||||
content_files: content_files,
|
content_files: content_files,
|
||||||
expand_content_files: expand_content_files,
|
expand_content_files: expand_content_files,
|
||||||
ignore_headers: private_headers,
|
ignore_headers: private_headers,
|
||||||
|
gobject_typesfile: 'libfprint-2.types',
|
||||||
fixxref_args: [
|
fixxref_args: [
|
||||||
'--html-dir=@0@'.format(docpath),
|
'--html-dir=@0@'.format(docpath),
|
||||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
|
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
|
||||||
|
|||||||
+68
-17
@@ -35,6 +35,7 @@ typedef struct _EnrollData
|
|||||||
unsigned int sigint_handler;
|
unsigned int sigint_handler;
|
||||||
FpFinger finger;
|
FpFinger finger;
|
||||||
int ret_value;
|
int ret_value;
|
||||||
|
gboolean update_fingerprint;
|
||||||
} EnrollData;
|
} EnrollData;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -57,7 +58,7 @@ on_device_closed (FpDevice *dev, GAsyncResult *res, void *user_data)
|
|||||||
fp_device_close_finish (dev, res, &error);
|
fp_device_close_finish (dev, res, &error);
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
g_warning ("Failed closing device %s\n", error->message);
|
g_warning ("Failed closing device %s", error->message);
|
||||||
|
|
||||||
g_main_loop_quit (enroll_data->loop);
|
g_main_loop_quit (enroll_data->loop);
|
||||||
}
|
}
|
||||||
@@ -76,20 +77,25 @@ on_enroll_completed (FpDevice *dev, GAsyncResult *res, void *user_data)
|
|||||||
{
|
{
|
||||||
enroll_data->ret_value = EXIT_SUCCESS;
|
enroll_data->ret_value = EXIT_SUCCESS;
|
||||||
|
|
||||||
if (!fp_device_has_storage (dev))
|
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_debug ("Device has not storage, saving locally");
|
g_warning ("Data save failed, code %d", r);
|
||||||
int r = print_data_save (print, enroll_data->finger);
|
enroll_data->ret_value = EXIT_FAILURE;
|
||||||
if (r < 0)
|
|
||||||
{
|
|
||||||
g_warning ("Data save failed, code %d", r);
|
|
||||||
enroll_data->ret_value = EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_warning ("Enroll failed with error %s\n", error->message);
|
g_warning ("Enroll failed with error %s", error->message);
|
||||||
}
|
}
|
||||||
|
|
||||||
fp_device_close (dev, NULL, (GAsyncReadyCallback) on_device_closed,
|
fp_device_close (dev, NULL, (GAsyncReadyCallback) on_device_closed,
|
||||||
@@ -120,6 +126,40 @@ on_enroll_progress (FpDevice *device,
|
|||||||
fp_device_get_nr_enroll_stages (device));
|
fp_device_get_nr_enroll_stages (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'n':
|
||||||
|
case 'N':
|
||||||
|
update_fingerprint = FALSE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
g_warning ("Invalid choice %c, should be Y/y or N/n.", update_choice);
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
return update_fingerprint;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_device_opened (FpDevice *dev, GAsyncResult *res, void *user_data)
|
on_device_opened (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||||
{
|
{
|
||||||
@@ -135,13 +175,26 @@ on_device_opened (FpDevice *dev, GAsyncResult *res, void *user_data)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf ("Opened device. It's now time to enroll your finger.\n\n");
|
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 "
|
printf ("You will need to successfully scan your %s finger %d times to "
|
||||||
"complete the process.\n\n", finger_to_string (enroll_data->finger),
|
"complete the process.\n\n", finger_to_string (enroll_data->finger),
|
||||||
fp_device_get_nr_enroll_stages (dev));
|
fp_device_get_nr_enroll_stages (dev));
|
||||||
printf ("Scan your finger now.\n");
|
printf ("Scan your finger now.\n");
|
||||||
|
|
||||||
print_template = print_create_template (dev, enroll_data->finger);
|
print_template = print_create_template (dev, enroll_data->finger, enroll_data->update_fingerprint);
|
||||||
fp_device_enroll (dev, print_template, enroll_data->cancellable,
|
fp_device_enroll (dev, print_template, enroll_data->cancellable,
|
||||||
on_enroll_progress, NULL, NULL,
|
on_enroll_progress, NULL, NULL,
|
||||||
(GAsyncReadyCallback) on_enroll_completed,
|
(GAsyncReadyCallback) on_enroll_completed,
|
||||||
@@ -167,11 +220,9 @@ main (void)
|
|||||||
FpDevice *dev;
|
FpDevice *dev;
|
||||||
FpFinger finger;
|
FpFinger finger;
|
||||||
|
|
||||||
g_print ("This program will enroll the selected finger, unconditionally "
|
g_print ("This program will enroll the selected finger overwriting any print for the same"
|
||||||
"overwriting any print for the same finger that was enrolled "
|
" finger that was enrolled previously. Fingerprint updates without erasing old data"
|
||||||
"previously. If you want to continue, press enter, otherwise hit "
|
" are possible on devices supporting that. Ctrl+C interrupts program execution.\n");
|
||||||
"Ctrl+C\n");
|
|
||||||
getchar ();
|
|
||||||
|
|
||||||
g_print ("Choose the finger to enroll:\n");
|
g_print ("Choose the finger to enroll:\n");
|
||||||
finger = finger_chooser ();
|
finger = finger_chooser ();
|
||||||
|
|||||||
@@ -0,0 +1,321 @@
|
|||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
@@ -58,7 +58,7 @@ on_device_closed (FpDevice *dev, GAsyncResult *res, void *user_data)
|
|||||||
fp_device_close_finish (dev, res, &error);
|
fp_device_close_finish (dev, res, &error);
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
g_warning ("Failed closing device %s\n", error->message);
|
g_warning ("Failed closing device %s", error->message);
|
||||||
|
|
||||||
g_main_loop_quit (capture_data->loop);
|
g_main_loop_quit (capture_data->loop);
|
||||||
}
|
}
|
||||||
@@ -162,7 +162,7 @@ main (int argc, const char *argv[])
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fp_device_supports_capture (dev))
|
if (!fp_device_has_feature (dev, FP_DEVICE_FEATURE_CAPTURE))
|
||||||
{
|
{
|
||||||
g_warning ("Device %s doesn't support capture",
|
g_warning ("Device %s doesn't support capture",
|
||||||
fp_device_get_name (dev));
|
fp_device_get_name (dev));
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ on_device_closed (FpDevice *dev,
|
|||||||
fp_device_close_finish (dev, res, &error);
|
fp_device_close_finish (dev, res, &error);
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
g_warning ("Failed closing device %s\n", error->message);
|
g_warning ("Failed closing device %s", error->message);
|
||||||
|
|
||||||
g_main_loop_quit (list_data->loop);
|
g_main_loop_quit (list_data->loop);
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,7 @@ delete_next_print (FpDevice *dev,
|
|||||||
g_assert_nonnull (list_data->to_delete);
|
g_assert_nonnull (list_data->to_delete);
|
||||||
print = list_data->to_delete->data;
|
print = list_data->to_delete->data;
|
||||||
|
|
||||||
g_debug ("Deleting print %s\n", fp_print_get_description (print));
|
g_debug ("Deleting print %s", fp_print_get_description (print));
|
||||||
fp_device_delete_print (dev, print, NULL,
|
fp_device_delete_print (dev, print, NULL,
|
||||||
(GAsyncReadyCallback) on_print_deleted, list_data);
|
(GAsyncReadyCallback) on_print_deleted, list_data);
|
||||||
}
|
}
|
||||||
@@ -161,7 +161,7 @@ on_list_completed (FpDevice *dev,
|
|||||||
finger_to_string (fp_print_get_finger (print)),
|
finger_to_string (fp_print_get_finger (print)),
|
||||||
fp_print_get_username (print));
|
fp_print_get_username (print));
|
||||||
|
|
||||||
if (date)
|
if (date && g_date_valid (date))
|
||||||
{
|
{
|
||||||
g_date_strftime (buf, G_N_ELEMENTS (buf), "%Y-%m-%d\0", date);
|
g_date_strftime (buf, G_N_ELEMENTS (buf), "%Y-%m-%d\0", date);
|
||||||
g_print (", enrolled on %s", buf);
|
g_print (", enrolled on %s", buf);
|
||||||
@@ -231,7 +231,7 @@ on_device_opened (FpDevice *dev,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fp_device_has_storage (dev))
|
if (!fp_device_has_feature (dev, FP_DEVICE_FEATURE_STORAGE))
|
||||||
{
|
{
|
||||||
g_warning ("Device %s doesn't support storage", fp_device_get_name (dev));
|
g_warning ("Device %s doesn't support storage", fp_device_get_name (dev));
|
||||||
g_main_loop_quit (list_data->loop);
|
g_main_loop_quit (list_data->loop);
|
||||||
|
|||||||
+23
-1
@@ -1,5 +1,12 @@
|
|||||||
|
|
||||||
examples = [ 'enroll', 'verify', 'manage-prints', 'img-capture' ]
|
examples = [
|
||||||
|
'enroll',
|
||||||
|
'identify',
|
||||||
|
'img-capture',
|
||||||
|
'manage-prints',
|
||||||
|
'verify',
|
||||||
|
]
|
||||||
|
|
||||||
foreach example: examples
|
foreach example: examples
|
||||||
executable(example,
|
executable(example,
|
||||||
[ example + '.c', 'storage.c', 'utilities.c' ],
|
[ example + '.c', 'storage.c', 'utilities.c' ],
|
||||||
@@ -14,3 +21,18 @@ executable('cpp-test',
|
|||||||
'cpp-test.cpp',
|
'cpp-test.cpp',
|
||||||
dependencies: libfprint_dep,
|
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,
|
||||||
|
],
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|||||||
+83
-21
@@ -2,7 +2,7 @@
|
|||||||
* Trivial storage driver for example programs
|
* Trivial storage driver for example programs
|
||||||
*
|
*
|
||||||
* Copyright (C) 2019 Benjamin Berg <bberg@redhat.com>
|
* Copyright (C) 2019 Benjamin Berg <bberg@redhat.com>
|
||||||
* Copyright (C) 2019 Marco Trevisan <marco.trevisan@canonical.com>
|
* Copyright (C) 2019-2020 Marco Trevisan <marco.trevisan@canonical.com>
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@@ -102,8 +102,23 @@ save_data (GVariant *data)
|
|||||||
return 0;
|
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
|
int
|
||||||
print_data_save (FpPrint *print, FpFinger finger)
|
print_data_save (FpPrint *print, FpFinger finger, gboolean update_fingerprint)
|
||||||
{
|
{
|
||||||
g_autofree gchar *descr = get_print_data_descriptor (print, NULL, finger);
|
g_autofree gchar *descr = get_print_data_descriptor (print, NULL, finger);
|
||||||
|
|
||||||
@@ -137,40 +152,87 @@ print_data_load (FpDevice *dev, FpFinger finger)
|
|||||||
|
|
||||||
g_autoptr(GVariant) val = NULL;
|
g_autoptr(GVariant) val = NULL;
|
||||||
g_autoptr(GVariantDict) dict = NULL;
|
g_autoptr(GVariantDict) dict = NULL;
|
||||||
const guchar *stored_data = NULL;
|
|
||||||
gsize stored_len;
|
|
||||||
|
|
||||||
dict = load_data ();
|
dict = load_data ();
|
||||||
val = g_variant_dict_lookup_value (dict, descr, G_VARIANT_TYPE ("ay"));
|
val = g_variant_dict_lookup_value (dict, descr, G_VARIANT_TYPE ("ay"));
|
||||||
|
|
||||||
if (val)
|
if (val)
|
||||||
{
|
return load_print_from_data (val);
|
||||||
FpPrint *print;
|
|
||||||
g_autoptr(GError) error = NULL;
|
|
||||||
|
|
||||||
stored_data = (const guchar *) g_variant_get_fixed_array (val, &stored_len, 1);
|
|
||||||
print = fp_print_deserialize (stored_data, stored_len, &error);
|
|
||||||
|
|
||||||
if (error)
|
|
||||||
g_warning ("Error deserializing data: %s", error->message);
|
|
||||||
|
|
||||||
return print;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
FpPrint *
|
GPtrArray *
|
||||||
print_create_template (FpDevice *dev, FpFinger finger)
|
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(GDateTime) datetime = NULL;
|
||||||
g_autoptr(GDate) date = 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;
|
FpPrint *template = NULL;
|
||||||
gint year, month, day;
|
gint year, month, day;
|
||||||
|
|
||||||
template = fp_print_new (dev);
|
if (load_existing)
|
||||||
fp_print_set_finger (template, finger);
|
{
|
||||||
fp_print_set_username (template, g_get_user_name ());
|
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 ();
|
datetime = g_date_time_new_now_local ();
|
||||||
g_date_time_get_ymd (datetime, &year, &month, &day);
|
g_date_time_get_ymd (datetime, &year, &month, &day);
|
||||||
date = g_date_new_dmy (day, month, year);
|
date = g_date_new_dmy (day, month, year);
|
||||||
|
|||||||
+6
-3
@@ -21,11 +21,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
int print_data_save (FpPrint *print,
|
int print_data_save (FpPrint *print,
|
||||||
FpFinger finger);
|
FpFinger finger,
|
||||||
|
gboolean update_fingerprint);
|
||||||
FpPrint * print_data_load (FpDevice *dev,
|
FpPrint * print_data_load (FpDevice *dev,
|
||||||
FpFinger finger);
|
FpFinger finger);
|
||||||
FpPrint * print_create_template (FpDevice *dev,
|
GPtrArray * gallery_data_load (FpDevice *dev);
|
||||||
FpFinger finger);
|
FpPrint * print_create_template (FpDevice *dev,
|
||||||
|
FpFinger finger,
|
||||||
|
const gboolean load_existing);
|
||||||
gboolean print_image_save (FpPrint *print,
|
gboolean print_image_save (FpPrint *print,
|
||||||
const char *path);
|
const char *path);
|
||||||
gboolean save_image_to_pgm (FpImage *img,
|
gboolean save_image_to_pgm (FpImage *img,
|
||||||
|
|||||||
@@ -0,0 +1,161 @@
|
|||||||
|
/*
|
||||||
|
* 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 ();
|
||||||
|
}
|
||||||
@@ -101,6 +101,7 @@ finger_to_string (FpFinger finger)
|
|||||||
case FP_FINGER_RIGHT_LITTLE:
|
case FP_FINGER_RIGHT_LITTLE:
|
||||||
return "right little";
|
return "right little";
|
||||||
|
|
||||||
|
case FP_FINGER_UNKNOWN:
|
||||||
default:
|
default:
|
||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
|
|||||||
+41
-16
@@ -57,7 +57,7 @@ on_device_closed (FpDevice *dev, GAsyncResult *res, void *user_data)
|
|||||||
fp_device_close_finish (dev, res, &error);
|
fp_device_close_finish (dev, res, &error);
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
g_warning ("Failed closing device %s\n", error->message);
|
g_warning ("Failed closing device %s", error->message);
|
||||||
|
|
||||||
g_main_loop_quit (verify_data->loop);
|
g_main_loop_quit (verify_data->loop);
|
||||||
}
|
}
|
||||||
@@ -130,12 +130,14 @@ on_match_cb (FpDevice *dev, FpPrint *match, FpPrint *print,
|
|||||||
|
|
||||||
if (match)
|
if (match)
|
||||||
{
|
{
|
||||||
char date_str[128];
|
const GDate *date = fp_print_get_enroll_date (match);
|
||||||
|
char date_str[128] = "<unknown>";
|
||||||
|
|
||||||
verify_data->ret_value = EXIT_SUCCESS;
|
verify_data->ret_value = EXIT_SUCCESS;
|
||||||
|
|
||||||
g_date_strftime (date_str, G_N_ELEMENTS (date_str), "%Y-%m-%d\0",
|
if (date && g_date_valid (date))
|
||||||
fp_print_get_enroll_date (match));
|
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 "
|
g_debug ("Match report: device %s matched finger %s successifully "
|
||||||
"with print %s, enrolled on date %s by user %s",
|
"with print %s, enrolled on date %s by user %s",
|
||||||
fp_device_get_name (dev),
|
fp_device_get_name (dev),
|
||||||
@@ -152,6 +154,26 @@ on_match_cb (FpDevice *dev, FpPrint *match, FpPrint *print,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
static void
|
||||||
on_list_completed (FpDevice *dev, GAsyncResult *res, gpointer user_data)
|
on_list_completed (FpDevice *dev, GAsyncResult *res, gpointer user_data)
|
||||||
{
|
{
|
||||||
@@ -165,15 +187,27 @@ on_list_completed (FpDevice *dev, GAsyncResult *res, gpointer user_data)
|
|||||||
if (!error)
|
if (!error)
|
||||||
{
|
{
|
||||||
FpPrint *verify_print = NULL;
|
FpPrint *verify_print = NULL;
|
||||||
|
g_autoptr(FpPrint) stored_print = NULL;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
if (!prints->len)
|
if (!prints->len)
|
||||||
g_warning ("No prints saved on device");
|
{
|
||||||
|
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)
|
for (i = 0; i < prints->len; ++i)
|
||||||
{
|
{
|
||||||
FpPrint *print = prints->pdata[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 &&
|
if (fp_print_get_finger (print) == verify_data->finger &&
|
||||||
g_strcmp0 (fp_print_get_username (print), g_get_user_name ()) == 0)
|
g_strcmp0 (fp_print_get_username (print), g_get_user_name ()) == 0)
|
||||||
{
|
{
|
||||||
@@ -191,8 +225,6 @@ on_list_completed (FpDevice *dev, GAsyncResult *res, gpointer user_data)
|
|||||||
|
|
||||||
if (!verify_print)
|
if (!verify_print)
|
||||||
{
|
{
|
||||||
g_warning ("Did you remember to enroll your %s finger first?",
|
|
||||||
finger_to_string (verify_data->finger));
|
|
||||||
verify_quit (dev, verify_data);
|
verify_quit (dev, verify_data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -230,7 +262,7 @@ start_verification (FpDevice *dev, VerifyData *verify_data)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fp_device_has_storage (dev))
|
if (fp_device_has_feature (dev, FP_DEVICE_FEATURE_STORAGE))
|
||||||
{
|
{
|
||||||
g_print ("Creating finger template, using device storage...\n");
|
g_print ("Creating finger template, using device storage...\n");
|
||||||
fp_device_list_prints (dev, NULL,
|
fp_device_list_prints (dev, NULL,
|
||||||
@@ -239,17 +271,10 @@ start_verification (FpDevice *dev, VerifyData *verify_data)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_print ("Loading previously enrolled %s finger data...\n",
|
g_autoptr(FpPrint) verify_print = get_stored_print (dev, verify_data);
|
||||||
finger_to_string (verify_data->finger));
|
|
||||||
g_autoptr(FpPrint) verify_print = NULL;
|
|
||||||
|
|
||||||
verify_print = print_data_load (dev, verify_data->finger);
|
|
||||||
|
|
||||||
if (!verify_print)
|
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));
|
|
||||||
verify_quit (dev, verify_data);
|
verify_quit (dev, verify_data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,10 +135,8 @@ generic_read_ignore_data (FpiSsm *ssm, FpDevice *dev,
|
|||||||
size_t bytes)
|
size_t bytes)
|
||||||
{
|
{
|
||||||
FpiUsbTransfer *transfer = fpi_usb_transfer_new (dev);
|
FpiUsbTransfer *transfer = fpi_usb_transfer_new (dev);
|
||||||
unsigned char *data;
|
|
||||||
|
|
||||||
data = g_malloc (bytes);
|
fpi_usb_transfer_fill_bulk (transfer, EP_IN, bytes);
|
||||||
fpi_usb_transfer_fill_bulk_full (transfer, EP_IN, data, bytes, g_free);
|
|
||||||
transfer->ssm = ssm;
|
transfer->ssm = ssm;
|
||||||
transfer->short_is_error = TRUE;
|
transfer->short_is_error = TRUE;
|
||||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
||||||
|
|||||||
@@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
#define AES1660_FRAME_SIZE 0x244
|
#define AES1660_FRAME_SIZE 0x244
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
|
||||||
/* First init sequence, 0x07 cmd returns following before INIT1:
|
/* First init sequence, 0x07 cmd returns following before INIT1:
|
||||||
* { 0x07, 0x05, 0x00, 0x8f, 0x16, 0x25, 0x01, 0x00 }
|
* { 0x07, 0x05, 0x00, 0x8f, 0x16, 0x25, 0x01, 0x00 }
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -197,12 +197,12 @@ process_strip_data (FpiSsm *ssm, FpImageDevice *dev,
|
|||||||
|
|
||||||
if (data[0] != AES2550_EDATA_MAGIC)
|
if (data[0] != AES2550_EDATA_MAGIC)
|
||||||
{
|
{
|
||||||
fp_dbg ("Bogus magic: %.2x\n", (int) (data[0]));
|
fp_dbg ("Bogus magic: %.2x", (int) (data[0]));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
len = data[1] * 256 + data[2];
|
len = data[1] * 256 + data[2];
|
||||||
if (len != (AES2550_STRIP_SIZE - 3))
|
if (len != (AES2550_STRIP_SIZE - 3))
|
||||||
fp_dbg ("Bogus frame len: %.4x\n", len);
|
fp_dbg ("Bogus frame len: %.4x", len);
|
||||||
stripe = g_malloc0 (FRAME_WIDTH * FRAME_HEIGHT / 2 + sizeof (struct fpi_frame)); /* 4 bits per pixel */
|
stripe = g_malloc0 (FRAME_WIDTH * FRAME_HEIGHT / 2 + sizeof (struct fpi_frame)); /* 4 bits per pixel */
|
||||||
stripe->delta_x = (int8_t) data[6];
|
stripe->delta_x = (int8_t) data[6];
|
||||||
stripe->delta_y = -(int8_t) data[7];
|
stripe->delta_y = -(int8_t) data[7];
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
#define AES2660_FRAME_SIZE 0x354
|
#define AES2660_FRAME_SIZE 0x354
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
|
||||||
/* First init sequence, 0x07 cmd returns following before INIT1:
|
/* First init sequence, 0x07 cmd returns following before INIT1:
|
||||||
* { 0x07, 0x05, 0x00, 0x91, 0x26, 0x21, 0x00, 0x00 }
|
* { 0x07, 0x05, 0x00, 0x91, 0x26, 0x21, 0x00, 0x00 }
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -106,7 +106,9 @@ static struct aes_regwrite init_reqs[] = {
|
|||||||
{ 0x9e, 0x53 }, /* clear challenge word bits */
|
{ 0x9e, 0x53 }, /* clear challenge word bits */
|
||||||
{ 0x9f, 0x6b }, /* set some challenge word bits */
|
{ 0x9f, 0x6b }, /* set some challenge word bits */
|
||||||
{ 0, 0 },
|
{ 0, 0 },
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct aes_regwrite capture_reqs[] = {
|
||||||
{ 0x80, 0x00 },
|
{ 0x80, 0x00 },
|
||||||
{ 0x81, 0x00 },
|
{ 0x81, 0x00 },
|
||||||
{ 0, 0 },
|
{ 0, 0 },
|
||||||
@@ -155,4 +157,6 @@ fpi_device_aes3500_class_init (FpiDeviceAes3500Class *klass)
|
|||||||
aes_class->enlarge_factor = ENLARGE_FACTOR;
|
aes_class->enlarge_factor = ENLARGE_FACTOR;
|
||||||
aes_class->init_reqs = init_reqs;
|
aes_class->init_reqs = init_reqs;
|
||||||
aes_class->init_reqs_len = G_N_ELEMENTS (init_reqs);
|
aes_class->init_reqs_len = G_N_ELEMENTS (init_reqs);
|
||||||
|
aes_class->capture_reqs = capture_reqs;
|
||||||
|
aes_class->capture_reqs_len = G_N_ELEMENTS (capture_reqs);
|
||||||
}
|
}
|
||||||
|
|||||||
+62
-12
@@ -42,7 +42,10 @@
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
GCancellable *img_trf_cancel;
|
/* This is used both as a flag that we are in a capture operation
|
||||||
|
* and for cancellation.
|
||||||
|
*/
|
||||||
|
GCancellable *img_capture_cancel;
|
||||||
} FpiDeviceAes3kPrivate;
|
} FpiDeviceAes3kPrivate;
|
||||||
|
|
||||||
#define CTRL_TIMEOUT 1000
|
#define CTRL_TIMEOUT 1000
|
||||||
@@ -76,12 +79,16 @@ img_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
|||||||
{
|
{
|
||||||
FpImageDevice *dev = FP_IMAGE_DEVICE (device);
|
FpImageDevice *dev = FP_IMAGE_DEVICE (device);
|
||||||
FpiDeviceAes3k *self = FPI_DEVICE_AES3K (device);
|
FpiDeviceAes3k *self = FPI_DEVICE_AES3K (device);
|
||||||
|
FpiDeviceAes3kPrivate *priv = fpi_device_aes3k_get_instance_private (self);
|
||||||
FpiDeviceAes3kClass *cls = FPI_DEVICE_AES3K_GET_CLASS (self);
|
FpiDeviceAes3kClass *cls = FPI_DEVICE_AES3K_GET_CLASS (self);
|
||||||
unsigned char *ptr = transfer->buffer;
|
unsigned char *ptr = transfer->buffer;
|
||||||
FpImage *tmp;
|
FpImage *tmp;
|
||||||
FpImage *img;
|
FpImage *img;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
/* Image capture operation is finished (error/completed) */
|
||||||
|
g_clear_object (&priv->img_capture_cancel);
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
if (g_error_matches (error,
|
if (g_error_matches (error,
|
||||||
@@ -95,6 +102,7 @@ img_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
|||||||
}
|
}
|
||||||
|
|
||||||
fpi_image_device_session_error (dev, error);
|
fpi_image_device_session_error (dev, error);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fpi_image_device_report_finger_status (dev, TRUE);
|
fpi_image_device_report_finger_status (dev, TRUE);
|
||||||
@@ -118,11 +126,10 @@ img_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
|||||||
fpi_image_device_image_captured (dev, img);
|
fpi_image_device_image_captured (dev, img);
|
||||||
|
|
||||||
/* FIXME: rather than assuming finger has gone, we should poll regs until
|
/* FIXME: rather than assuming finger has gone, we should poll regs until
|
||||||
* it really has, then restart the capture */
|
* it really has. */
|
||||||
fpi_image_device_report_finger_status (dev, FALSE);
|
fpi_image_device_report_finger_status (dev, FALSE);
|
||||||
|
|
||||||
/* Note: We always restart the transfer, it may already be cancelled though. */
|
/* Note: The transfer is re-started when we switch to the AWAIT_FINGER_ON state. */
|
||||||
do_capture (dev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -137,27 +144,51 @@ do_capture (FpImageDevice *dev)
|
|||||||
fpi_usb_transfer_fill_bulk (img_trf, EP_IN, cls->data_buflen);
|
fpi_usb_transfer_fill_bulk (img_trf, EP_IN, cls->data_buflen);
|
||||||
img_trf->short_is_error = TRUE;
|
img_trf->short_is_error = TRUE;
|
||||||
fpi_usb_transfer_submit (g_steal_pointer (&img_trf), 0,
|
fpi_usb_transfer_submit (g_steal_pointer (&img_trf), 0,
|
||||||
priv->img_trf_cancel,
|
priv->img_capture_cancel,
|
||||||
img_cb, NULL);
|
img_cb, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
capture_reqs_cb (FpImageDevice *dev, GError *result, void *user_data)
|
||||||
|
{
|
||||||
|
FpiDeviceAes3k *self = FPI_DEVICE_AES3K (dev);
|
||||||
|
FpiDeviceAes3kPrivate *priv = fpi_device_aes3k_get_instance_private (self);
|
||||||
|
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
g_clear_object (&priv->img_capture_cancel);
|
||||||
|
fpi_image_device_session_error (dev, result);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* FIXME: we never cancel a pending capture. So we are likely leaving the
|
||||||
|
* hardware in a bad state should we abort the capture operation and the
|
||||||
|
* user does not touch the device.
|
||||||
|
* But, we don't know how we might cancel, so just leave it as is. */
|
||||||
|
do_capture (dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
do_capture_start (FpImageDevice *dev)
|
||||||
|
{
|
||||||
|
FpiDeviceAes3k *self = FPI_DEVICE_AES3K (dev);
|
||||||
|
FpiDeviceAes3kClass *cls = FPI_DEVICE_AES3K_GET_CLASS (self);
|
||||||
|
|
||||||
|
aes_write_regv (dev, cls->capture_reqs, cls->capture_reqs_len, capture_reqs_cb, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
init_reqs_cb (FpImageDevice *dev, GError *result, void *user_data)
|
init_reqs_cb (FpImageDevice *dev, GError *result, void *user_data)
|
||||||
{
|
{
|
||||||
fpi_image_device_activate_complete (dev, result);
|
fpi_image_device_activate_complete (dev, result);
|
||||||
if (!result)
|
|
||||||
do_capture (dev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
aes3k_dev_activate (FpImageDevice *dev)
|
aes3k_dev_activate (FpImageDevice *dev)
|
||||||
{
|
{
|
||||||
FpiDeviceAes3k *self = FPI_DEVICE_AES3K (dev);
|
FpiDeviceAes3k *self = FPI_DEVICE_AES3K (dev);
|
||||||
FpiDeviceAes3kPrivate *priv = fpi_device_aes3k_get_instance_private (self);
|
|
||||||
FpiDeviceAes3kClass *cls = FPI_DEVICE_AES3K_GET_CLASS (self);
|
FpiDeviceAes3kClass *cls = FPI_DEVICE_AES3K_GET_CLASS (self);
|
||||||
|
|
||||||
g_assert (!priv->img_trf_cancel);
|
|
||||||
priv->img_trf_cancel = g_cancellable_new ();
|
|
||||||
aes_write_regv (dev, cls->init_reqs, cls->init_reqs_len, init_reqs_cb, NULL);
|
aes_write_regv (dev, cls->init_reqs, cls->init_reqs_len, init_reqs_cb, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,8 +198,26 @@ aes3k_dev_deactivate (FpImageDevice *dev)
|
|||||||
FpiDeviceAes3k *self = FPI_DEVICE_AES3K (dev);
|
FpiDeviceAes3k *self = FPI_DEVICE_AES3K (dev);
|
||||||
FpiDeviceAes3kPrivate *priv = fpi_device_aes3k_get_instance_private (self);
|
FpiDeviceAes3kPrivate *priv = fpi_device_aes3k_get_instance_private (self);
|
||||||
|
|
||||||
/* Deactivation always finishes from the cancellation handler */
|
/* If a capture is running, then deactivation finishes from the cancellation handler */
|
||||||
g_cancellable_cancel (priv->img_trf_cancel);
|
if (priv->img_capture_cancel)
|
||||||
|
g_cancellable_cancel (priv->img_capture_cancel);
|
||||||
|
else
|
||||||
|
fpi_image_device_deactivate_complete (dev, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
aes3k_dev_change_state (FpImageDevice *dev, FpiImageDeviceState state)
|
||||||
|
{
|
||||||
|
FpiDeviceAes3k *self = FPI_DEVICE_AES3K (dev);
|
||||||
|
FpiDeviceAes3kPrivate *priv = fpi_device_aes3k_get_instance_private (self);
|
||||||
|
|
||||||
|
if (state == FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON)
|
||||||
|
{
|
||||||
|
g_assert (!priv->img_capture_cancel);
|
||||||
|
priv->img_capture_cancel = g_cancellable_new ();
|
||||||
|
|
||||||
|
do_capture_start (dev);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -213,6 +262,7 @@ fpi_device_aes3k_class_init (FpiDeviceAes3kClass *klass)
|
|||||||
img_class->img_open = aes3k_dev_init;
|
img_class->img_open = aes3k_dev_init;
|
||||||
img_class->img_close = aes3k_dev_deinit;
|
img_class->img_close = aes3k_dev_deinit;
|
||||||
img_class->activate = aes3k_dev_activate;
|
img_class->activate = aes3k_dev_activate;
|
||||||
|
img_class->change_state = aes3k_dev_change_state;
|
||||||
img_class->deactivate = aes3k_dev_deactivate;
|
img_class->deactivate = aes3k_dev_deactivate;
|
||||||
|
|
||||||
/* Extremely low due to low image quality. */
|
/* Extremely low due to low image quality. */
|
||||||
|
|||||||
@@ -57,4 +57,6 @@ struct _FpiDeviceAes3kClass
|
|||||||
gsize data_buflen; /* buffer length of usb bulk transfer */
|
gsize data_buflen; /* buffer length of usb bulk transfer */
|
||||||
struct aes_regwrite *init_reqs; /* initial values sent to device */
|
struct aes_regwrite *init_reqs; /* initial values sent to device */
|
||||||
gsize init_reqs_len;
|
gsize init_reqs_len;
|
||||||
|
struct aes_regwrite *capture_reqs; /* capture values sent to device */
|
||||||
|
gsize capture_reqs_len;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -103,7 +103,9 @@ static struct aes_regwrite init_reqs[] = {
|
|||||||
{ 0x9e, 0x53 }, /* clear challenge word bits */
|
{ 0x9e, 0x53 }, /* clear challenge word bits */
|
||||||
{ 0x9f, 0x6b }, /* set some challenge word bits */
|
{ 0x9f, 0x6b }, /* set some challenge word bits */
|
||||||
{ 0, 0 },
|
{ 0, 0 },
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct aes_regwrite capture_reqs[] = {
|
||||||
{ 0x80, 0x00 },
|
{ 0x80, 0x00 },
|
||||||
{ 0x81, 0x00 },
|
{ 0x81, 0x00 },
|
||||||
{ 0, 0 },
|
{ 0, 0 },
|
||||||
@@ -122,7 +124,7 @@ G_DEFINE_TYPE (FpiDeviceAes4000, fpi_device_aes4000, FPI_TYPE_DEVICE_AES3K);
|
|||||||
|
|
||||||
|
|
||||||
static const FpIdEntry id_table[] = {
|
static const FpIdEntry id_table[] = {
|
||||||
{ .pid = 0x08ff, .vid = 0x5501 },
|
{ .vid = 0x08ff, .pid = 0x5501 },
|
||||||
{ .vid = 0, .pid = 0, .driver_data = 0 },
|
{ .vid = 0, .pid = 0, .driver_data = 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -152,4 +154,6 @@ fpi_device_aes4000_class_init (FpiDeviceAes4000Class *klass)
|
|||||||
aes_class->enlarge_factor = ENLARGE_FACTOR;
|
aes_class->enlarge_factor = ENLARGE_FACTOR;
|
||||||
aes_class->init_reqs = init_reqs;
|
aes_class->init_reqs = init_reqs;
|
||||||
aes_class->init_reqs_len = G_N_ELEMENTS (init_reqs);
|
aes_class->init_reqs_len = G_N_ELEMENTS (init_reqs);
|
||||||
|
aes_class->capture_reqs = capture_reqs;
|
||||||
|
aes_class->capture_reqs_len = G_N_ELEMENTS (capture_reqs);
|
||||||
}
|
}
|
||||||
|
|||||||
+23
-22
@@ -54,6 +54,7 @@ static void complete_deactivation (FpImageDevice *dev);
|
|||||||
#define CALIBRATE_DATA_LEN 4
|
#define CALIBRATE_DATA_LEN 4
|
||||||
#define FINGER_DET_DATA_LEN 4
|
#define FINGER_DET_DATA_LEN 4
|
||||||
|
|
||||||
|
FP_GNUC_ACCESS (read_only, 3, 4)
|
||||||
static void
|
static void
|
||||||
aesX660_send_cmd_timeout (FpiSsm *ssm,
|
aesX660_send_cmd_timeout (FpiSsm *ssm,
|
||||||
FpDevice *_dev,
|
FpDevice *_dev,
|
||||||
@@ -70,6 +71,7 @@ aesX660_send_cmd_timeout (FpiSsm *ssm,
|
|||||||
fpi_usb_transfer_submit (transfer, timeout, NULL, callback, NULL);
|
fpi_usb_transfer_submit (transfer, timeout, NULL, callback, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FP_GNUC_ACCESS (read_only, 3, 4)
|
||||||
static void
|
static void
|
||||||
aesX660_send_cmd (FpiSsm *ssm,
|
aesX660_send_cmd (FpiSsm *ssm,
|
||||||
FpDevice *dev,
|
FpDevice *dev,
|
||||||
@@ -89,13 +91,12 @@ aesX660_read_response (FpiSsm *ssm,
|
|||||||
FpiUsbTransferCallback callback)
|
FpiUsbTransferCallback callback)
|
||||||
{
|
{
|
||||||
FpiUsbTransfer *transfer = fpi_usb_transfer_new (_dev);
|
FpiUsbTransfer *transfer = fpi_usb_transfer_new (_dev);
|
||||||
unsigned char *data;
|
|
||||||
GCancellable *cancel = NULL;
|
GCancellable *cancel = NULL;
|
||||||
|
|
||||||
if (cancellable)
|
if (cancellable)
|
||||||
cancel = fpi_device_get_cancellable (_dev);
|
cancel = fpi_device_get_cancellable (_dev);
|
||||||
data = g_malloc (buf_len);
|
|
||||||
fpi_usb_transfer_fill_bulk_full (transfer, EP_IN, data, buf_len, NULL);
|
fpi_usb_transfer_fill_bulk (transfer, EP_IN, buf_len);
|
||||||
transfer->ssm = ssm;
|
transfer->ssm = ssm;
|
||||||
transfer->short_is_error = short_is_error;
|
transfer->short_is_error = short_is_error;
|
||||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, cancel, callback, NULL);
|
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, cancel, callback, NULL);
|
||||||
@@ -116,7 +117,7 @@ aesX660_read_calibrate_data_cb (FpiUsbTransfer *transfer,
|
|||||||
/* Calibrate response was read correctly? */
|
/* Calibrate response was read correctly? */
|
||||||
if (data[AESX660_RESPONSE_TYPE_OFFSET] != AESX660_CALIBRATE_RESPONSE)
|
if (data[AESX660_RESPONSE_TYPE_OFFSET] != AESX660_CALIBRATE_RESPONSE)
|
||||||
{
|
{
|
||||||
fp_dbg ("Bogus calibrate response: %.2x\n", data[0]);
|
fp_dbg ("Bogus calibrate response: %.2x", data[0]);
|
||||||
fpi_ssm_mark_failed (transfer->ssm,
|
fpi_ssm_mark_failed (transfer->ssm,
|
||||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||||
"Bogus calibrate "
|
"Bogus calibrate "
|
||||||
@@ -155,14 +156,14 @@ finger_det_read_fd_data_cb (FpiUsbTransfer *transfer,
|
|||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
fp_dbg ("Failed to read FD data\n");
|
fp_dbg ("Failed to read FD data");
|
||||||
fpi_ssm_mark_failed (transfer->ssm, error);
|
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data[AESX660_RESPONSE_TYPE_OFFSET] != AESX660_FINGER_DET_RESPONSE)
|
if (data[AESX660_RESPONSE_TYPE_OFFSET] != AESX660_FINGER_DET_RESPONSE)
|
||||||
{
|
{
|
||||||
fp_dbg ("Bogus FD response: %.2x\n", data[0]);
|
fp_dbg ("Bogus FD response: %.2x", data[0]);
|
||||||
fpi_ssm_mark_failed (transfer->ssm,
|
fpi_ssm_mark_failed (transfer->ssm,
|
||||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||||
"Bogus FD response %.2x",
|
"Bogus FD response %.2x",
|
||||||
@@ -177,7 +178,7 @@ finger_det_read_fd_data_cb (FpiUsbTransfer *transfer,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fp_dbg ("Wait for finger returned %.2x as result\n",
|
fp_dbg ("Wait for finger returned %.2x as result",
|
||||||
data[AESX660_FINGER_PRESENT_OFFSET]);
|
data[AESX660_FINGER_PRESENT_OFFSET]);
|
||||||
fpi_ssm_jump_to_state (transfer->ssm, FINGER_DET_SEND_FD_CMD);
|
fpi_ssm_jump_to_state (transfer->ssm, FINGER_DET_SEND_FD_CMD);
|
||||||
}
|
}
|
||||||
@@ -364,7 +365,7 @@ capture_read_stripe_data_cb (FpiUsbTransfer *transfer,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fp_dbg ("Got %lu bytes of data", actual_length);
|
fp_dbg ("Got %" G_GSIZE_FORMAT " bytes of data", actual_length);
|
||||||
while (actual_length)
|
while (actual_length)
|
||||||
{
|
{
|
||||||
gssize payload_length;
|
gssize payload_length;
|
||||||
@@ -385,7 +386,7 @@ capture_read_stripe_data_cb (FpiUsbTransfer *transfer,
|
|||||||
(priv->stripe_packet->data[AESX660_RESPONSE_SIZE_MSB_OFFSET] << 8);
|
(priv->stripe_packet->data[AESX660_RESPONSE_SIZE_MSB_OFFSET] << 8);
|
||||||
fp_dbg ("Got frame, type %.2x payload of size %.4lx",
|
fp_dbg ("Got frame, type %.2x payload of size %.4lx",
|
||||||
priv->stripe_packet->data[AESX660_RESPONSE_TYPE_OFFSET],
|
priv->stripe_packet->data[AESX660_RESPONSE_TYPE_OFFSET],
|
||||||
payload_length);
|
(long) payload_length);
|
||||||
|
|
||||||
still_needed_len = MAX (0, AESX660_HEADER_SIZE + payload_length - (gssize) priv->stripe_packet->len);
|
still_needed_len = MAX (0, AESX660_HEADER_SIZE + payload_length - (gssize) priv->stripe_packet->len);
|
||||||
copy_len = MIN (actual_length, still_needed_len);
|
copy_len = MIN (actual_length, still_needed_len);
|
||||||
@@ -405,7 +406,7 @@ capture_read_stripe_data_cb (FpiUsbTransfer *transfer,
|
|||||||
g_byte_array_set_size (priv->stripe_packet, 0);
|
g_byte_array_set_size (priv->stripe_packet, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
fp_dbg ("finger %s\n", finger_missing ? "missing" : "present");
|
fp_dbg ("finger %s", finger_missing ? "missing" : "present");
|
||||||
|
|
||||||
if (finger_missing)
|
if (finger_missing)
|
||||||
fpi_ssm_next_state (transfer->ssm);
|
fpi_ssm_next_state (transfer->ssm);
|
||||||
@@ -440,7 +441,7 @@ capture_run_state (FpiSsm *ssm, FpDevice *_dev)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CAPTURE_SET_IDLE:
|
case CAPTURE_SET_IDLE:
|
||||||
fp_dbg ("Got %lu frames\n", priv->strips_len);
|
fp_dbg ("Got %" G_GSIZE_FORMAT " frames", priv->strips_len);
|
||||||
aesX660_send_cmd (ssm, _dev, set_idle_cmd, sizeof (set_idle_cmd),
|
aesX660_send_cmd (ssm, _dev, set_idle_cmd, sizeof (set_idle_cmd),
|
||||||
capture_set_idle_cmd_cb);
|
capture_set_idle_cmd_cb);
|
||||||
break;
|
break;
|
||||||
@@ -513,19 +514,19 @@ activate_read_id_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
|||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
fp_dbg ("read_id cmd failed\n");
|
fp_dbg ("read_id cmd failed");
|
||||||
fpi_ssm_mark_failed (transfer->ssm, error);
|
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* ID was read correctly */
|
/* ID was read correctly */
|
||||||
if (data[0] == 0x07)
|
if (data[0] == 0x07)
|
||||||
{
|
{
|
||||||
fp_dbg ("Sensor device id: %.2x%2x, bcdDevice: %.2x.%.2x, init status: %.2x\n",
|
fp_dbg ("Sensor device id: %.2x%2x, bcdDevice: %.2x.%.2x, init status: %.2x",
|
||||||
data[4], data[3], data[5], data[6], data[7]);
|
data[4], data[3], data[5], data[6], data[7]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fp_dbg ("Bogus read ID response: %.2x\n", data[AESX660_RESPONSE_TYPE_OFFSET]);
|
fp_dbg ("Bogus read ID response: %.2x", data[AESX660_RESPONSE_TYPE_OFFSET]);
|
||||||
fpi_ssm_mark_failed (transfer->ssm,
|
fpi_ssm_mark_failed (transfer->ssm,
|
||||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||||
"Bogus read ID response %.2x",
|
"Bogus read ID response %.2x",
|
||||||
@@ -553,7 +554,7 @@ activate_read_id_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fp_dbg ("Failed to init device! init status: %.2x\n", data[7]);
|
fp_dbg ("Failed to init device! init status: %.2x", data[7]);
|
||||||
fpi_ssm_mark_failed (transfer->ssm,
|
fpi_ssm_mark_failed (transfer->ssm,
|
||||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||||
"Failed to init device %.2x",
|
"Failed to init device %.2x",
|
||||||
@@ -570,11 +571,11 @@ activate_read_init_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
|||||||
FpiDeviceAesX660Private *priv = fpi_device_aes_x660_get_instance_private (self);
|
FpiDeviceAesX660Private *priv = fpi_device_aes_x660_get_instance_private (self);
|
||||||
unsigned char *data = transfer->buffer;
|
unsigned char *data = transfer->buffer;
|
||||||
|
|
||||||
fp_dbg ("read_init_cb\n");
|
fp_dbg ("read_init_cb");
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
fp_dbg ("read_init transfer status: %s, actual_len: %d\n", error->message,
|
fp_dbg ("read_init transfer status: %s, actual_len: %d", error->message,
|
||||||
(gint) transfer->actual_length);
|
(gint) transfer->actual_length);
|
||||||
fpi_ssm_mark_failed (transfer->ssm, error);
|
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||||
return;
|
return;
|
||||||
@@ -582,7 +583,7 @@ activate_read_init_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
|||||||
/* ID was read correctly */
|
/* ID was read correctly */
|
||||||
if (data[0] != 0x42 || data[3] != 0x01)
|
if (data[0] != 0x42 || data[3] != 0x01)
|
||||||
{
|
{
|
||||||
fp_dbg ("Bogus read init response: %.2x %.2x\n", data[0],
|
fp_dbg ("Bogus read init response: %.2x %.2x", data[0],
|
||||||
data[3]);
|
data[3]);
|
||||||
fpi_ssm_mark_failed (transfer->ssm,
|
fpi_ssm_mark_failed (transfer->ssm,
|
||||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||||
@@ -614,13 +615,13 @@ activate_run_state (FpiSsm *ssm, FpDevice *_dev)
|
|||||||
{
|
{
|
||||||
case ACTIVATE_SET_IDLE:
|
case ACTIVATE_SET_IDLE:
|
||||||
priv->init_seq_idx = 0;
|
priv->init_seq_idx = 0;
|
||||||
fp_dbg ("Activate: set idle\n");
|
fp_dbg ("Activate: set idle");
|
||||||
aesX660_send_cmd (ssm, _dev, set_idle_cmd, sizeof (set_idle_cmd),
|
aesX660_send_cmd (ssm, _dev, set_idle_cmd, sizeof (set_idle_cmd),
|
||||||
fpi_ssm_usb_transfer_cb);
|
fpi_ssm_usb_transfer_cb);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACTIVATE_SEND_READ_ID_CMD:
|
case ACTIVATE_SEND_READ_ID_CMD:
|
||||||
fp_dbg ("Activate: read ID\n");
|
fp_dbg ("Activate: read ID");
|
||||||
aesX660_send_cmd (ssm, _dev, read_id_cmd, sizeof (read_id_cmd),
|
aesX660_send_cmd (ssm, _dev, read_id_cmd, sizeof (read_id_cmd),
|
||||||
fpi_ssm_usb_transfer_cb);
|
fpi_ssm_usb_transfer_cb);
|
||||||
break;
|
break;
|
||||||
@@ -630,7 +631,7 @@ activate_run_state (FpiSsm *ssm, FpDevice *_dev)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ACTIVATE_SEND_INIT_CMD:
|
case ACTIVATE_SEND_INIT_CMD:
|
||||||
fp_dbg ("Activate: send init seq #%d cmd #%d\n",
|
fp_dbg ("Activate: send init seq #%d cmd #%d",
|
||||||
priv->init_seq_idx,
|
priv->init_seq_idx,
|
||||||
priv->init_cmd_idx);
|
priv->init_cmd_idx);
|
||||||
aesX660_send_cmd (ssm, _dev,
|
aesX660_send_cmd (ssm, _dev,
|
||||||
@@ -640,7 +641,7 @@ activate_run_state (FpiSsm *ssm, FpDevice *_dev)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ACTIVATE_READ_INIT_RESPONSE:
|
case ACTIVATE_READ_INIT_RESPONSE:
|
||||||
fp_dbg ("Activate: read init response\n");
|
fp_dbg ("Activate: read init response");
|
||||||
aesX660_read_response (ssm, _dev, TRUE, FALSE, INIT_LEN, activate_read_init_cb);
|
aesX660_read_response (ssm, _dev, TRUE, FALSE, INIT_LEN, activate_read_init_cb);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,444 @@
|
|||||||
|
/*
|
||||||
|
* Egis Technology Inc. (aka. LighTuning) 0570 driver for libfprint
|
||||||
|
* Copyright (C) 2021 Maxim Kolesnikov <kolesnikov@svyazcom.ru>
|
||||||
|
* Copyright (C) 2021 Saeed/Ali Rk <saeed.ali.rahimi@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 "egis0570"
|
||||||
|
|
||||||
|
#include "egis0570.h"
|
||||||
|
#include "drivers_api.h"
|
||||||
|
|
||||||
|
/* Packet types */
|
||||||
|
#define PKT_TYPE_INIT 0
|
||||||
|
#define PKT_TYPE_REPEAT 1
|
||||||
|
|
||||||
|
/* Struct */
|
||||||
|
struct _FpDeviceEgis0570
|
||||||
|
{
|
||||||
|
FpImageDevice parent;
|
||||||
|
|
||||||
|
gboolean running;
|
||||||
|
gboolean stop;
|
||||||
|
|
||||||
|
GSList *strips;
|
||||||
|
guint8 *background;
|
||||||
|
gsize strips_len;
|
||||||
|
|
||||||
|
int pkt_num;
|
||||||
|
int pkt_type;
|
||||||
|
};
|
||||||
|
G_DECLARE_FINAL_TYPE (FpDeviceEgis0570, fpi_device_egis0570, FPI, DEVICE_EGIS0570, FpImageDevice);
|
||||||
|
G_DEFINE_TYPE (FpDeviceEgis0570, fpi_device_egis0570, FP_TYPE_IMAGE_DEVICE);
|
||||||
|
|
||||||
|
static unsigned char
|
||||||
|
egis_get_pixel (struct fpi_frame_asmbl_ctx *ctx, struct fpi_frame *frame, unsigned int x, unsigned int y)
|
||||||
|
{
|
||||||
|
return frame->data[x + y * ctx->frame_width];
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct fpi_frame_asmbl_ctx assembling_ctx = {
|
||||||
|
.frame_width = EGIS0570_IMGWIDTH,
|
||||||
|
.frame_height = EGIS0570_RFMGHEIGHT,
|
||||||
|
.image_width = EGIS0570_IMGWIDTH * 4 / 3,
|
||||||
|
.get_pixel = egis_get_pixel,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Service
|
||||||
|
*/
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
is_last_pkt (FpDevice *dev)
|
||||||
|
{
|
||||||
|
FpDeviceEgis0570 *self = FPI_DEVICE_EGIS0570 (dev);
|
||||||
|
|
||||||
|
int type = self->pkt_type;
|
||||||
|
int num = self->pkt_num;
|
||||||
|
|
||||||
|
gboolean r;
|
||||||
|
|
||||||
|
r = ((type == PKT_TYPE_INIT) && (num == (EGIS0570_INIT_TOTAL - 1)));
|
||||||
|
r |= ((type == PKT_TYPE_REPEAT) && (num == (EGIS0570_REPEAT_TOTAL - 1)));
|
||||||
|
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns a bit for each frame on whether or not a finger has been detected.
|
||||||
|
* e.g. 00110 means that there is a finger in frame two and three.
|
||||||
|
*/
|
||||||
|
static char
|
||||||
|
postprocess_frames (FpDeviceEgis0570 *self, guint8 * img)
|
||||||
|
{
|
||||||
|
size_t mean[EGIS0570_IMGCOUNT] = {0, 0, 0, 0, 0};
|
||||||
|
|
||||||
|
if (!self->background)
|
||||||
|
{
|
||||||
|
self->background = g_malloc (EGIS0570_IMGWIDTH * EGIS0570_RFMGHEIGHT);
|
||||||
|
memset (self->background, 255, EGIS0570_IMGWIDTH * EGIS0570_RFMGHEIGHT);
|
||||||
|
|
||||||
|
for (size_t k = 0; k < EGIS0570_IMGCOUNT; k += 1)
|
||||||
|
{
|
||||||
|
guint8 * frame = &img[(k * EGIS0570_IMGSIZE) + EGIS0570_RFMDIS * EGIS0570_IMGWIDTH];
|
||||||
|
|
||||||
|
for (size_t i = 0; i < EGIS0570_IMGWIDTH * EGIS0570_RFMGHEIGHT; i += 1)
|
||||||
|
self->background[i] = MIN (self->background[i], frame[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t k = 0; k < EGIS0570_IMGCOUNT; k += 1)
|
||||||
|
{
|
||||||
|
guint8 * frame = &img[(k * EGIS0570_IMGSIZE) + EGIS0570_RFMDIS * EGIS0570_IMGWIDTH];
|
||||||
|
|
||||||
|
for (size_t i = 0; i < EGIS0570_IMGWIDTH * EGIS0570_RFMGHEIGHT; i += 1)
|
||||||
|
{
|
||||||
|
if (frame[i] - EGIS0570_MARGIN > self->background[i])
|
||||||
|
frame[i] -= self->background[i];
|
||||||
|
else
|
||||||
|
frame[i] = 0;
|
||||||
|
|
||||||
|
mean[k] += frame[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
mean[k] /= EGIS0570_IMGWIDTH * EGIS0570_RFMGHEIGHT;
|
||||||
|
}
|
||||||
|
|
||||||
|
char result = 0;
|
||||||
|
|
||||||
|
for (size_t k = 0; k < EGIS0570_IMGCOUNT; k += 1)
|
||||||
|
{
|
||||||
|
fp_dbg ("Finger status (picture number, mean) : %ld , %ld", k, mean[k]);
|
||||||
|
if (mean[k] > EGIS0570_MIN_MEAN)
|
||||||
|
result |= 1 << k;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Device communication
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void
|
||||||
|
data_resp_cb (FpiUsbTransfer *transfer, FpDevice *dev, gpointer user_data, GError *error)
|
||||||
|
{
|
||||||
|
unsigned char *stripdata;
|
||||||
|
gboolean end = FALSE;
|
||||||
|
FpImageDevice *img_self = FP_IMAGE_DEVICE (dev);
|
||||||
|
FpDeviceEgis0570 *self = FPI_DEVICE_EGIS0570 (dev);
|
||||||
|
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int where_finger_is = postprocess_frames (self, transfer->buffer);
|
||||||
|
|
||||||
|
if (where_finger_is > 0)
|
||||||
|
{
|
||||||
|
FpiImageDeviceState state;
|
||||||
|
|
||||||
|
fpi_image_device_report_finger_status (img_self, TRUE);
|
||||||
|
|
||||||
|
g_object_get (dev, "fpi-image-device-state", &state, NULL);
|
||||||
|
if (state == FPI_IMAGE_DEVICE_STATE_CAPTURE)
|
||||||
|
{
|
||||||
|
for (size_t k = 0; k < EGIS0570_IMGCOUNT; k += 1)
|
||||||
|
{
|
||||||
|
if (where_finger_is & (1 << k))
|
||||||
|
{
|
||||||
|
struct fpi_frame *stripe = g_malloc (EGIS0570_IMGWIDTH * EGIS0570_RFMGHEIGHT + sizeof (struct fpi_frame));
|
||||||
|
stripe->delta_x = 0;
|
||||||
|
stripe->delta_y = 0;
|
||||||
|
stripdata = stripe->data;
|
||||||
|
memcpy (stripdata, (transfer->buffer) + (((k) * EGIS0570_IMGSIZE) + EGIS0570_IMGWIDTH * EGIS0570_RFMDIS), EGIS0570_IMGWIDTH * EGIS0570_RFMGHEIGHT);
|
||||||
|
self->strips = g_slist_prepend (self->strips, stripe);
|
||||||
|
self->strips_len += 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
end = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
end = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (end)
|
||||||
|
{
|
||||||
|
if (!self->stop && (self->strips_len > 0))
|
||||||
|
{
|
||||||
|
g_autoptr(FpImage) img = 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_COLORS_INVERTED | FPI_IMAGE_PARTIAL);
|
||||||
|
g_slist_free_full (self->strips, g_free);
|
||||||
|
self->strips = NULL;
|
||||||
|
self->strips_len = 0;
|
||||||
|
FpImage *resizeImage = fpi_image_resize (img, EGIS0570_RESIZE, EGIS0570_RESIZE);
|
||||||
|
fpi_image_device_image_captured (img_self, g_steal_pointer (&resizeImage));
|
||||||
|
}
|
||||||
|
|
||||||
|
fpi_image_device_report_finger_status (img_self, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
fpi_ssm_next_state (transfer->ssm);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
recv_data_resp (FpiSsm *ssm, FpDevice *dev)
|
||||||
|
{
|
||||||
|
FpiUsbTransfer *transfer = fpi_usb_transfer_new (dev);
|
||||||
|
|
||||||
|
fpi_usb_transfer_fill_bulk (transfer, EGIS0570_EPIN, EGIS0570_INPSIZE);
|
||||||
|
|
||||||
|
transfer->ssm = ssm;
|
||||||
|
transfer->short_is_error = TRUE;
|
||||||
|
|
||||||
|
fpi_usb_transfer_submit (transfer, EGIS0570_TIMEOUT, NULL, data_resp_cb, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
cmd_resp_cb (FpiUsbTransfer *transfer, FpDevice *dev, gpointer user_data, GError *error)
|
||||||
|
{
|
||||||
|
if (error)
|
||||||
|
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
recv_cmd_resp (FpiSsm *ssm, FpDevice *dev)
|
||||||
|
{
|
||||||
|
FpiUsbTransfer *transfer = fpi_usb_transfer_new (dev);
|
||||||
|
|
||||||
|
fpi_usb_transfer_fill_bulk (transfer, EGIS0570_EPIN, EGIS0570_PKTSIZE);
|
||||||
|
|
||||||
|
transfer->ssm = ssm;
|
||||||
|
|
||||||
|
fpi_usb_transfer_submit (transfer, EGIS0570_TIMEOUT, NULL, cmd_resp_cb, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
send_cmd_req (FpiSsm *ssm, FpDevice *dev, unsigned char *pkt)
|
||||||
|
{
|
||||||
|
FpiUsbTransfer *transfer = fpi_usb_transfer_new (dev);
|
||||||
|
|
||||||
|
fpi_usb_transfer_fill_bulk_full (transfer, EGIS0570_EPOUT, pkt, EGIS0570_PKTSIZE, NULL);
|
||||||
|
|
||||||
|
transfer->ssm = ssm;
|
||||||
|
transfer->short_is_error = TRUE;
|
||||||
|
|
||||||
|
fpi_usb_transfer_submit (transfer, EGIS0570_TIMEOUT, NULL, fpi_ssm_usb_transfer_cb, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* SSM States
|
||||||
|
*/
|
||||||
|
|
||||||
|
enum sm_states {
|
||||||
|
SM_INIT,
|
||||||
|
SM_START,
|
||||||
|
SM_REQ,
|
||||||
|
SM_RESP,
|
||||||
|
SM_REC_DATA,
|
||||||
|
SM_DONE,
|
||||||
|
SM_STATES_NUM
|
||||||
|
};
|
||||||
|
|
||||||
|
static void
|
||||||
|
ssm_run_state (FpiSsm *ssm, FpDevice *dev)
|
||||||
|
{
|
||||||
|
FpDeviceEgis0570 *self = FPI_DEVICE_EGIS0570 (dev);
|
||||||
|
FpImageDevice *img_dev = FP_IMAGE_DEVICE (dev);
|
||||||
|
|
||||||
|
switch (fpi_ssm_get_cur_state (ssm))
|
||||||
|
{
|
||||||
|
case SM_INIT:
|
||||||
|
self->pkt_type = PKT_TYPE_INIT;
|
||||||
|
fpi_ssm_next_state (ssm);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SM_START:
|
||||||
|
if (self->stop)
|
||||||
|
{
|
||||||
|
fp_dbg ("deactivating, marking completed");
|
||||||
|
fpi_ssm_mark_completed (ssm);
|
||||||
|
fpi_image_device_deactivate_complete (img_dev, NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self->pkt_num = 0;
|
||||||
|
fpi_ssm_next_state (ssm);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SM_REQ:
|
||||||
|
if (self->pkt_type == PKT_TYPE_INIT)
|
||||||
|
send_cmd_req (ssm, dev, init_pkts[self->pkt_num]);
|
||||||
|
else
|
||||||
|
send_cmd_req (ssm, dev, repeat_pkts[self->pkt_num]);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SM_RESP:
|
||||||
|
if (is_last_pkt (dev) == FALSE)
|
||||||
|
{
|
||||||
|
recv_cmd_resp (ssm, dev);
|
||||||
|
self->pkt_num += 1;
|
||||||
|
fpi_ssm_jump_to_state (ssm, SM_REQ);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (self->pkt_type == PKT_TYPE_INIT)
|
||||||
|
self->pkt_type = PKT_TYPE_REPEAT;
|
||||||
|
|
||||||
|
fpi_ssm_next_state (ssm);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SM_REC_DATA:
|
||||||
|
recv_data_resp (ssm, dev);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SM_DONE:
|
||||||
|
fpi_ssm_jump_to_state (ssm, SM_START);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
g_assert_not_reached ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Activation
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void
|
||||||
|
loop_complete (FpiSsm *ssm, FpDevice *dev, GError *error)
|
||||||
|
{
|
||||||
|
FpImageDevice *img_dev = FP_IMAGE_DEVICE (dev);
|
||||||
|
FpDeviceEgis0570 *self = FPI_DEVICE_EGIS0570 (dev);
|
||||||
|
|
||||||
|
self->running = FALSE;
|
||||||
|
g_clear_pointer (&self->background, g_free);
|
||||||
|
|
||||||
|
if (error)
|
||||||
|
fpi_image_device_session_error (img_dev, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
dev_activate (FpImageDevice *dev)
|
||||||
|
{
|
||||||
|
FpDeviceEgis0570 *self = FPI_DEVICE_EGIS0570 (dev);
|
||||||
|
FpiSsm *ssm = fpi_ssm_new (FP_DEVICE (dev), ssm_run_state, SM_STATES_NUM);
|
||||||
|
|
||||||
|
self->stop = FALSE;
|
||||||
|
|
||||||
|
fpi_ssm_start (ssm, loop_complete);
|
||||||
|
|
||||||
|
self->running = TRUE;
|
||||||
|
|
||||||
|
fpi_image_device_activate_complete (dev, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Opening
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void
|
||||||
|
dev_init (FpImageDevice *dev)
|
||||||
|
{
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
|
g_usb_device_claim_interface (fpi_device_get_usb_device (FP_DEVICE (dev)), 0, 0, &error);
|
||||||
|
|
||||||
|
fpi_image_device_open_complete (dev, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Closing
|
||||||
|
*/
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Deactivation
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void
|
||||||
|
dev_deactivate (FpImageDevice *dev)
|
||||||
|
{
|
||||||
|
FpDeviceEgis0570 *self = FPI_DEVICE_EGIS0570 (dev);
|
||||||
|
|
||||||
|
if (self->running)
|
||||||
|
self->stop = TRUE;
|
||||||
|
else
|
||||||
|
fpi_image_device_deactivate_complete (dev, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Driver data
|
||||||
|
*/
|
||||||
|
|
||||||
|
static const FpIdEntry id_table[] = {
|
||||||
|
{ .vid = 0x1c7a, .pid = 0x0570, },
|
||||||
|
{ .vid = 0x1c7a, .pid = 0x0571, },
|
||||||
|
{ .vid = 0, .pid = 0, },
|
||||||
|
};
|
||||||
|
|
||||||
|
static void
|
||||||
|
fpi_device_egis0570_init (FpDeviceEgis0570 *self)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
fpi_device_egis0570_class_init (FpDeviceEgis0570Class *klass)
|
||||||
|
{
|
||||||
|
FpDeviceClass *dev_class = FP_DEVICE_CLASS (klass);
|
||||||
|
FpImageDeviceClass *img_class = FP_IMAGE_DEVICE_CLASS (klass);
|
||||||
|
|
||||||
|
dev_class->id = "egis0570";
|
||||||
|
dev_class->full_name = "Egis Technology Inc. (aka. LighTuning) 0570";
|
||||||
|
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 = EGIS0570_IMGWIDTH;
|
||||||
|
img_class->img_height = -1;
|
||||||
|
|
||||||
|
img_class->bz3_threshold = EGIS0570_BZ3_THRESHOLD; /* security issue */
|
||||||
|
}
|
||||||
@@ -0,0 +1,177 @@
|
|||||||
|
/*
|
||||||
|
* Egis Technology Inc. (aka. LighTuning) 0570 driver for libfprint
|
||||||
|
* Copyright (C) 2021 Maxim Kolesnikov <kolesnikov@svyazcom.ru>
|
||||||
|
* Copyright (C) 2021 Saeed/Ali Rk <saeed.ali.rahimi@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
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __EGIS0570_H
|
||||||
|
|
||||||
|
#define __EGIS0570_H 1
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Device data
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define EGIS0570_CONF 1
|
||||||
|
#define EGIS0570_INTF 0
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Device endpoints
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define EGIS0570_EPOUT 0x04 /* ( 4 | FPI_USB_ENDPOINT_OUT ) */
|
||||||
|
#define EGIS0570_EPIN 0x83 /* ( 3 | FPI_USB_ENDPOINT_IN ) */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Initialization packets (7 bytes each)
|
||||||
|
*
|
||||||
|
* First 4 bytes are equivalent to string "EGIS", which must be just a company identificator
|
||||||
|
* Other 3 bytes are not recognized yet and may be not important, as they are always the same
|
||||||
|
|
||||||
|
* Answers for each packet contain 7 bytes again
|
||||||
|
* First 4 bytes are reversed "EGIS", which is "SIGE", which is company ID again
|
||||||
|
* Other 3 bytes are not recognized yet
|
||||||
|
* But there is a pattern.
|
||||||
|
* Sending last packet makes sensor return image
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define EGIS0570_TIMEOUT 10000
|
||||||
|
#define EGIS0570_PKTSIZE 7
|
||||||
|
|
||||||
|
#define EGIS0570_INIT_TOTAL (sizeof ((init_pkts)) / sizeof ((init_pkts[0])))
|
||||||
|
|
||||||
|
static unsigned char init_pkts[][EGIS0570_PKTSIZE] =
|
||||||
|
{
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x20, 0x3f },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x58, 0x3f },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x21, 0x09 },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x57, 0x09 },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x22, 0x03 },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x56, 0x03 },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x23, 0x01 },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x55, 0x01 },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x24, 0x01 },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x54, 0x01 },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x16, 0x3e },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x09, 0x0b },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x14, 0x03 },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x15, 0x00 },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x02, 0x0f },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x10, 0x00 },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x11, 0x38 },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x12, 0x00 },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x13, 0x71 },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x03, 0x80 },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x00, 0x02, 0x80 },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x02, 0x2f },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x06, 0x00, 0xfe } /* image returned after this packet */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* There is another Packet !
|
||||||
|
* That just Work the same !!
|
||||||
|
* And the Size is different !!!
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
#define EGIS0570_INIT_TOTAL2 (sizeof((init_pkts2)) / sizeof((init_pkts2[0])))
|
||||||
|
|
||||||
|
static unsigned char init_pkts2[][EGIS0570_PKTSIZE] =
|
||||||
|
{
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x10, 0x00},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x11, 0x38},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x12, 0x00},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x13, 0x71},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x20, 0x3f},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x58, 0x3f},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x21, 0x07},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x57, 0x07},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x22, 0x02},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x56, 0x02},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x23, 0x00},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x55, 0x00},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x24, 0x00},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x54, 0x00},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x25, 0x00},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x53, 0x00},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x15, 0x00},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x16, 0x3b},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x09, 0x0a},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x14, 0x00},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x02, 0x0f},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x03, 0x80},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x00, 0x02, 0x80},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x01, 0x02, 0x2f},
|
||||||
|
{0x45, 0x47, 0x49, 0x53, 0x06, 0x00, 0xfe}
|
||||||
|
};
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* After sending initial packets device returns image data (32512 bytes)
|
||||||
|
* To ask device to send image data again, host needs to send four additional packets
|
||||||
|
* Further work is to repeatedly send four repeat packets and read image data
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define EGIS0570_INPSIZE 32512
|
||||||
|
|
||||||
|
/* 5 image with captured in different time of size 114 * 57 = 6498
|
||||||
|
* 5 * 6498 = 32490 plus 22 extra unrecognized char size data
|
||||||
|
* Two continuous image in this 5 images may have time delay of less than 20ms
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define EGIS0570_IMGSIZE 6498
|
||||||
|
#define EGIS0570_IMGWIDTH 114
|
||||||
|
#define EGIS0570_IMGHEIGHT 57
|
||||||
|
|
||||||
|
/* size of middle area that is used from each frame */
|
||||||
|
#define EGIS0570_RFMGHEIGHT 17
|
||||||
|
/* rows to ignore from top and bottom of the image*/
|
||||||
|
#define EGIS0570_RFMDIS (EGIS0570_IMGHEIGHT - EGIS0570_RFMGHEIGHT) / 2
|
||||||
|
#define EGIS0570_IMGCOUNT 5
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Image repeat request
|
||||||
|
* First 4 bytes are the same as in initialization packets
|
||||||
|
* Have no idea what the other 3 bytes mean
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define EGIS0570_REPEAT_TOTAL (sizeof ((repeat_pkts)) / sizeof ((repeat_pkts[0])))
|
||||||
|
|
||||||
|
static unsigned char repeat_pkts[][EGIS0570_PKTSIZE] =
|
||||||
|
{
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x02, 0x0f },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x00, 0x02, 0x0f },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x02, 0x2f },
|
||||||
|
{ 0x45, 0x47, 0x49, 0x53, 0x06, 0x00, 0xfe } /* image returned after this packet */
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This sensor is small so I decided to reduce bz3_threshold from
|
||||||
|
* 40 to 10 to have more success to fail ratio
|
||||||
|
* Bozorth3 Algorithm seems not fine at the end
|
||||||
|
* foreget about security :))
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define EGIS0570_BZ3_THRESHOLD 25 /* and even less What a joke */
|
||||||
|
|
||||||
|
#define EGIS0570_MIN_MEAN 20
|
||||||
|
#define EGIS0570_MARGIN 3
|
||||||
|
|
||||||
|
#define EGIS0570_RESIZE 2
|
||||||
|
|
||||||
|
#endif
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,222 @@
|
|||||||
|
/*
|
||||||
|
* Driver for Egis Technology (LighTuning) Match-On-Chip sensors
|
||||||
|
* Originally authored 2023 by Joshua Grisham <josh@joshuagrisham.com>
|
||||||
|
*
|
||||||
|
* Portions of code and logic inspired from the elanmoc libfprint driver
|
||||||
|
* which is copyright (C) 2021 Elan Microelectronics Inc (see elanmoc.c)
|
||||||
|
*
|
||||||
|
* Based on original reverse-engineering work by Joshua Grisham. The protocol has
|
||||||
|
* been reverse-engineered from captures of the official Windows driver, and by
|
||||||
|
* testing commands on the sensor with a multiplatform Python prototype driver:
|
||||||
|
* https://github.com/joshuagrisham/galaxy-book2-pro-linux/tree/main/fingerprint/
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
#include "fpi-device.h"
|
||||||
|
#include "fpi-ssm.h"
|
||||||
|
|
||||||
|
G_DECLARE_FINAL_TYPE (FpiDeviceEgisMoc, fpi_device_egismoc, FPI, DEVICE_EGISMOC, FpDevice)
|
||||||
|
|
||||||
|
#define EGISMOC_DRIVER_FULLNAME "Egis Technology (LighTuning) Match-on-Chip"
|
||||||
|
|
||||||
|
#define EGISMOC_DRIVER_CHECK_PREFIX_TYPE1 (1 << 0)
|
||||||
|
#define EGISMOC_DRIVER_CHECK_PREFIX_TYPE2 (1 << 1)
|
||||||
|
|
||||||
|
#define EGISMOC_EP_CMD_OUT (0x02 | FPI_USB_ENDPOINT_OUT)
|
||||||
|
#define EGISMOC_EP_CMD_IN (0x81 | FPI_USB_ENDPOINT_IN)
|
||||||
|
#define EGISMOC_EP_CMD_INTERRUPT_IN 0x83
|
||||||
|
|
||||||
|
#define EGISMOC_USB_CONTROL_TIMEOUT 5000
|
||||||
|
#define EGISMOC_USB_SEND_TIMEOUT 5000
|
||||||
|
#define EGISMOC_USB_RECV_TIMEOUT 5000
|
||||||
|
#define EGISMOC_USB_INTERRUPT_TIMEOUT 60000
|
||||||
|
|
||||||
|
#define EGISMOC_USB_IN_RECV_LENGTH 4096
|
||||||
|
#define EGISMOC_USB_INTERRUPT_IN_RECV_LENGTH 64
|
||||||
|
|
||||||
|
#define EGISMOC_ENROLL_TIMES 10
|
||||||
|
#define EGISMOC_MAX_ENROLL_NUM 10
|
||||||
|
#define EGISMOC_FINGERPRINT_DATA_SIZE 32
|
||||||
|
#define EGISMOC_LIST_RESPONSE_PREFIX_SIZE 14
|
||||||
|
#define EGISMOC_LIST_RESPONSE_SUFFIX_SIZE 2
|
||||||
|
|
||||||
|
/* standard prefixes for all read/writes */
|
||||||
|
|
||||||
|
static guchar egismoc_write_prefix[] = {'E', 'G', 'I', 'S', 0x00, 0x00, 0x00, 0x01};
|
||||||
|
static gsize egismoc_write_prefix_len = sizeof (egismoc_write_prefix) / sizeof (egismoc_write_prefix[0]);
|
||||||
|
|
||||||
|
static guchar egismoc_read_prefix[] = {'S', 'I', 'G', 'E', 0x00, 0x00, 0x00, 0x01};
|
||||||
|
static gsize egismoc_read_prefix_len = sizeof (egismoc_read_prefix) / sizeof (egismoc_read_prefix[0]);
|
||||||
|
|
||||||
|
|
||||||
|
/* hard-coded command payloads */
|
||||||
|
|
||||||
|
static guchar cmd_fw_version[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x0c};
|
||||||
|
static gsize cmd_fw_version_len = sizeof (cmd_fw_version) / sizeof (cmd_fw_version[0]);
|
||||||
|
static guchar rsp_fw_version_suffix[] = {0x90, 0x00};
|
||||||
|
static gsize rsp_fw_version_suffix_len = sizeof (rsp_fw_version_suffix) / sizeof (rsp_fw_version_suffix[0]);
|
||||||
|
|
||||||
|
static guchar cmd_list[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x19, 0x04, 0x00, 0x00, 0x01, 0x40};
|
||||||
|
static gsize cmd_list_len = sizeof (cmd_list) / sizeof (cmd_list[0]);
|
||||||
|
|
||||||
|
static guchar cmd_sensor_reset[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x1a, 0x00, 0x00};
|
||||||
|
static gsize cmd_sensor_reset_len = sizeof (cmd_sensor_reset) / sizeof (cmd_sensor_reset[0]);
|
||||||
|
|
||||||
|
static guchar cmd_sensor_check[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x17, 0x02, 0x00};
|
||||||
|
static gsize cmd_sensor_check_len = sizeof (cmd_sensor_check) / sizeof (cmd_sensor_check[0]);
|
||||||
|
|
||||||
|
static guchar cmd_sensor_identify[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x17, 0x01, 0x01};
|
||||||
|
static gsize cmd_sensor_identify_len = sizeof (cmd_sensor_identify) / sizeof (cmd_sensor_identify[0]);
|
||||||
|
static guchar rsp_identify_match_suffix[] = {0x90, 0x00};
|
||||||
|
static gsize rsp_identify_match_suffix_len = sizeof (rsp_identify_match_suffix) / sizeof (rsp_identify_match_suffix[0]);
|
||||||
|
static guchar rsp_identify_notmatch_suffix[] = {0x90, 0x04};
|
||||||
|
static gsize rsp_identify_notmatch_suffix_len = sizeof (rsp_identify_notmatch_suffix) / sizeof (rsp_identify_notmatch_suffix[0]);
|
||||||
|
|
||||||
|
static guchar cmd_sensor_enroll[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x17, 0x01, 0x00};
|
||||||
|
static gsize cmd_sensor_enroll_len = sizeof (cmd_sensor_enroll) / sizeof (cmd_sensor_enroll[0]);
|
||||||
|
|
||||||
|
static guchar cmd_enroll_starting[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x16, 0x01, 0x00, 0x00, 0x00, 0x20};
|
||||||
|
static gsize cmd_enroll_starting_len = sizeof (cmd_enroll_starting) / sizeof (cmd_enroll_starting[0]);
|
||||||
|
|
||||||
|
static guchar cmd_sensor_start_capture[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x16, 0x02, 0x01};
|
||||||
|
static gsize cmd_sensor_start_capture_len = sizeof (cmd_sensor_start_capture) / sizeof (cmd_sensor_start_capture[0]);
|
||||||
|
|
||||||
|
static guchar cmd_read_capture[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x16, 0x02, 0x02, 0x00, 0x00, 0x02};
|
||||||
|
static gsize cmd_read_capture_len = sizeof (cmd_read_capture) / sizeof (cmd_read_capture[0]);
|
||||||
|
static guchar rsp_read_success_prefix[] = {0x00, 0x00, 0x00, 0x04};
|
||||||
|
static gsize rsp_read_success_prefix_len = sizeof (rsp_read_success_prefix) / sizeof (rsp_read_success_prefix[0]);
|
||||||
|
static guchar rsp_read_success_suffix[] = {0x0a, 0x90, 0x00};
|
||||||
|
static gsize rsp_read_success_suffix_len = sizeof (rsp_read_success_suffix) / sizeof (rsp_read_success_suffix[0]);
|
||||||
|
static guchar rsp_read_offcenter_prefix[] = {0x00, 0x00, 0x00, 0x04};
|
||||||
|
static gsize rsp_read_offcenter_prefix_len = sizeof (rsp_read_offcenter_prefix) / sizeof (rsp_read_offcenter_prefix[0]);
|
||||||
|
static guchar rsp_read_offcenter_suffix[] = {0x0a, 0x64, 0x91};
|
||||||
|
static gsize rsp_read_offcenter_suffix_len = sizeof (rsp_read_offcenter_suffix) / sizeof (rsp_read_offcenter_suffix[0]);
|
||||||
|
static guchar rsp_read_dirty_prefix[] = {0x00, 0x00, 0x00, 0x02, 0x64};
|
||||||
|
static gsize rsp_read_dirty_prefix_len = sizeof (rsp_read_dirty_prefix) / sizeof (rsp_read_dirty_prefix[0]);
|
||||||
|
|
||||||
|
static guchar cmd_commit_starting[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x16, 0x05, 0x00, 0x00, 0x00, 0x20};
|
||||||
|
static gsize cmd_commit_starting_len = sizeof (cmd_commit_starting) / sizeof (cmd_commit_starting[0]);
|
||||||
|
|
||||||
|
|
||||||
|
/* commands which exist on the device but are currently not used */
|
||||||
|
/*
|
||||||
|
static guchar cmd_sensor_cancel[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x16, 0x04, 0x00};
|
||||||
|
static gsize cmd_sensor_cancel_len = sizeof(cmd_sensor_cancel) / sizeof(cmd_sensor_cancel[0]);
|
||||||
|
|
||||||
|
static guchar cmd_sensor_verify[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x04, 0x01, 0x00};
|
||||||
|
static gsize cmd_sensor_verify_len = sizeof(cmd_sensor_verify) / sizeof(cmd_sensor_verify[0]);
|
||||||
|
|
||||||
|
static guchar cmd_read_verify[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x04, 0x02, 0x00};
|
||||||
|
static gsize cmd_read_verify_len = sizeof(cmd_read_verify) / sizeof(cmd_read_verify[0]);
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* prefixes/suffixes and other things for dynamically created command payloads */
|
||||||
|
|
||||||
|
#define EGISMOC_CHECK_BYTES_LENGTH 2
|
||||||
|
#define EGISMOC_IDENTIFY_RESPONSE_PRINT_ID_OFFSET 46
|
||||||
|
#define EGISMOC_CMD_CHECK_SEPARATOR_LENGTH 32
|
||||||
|
|
||||||
|
static guchar cmd_new_print_prefix[] = {0x00, 0x00, 0x00, 0x27, 0x50, 0x16, 0x03, 0x00, 0x00, 0x00, 0x20};
|
||||||
|
static gsize cmd_new_print_prefix_len = sizeof (cmd_new_print_prefix) / sizeof (cmd_new_print_prefix[0]);
|
||||||
|
|
||||||
|
static guchar cmd_delete_prefix[] = {0x50, 0x18, 0x04, 0x00, 0x00};
|
||||||
|
static gsize cmd_delete_prefix_len = sizeof (cmd_delete_prefix) / sizeof (cmd_delete_prefix[0]);
|
||||||
|
static guchar rsp_delete_success_prefix[] = {0x00, 0x00, 0x00, 0x02, 0x90, 0x00};
|
||||||
|
static gsize rsp_delete_success_prefix_len = sizeof (rsp_delete_success_prefix) / sizeof (rsp_delete_success_prefix[0]);
|
||||||
|
|
||||||
|
static guchar cmd_check_prefix_type1[] = {0x50, 0x17, 0x03, 0x00, 0x00};
|
||||||
|
static gsize cmd_check_prefix_type1_len = sizeof (cmd_check_prefix_type1) / sizeof (cmd_check_prefix_type1[0]);
|
||||||
|
static guchar cmd_check_prefix_type2[] = {0x50, 0x17, 0x03, 0x80, 0x00};
|
||||||
|
static gsize cmd_check_prefix_type2_len = sizeof (cmd_check_prefix_type2) / sizeof (cmd_check_prefix_type2[0]);
|
||||||
|
static guchar cmd_check_suffix[] = {0x00, 0x40};
|
||||||
|
static gsize cmd_check_suffix_len = sizeof (cmd_check_suffix) / sizeof (cmd_check_suffix[0]);
|
||||||
|
static guchar rsp_check_not_yet_enrolled_suffix[] = {0x90, 0x04};
|
||||||
|
static gsize rsp_check_not_yet_enrolled_suffix_len = sizeof (rsp_check_not_yet_enrolled_suffix) / sizeof (rsp_check_not_yet_enrolled_suffix[0]);
|
||||||
|
|
||||||
|
|
||||||
|
/* SSM task states and various status enums */
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
CMD_SEND,
|
||||||
|
CMD_GET,
|
||||||
|
CMD_STATES,
|
||||||
|
} CommandStates;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
DEV_INIT_CONTROL1,
|
||||||
|
DEV_INIT_CONTROL2,
|
||||||
|
DEV_INIT_CONTROL3,
|
||||||
|
DEV_INIT_CONTROL4,
|
||||||
|
DEV_INIT_CONTROL5,
|
||||||
|
DEV_GET_FW_VERSION,
|
||||||
|
DEV_INIT_STATES,
|
||||||
|
} DeviceInitStates;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
IDENTIFY_GET_ENROLLED_IDS,
|
||||||
|
IDENTIFY_CHECK_ENROLLED_NUM,
|
||||||
|
IDENTIFY_SENSOR_RESET,
|
||||||
|
IDENTIFY_SENSOR_IDENTIFY,
|
||||||
|
IDENTIFY_WAIT_FINGER,
|
||||||
|
IDENTIFY_SENSOR_CHECK,
|
||||||
|
IDENTIFY_CHECK,
|
||||||
|
IDENTIFY_COMPLETE_SENSOR_RESET,
|
||||||
|
IDENTIFY_COMPLETE,
|
||||||
|
IDENTIFY_STATES,
|
||||||
|
} IdentifyStates;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
ENROLL_GET_ENROLLED_IDS,
|
||||||
|
ENROLL_CHECK_ENROLLED_NUM,
|
||||||
|
ENROLL_SENSOR_RESET,
|
||||||
|
ENROLL_SENSOR_ENROLL,
|
||||||
|
ENROLL_WAIT_FINGER,
|
||||||
|
ENROLL_SENSOR_CHECK,
|
||||||
|
ENROLL_CHECK,
|
||||||
|
ENROLL_START,
|
||||||
|
ENROLL_CAPTURE_SENSOR_RESET,
|
||||||
|
ENROLL_CAPTURE_SENSOR_START_CAPTURE,
|
||||||
|
ENROLL_CAPTURE_WAIT_FINGER,
|
||||||
|
ENROLL_CAPTURE_READ_RESPONSE,
|
||||||
|
ENROLL_COMMIT_START,
|
||||||
|
ENROLL_COMMIT,
|
||||||
|
ENROLL_COMMIT_SENSOR_RESET,
|
||||||
|
ENROLL_COMPLETE,
|
||||||
|
ENROLL_STATES,
|
||||||
|
} EnrollStates;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
ENROLL_STATUS_DEVICE_FULL,
|
||||||
|
ENROLL_STATUS_DUPLICATE,
|
||||||
|
ENROLL_STATUS_PARTIAL_OK,
|
||||||
|
ENROLL_STATUS_RETRY,
|
||||||
|
ENROLL_STATUS_COMPLETE,
|
||||||
|
} EnrollStatus;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
LIST_GET_ENROLLED_IDS,
|
||||||
|
LIST_RETURN_ENROLLED_PRINTS,
|
||||||
|
LIST_STATES,
|
||||||
|
} ListStates;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
DELETE_GET_ENROLLED_IDS,
|
||||||
|
DELETE_DELETE,
|
||||||
|
DELETE_STATES,
|
||||||
|
} DeleteStates;
|
||||||
+43
-133
@@ -73,22 +73,19 @@ struct _FpiDeviceElan
|
|||||||
/* end commands */
|
/* end commands */
|
||||||
|
|
||||||
/* state */
|
/* state */
|
||||||
gboolean deactivating;
|
gboolean active;
|
||||||
FpiImageDeviceState dev_state;
|
gboolean deactivating;
|
||||||
FpiImageDeviceState dev_state_next;
|
unsigned char *last_read;
|
||||||
unsigned char *last_read;
|
unsigned char calib_atts_left;
|
||||||
unsigned char calib_atts_left;
|
unsigned char calib_status;
|
||||||
unsigned char calib_status;
|
unsigned short *background;
|
||||||
unsigned short *background;
|
unsigned char frame_width;
|
||||||
unsigned char frame_width;
|
unsigned char frame_height;
|
||||||
unsigned char frame_height;
|
unsigned char raw_frame_height;
|
||||||
unsigned char raw_frame_height;
|
int num_frames;
|
||||||
int num_frames;
|
GSList *frames;
|
||||||
GSList *frames;
|
|
||||||
/* end state */
|
/* end state */
|
||||||
};
|
};
|
||||||
G_DECLARE_FINAL_TYPE (FpiDeviceElan, fpi_device_elan, FPI, DEVICE_ELAN,
|
|
||||||
FpImageDevice);
|
|
||||||
G_DEFINE_TYPE (FpiDeviceElan, fpi_device_elan, FP_TYPE_IMAGE_DEVICE);
|
G_DEFINE_TYPE (FpiDeviceElan, fpi_device_elan, FP_TYPE_IMAGE_DEVICE);
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@@ -360,7 +357,7 @@ elan_cmd_cb (FpiUsbTransfer *transfer, FpDevice *dev,
|
|||||||
if (transfer->endpoint & FPI_USB_ENDPOINT_IN)
|
if (transfer->endpoint & FPI_USB_ENDPOINT_IN)
|
||||||
{
|
{
|
||||||
/* just finished receiving */
|
/* just finished receiving */
|
||||||
self->last_read = g_memdup (transfer->buffer, transfer->actual_length);
|
self->last_read = g_memdup2 (transfer->buffer, transfer->actual_length);
|
||||||
elan_cmd_done (ssm);
|
elan_cmd_done (ssm);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -487,7 +484,7 @@ stop_capture_complete (FpiSsm *ssm, FpDevice *_dev, GError *error)
|
|||||||
|
|
||||||
|
|
||||||
/* The device is inactive at this point. */
|
/* The device is inactive at this point. */
|
||||||
self->dev_state = FPI_IMAGE_DEVICE_STATE_INACTIVE;
|
self->active = FALSE;
|
||||||
|
|
||||||
if (self->deactivating)
|
if (self->deactivating)
|
||||||
{
|
{
|
||||||
@@ -505,16 +502,14 @@ stop_capture_complete (FpiSsm *ssm, FpDevice *_dev, GError *error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
elan_stop_capture (FpDevice *dev)
|
elan_stop_capture (FpiDeviceElan *self)
|
||||||
{
|
{
|
||||||
FpiDeviceElan *self = FPI_DEVICE_ELAN (dev);
|
|
||||||
|
|
||||||
G_DEBUG_HERE ();
|
G_DEBUG_HERE ();
|
||||||
|
|
||||||
elan_dev_reset_state (self);
|
elan_dev_reset_state (self);
|
||||||
|
|
||||||
FpiSsm *ssm =
|
FpiSsm *ssm =
|
||||||
fpi_ssm_new (dev, stop_capture_run_state, STOP_CAPTURE_NUM_STATES);
|
fpi_ssm_new (FP_DEVICE (self), stop_capture_run_state, STOP_CAPTURE_NUM_STATES);
|
||||||
|
|
||||||
fpi_ssm_start (ssm, stop_capture_complete);
|
fpi_ssm_start (ssm, stop_capture_complete);
|
||||||
}
|
}
|
||||||
@@ -545,8 +540,6 @@ capture_run_state (FpiSsm *ssm, FpDevice *dev)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CAPTURE_READ_DATA:
|
case CAPTURE_READ_DATA:
|
||||||
self->dev_state = FPI_IMAGE_DEVICE_STATE_CAPTURE;
|
|
||||||
|
|
||||||
/* 0x55 - finger present
|
/* 0x55 - finger present
|
||||||
* 0xff - device not calibrated (probably) */
|
* 0xff - device not calibrated (probably) */
|
||||||
if (self->last_read && self->last_read[0] == 0x55)
|
if (self->last_read && self->last_read[0] == 0x55)
|
||||||
@@ -614,18 +607,21 @@ capture_complete (FpiSsm *ssm, FpDevice *_dev, GError *error)
|
|||||||
fpi_image_device_session_error (dev, error);
|
fpi_image_device_session_error (dev, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Note: We always stop capturing even if that may not be needed always.
|
||||||
|
* Doing this between captures appears to make it at least less likely for
|
||||||
|
* devices to end up in a bad state.
|
||||||
|
*/
|
||||||
|
elan_stop_capture (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
elan_capture (FpDevice *dev)
|
elan_capture (FpiDeviceElan *self)
|
||||||
{
|
{
|
||||||
FpiDeviceElan *self = FPI_DEVICE_ELAN (dev);
|
|
||||||
|
|
||||||
G_DEBUG_HERE ();
|
G_DEBUG_HERE ();
|
||||||
|
|
||||||
elan_dev_reset_state (self);
|
elan_dev_reset_state (self);
|
||||||
FpiSsm *ssm =
|
FpiSsm *ssm =
|
||||||
fpi_ssm_new (dev, capture_run_state, CAPTURE_NUM_STATES);
|
fpi_ssm_new (FP_DEVICE (self), capture_run_state, CAPTURE_NUM_STATES);
|
||||||
|
|
||||||
fpi_ssm_start (ssm, capture_complete);
|
fpi_ssm_start (ssm, capture_complete);
|
||||||
}
|
}
|
||||||
@@ -764,7 +760,7 @@ calibrate_run_state (FpiSsm *ssm, FpDevice *dev)
|
|||||||
if (self->calib_status == 0x00 &&
|
if (self->calib_status == 0x00 &&
|
||||||
self->last_read[0] == 0x01)
|
self->last_read[0] == 0x01)
|
||||||
self->calib_status = 0x01;
|
self->calib_status = 0x01;
|
||||||
fpi_ssm_next_state_delayed (ssm, 50, NULL);
|
fpi_ssm_next_state_delayed (ssm, 50);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -777,33 +773,31 @@ calibrate_run_state (FpiSsm *ssm, FpDevice *dev)
|
|||||||
static void
|
static void
|
||||||
calibrate_complete (FpiSsm *ssm, FpDevice *dev, GError *error)
|
calibrate_complete (FpiSsm *ssm, FpDevice *dev, GError *error)
|
||||||
{
|
{
|
||||||
FpiDeviceElan *self = FPI_DEVICE_ELAN (dev);
|
|
||||||
|
|
||||||
G_DEBUG_HERE ();
|
G_DEBUG_HERE ();
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
self->dev_state = FPI_IMAGE_DEVICE_STATE_INACTIVE;
|
|
||||||
fpi_image_device_session_error (FP_IMAGE_DEVICE (dev), error);
|
fpi_image_device_session_error (FP_IMAGE_DEVICE (dev), error);
|
||||||
|
elan_stop_capture (FPI_DEVICE_ELAN (dev));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
elan_capture (dev);
|
elan_capture (FPI_DEVICE_ELAN (dev));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
elan_calibrate (FpDevice *dev)
|
elan_calibrate (FpiDeviceElan *self)
|
||||||
{
|
{
|
||||||
FpiDeviceElan *self = FPI_DEVICE_ELAN (dev);
|
|
||||||
|
|
||||||
G_DEBUG_HERE ();
|
G_DEBUG_HERE ();
|
||||||
|
|
||||||
elan_dev_reset_state (self);
|
elan_dev_reset_state (self);
|
||||||
|
|
||||||
|
g_return_if_fail (!self->active);
|
||||||
|
self->active = TRUE;
|
||||||
self->calib_atts_left = ELAN_CALIBRATION_ATTEMPTS;
|
self->calib_atts_left = ELAN_CALIBRATION_ATTEMPTS;
|
||||||
|
|
||||||
FpiSsm *ssm = fpi_ssm_new (FP_DEVICE (dev), calibrate_run_state,
|
FpiSsm *ssm = fpi_ssm_new (FP_DEVICE (self), calibrate_run_state,
|
||||||
CALIBRATE_NUM_STATES);
|
CALIBRATE_NUM_STATES);
|
||||||
|
|
||||||
fpi_ssm_start (ssm, calibrate_complete);
|
fpi_ssm_start (ssm, calibrate_complete);
|
||||||
@@ -958,98 +952,19 @@ dev_activate (FpImageDevice *dev)
|
|||||||
elan_activate (dev);
|
elan_activate (dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
elan_change_state (FpImageDevice *idev)
|
|
||||||
{
|
|
||||||
FpDevice *dev = FP_DEVICE (idev);
|
|
||||||
FpiDeviceElan *self = FPI_DEVICE_ELAN (dev);
|
|
||||||
FpiImageDeviceState next_state = self->dev_state_next;
|
|
||||||
|
|
||||||
if (self->dev_state == next_state)
|
|
||||||
{
|
|
||||||
fp_dbg ("already in %d", next_state);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fp_dbg ("changing to %d", next_state);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (next_state)
|
|
||||||
{
|
|
||||||
case FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON:
|
|
||||||
/* activation completed or another enroll stage started */
|
|
||||||
self->dev_state = FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON;
|
|
||||||
elan_calibrate (dev);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case FPI_IMAGE_DEVICE_STATE_CAPTURE:
|
|
||||||
/* not used */
|
|
||||||
break;
|
|
||||||
|
|
||||||
case FPI_IMAGE_DEVICE_STATE_INACTIVE:
|
|
||||||
case FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF:
|
|
||||||
elan_stop_capture (dev);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
elan_change_state_async (FpDevice *dev,
|
|
||||||
void *data)
|
|
||||||
{
|
|
||||||
fp_dbg ("state change dev: %p", dev);
|
|
||||||
elan_change_state (FP_IMAGE_DEVICE (dev));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dev_change_state (FpImageDevice *dev, FpiImageDeviceState state)
|
dev_change_state (FpImageDevice *dev, FpiImageDeviceState state)
|
||||||
{
|
{
|
||||||
FpiDeviceElan *self = FPI_DEVICE_ELAN (dev);
|
FpiDeviceElan *self = FPI_DEVICE_ELAN (dev);
|
||||||
GSource *timeout;
|
|
||||||
|
|
||||||
G_DEBUG_HERE ();
|
G_DEBUG_HERE ();
|
||||||
|
|
||||||
/* Inactive and await finger off are equivalent for the elan driver. */
|
/* Note: We always calibrate even if that may not be needed always.
|
||||||
if (state == FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF)
|
* Doing this for each capture appears to make it at least less likely for
|
||||||
state = FPI_IMAGE_DEVICE_STATE_INACTIVE;
|
* devices to end up in a bad state.
|
||||||
|
*/
|
||||||
if (self->dev_state_next == state)
|
if (state == FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON)
|
||||||
{
|
elan_calibrate (self);
|
||||||
fp_dbg ("change to state %d already queued", state);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (state)
|
|
||||||
{
|
|
||||||
case FPI_IMAGE_DEVICE_STATE_INACTIVE:
|
|
||||||
case FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON:
|
|
||||||
case FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF: {
|
|
||||||
char *name;
|
|
||||||
|
|
||||||
/* schedule state change instead of calling it directly to allow all actions
|
|
||||||
* related to the previous state to complete */
|
|
||||||
self->dev_state_next = state;
|
|
||||||
timeout = fpi_device_add_timeout (FP_DEVICE (dev), 10,
|
|
||||||
elan_change_state_async,
|
|
||||||
NULL, NULL);
|
|
||||||
|
|
||||||
name = g_strdup_printf ("dev_change_state to %d", state);
|
|
||||||
g_source_set_name (timeout, name);
|
|
||||||
g_free (name);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case FPI_IMAGE_DEVICE_STATE_CAPTURE:
|
|
||||||
/* TODO MAYBE: split capture ssm into smaller ssms and use this state */
|
|
||||||
self->dev_state = state;
|
|
||||||
self->dev_state_next = state;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
g_assert_not_reached ();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1059,19 +974,14 @@ dev_deactivate (FpImageDevice *dev)
|
|||||||
|
|
||||||
G_DEBUG_HERE ();
|
G_DEBUG_HERE ();
|
||||||
|
|
||||||
if (self->dev_state == FPI_IMAGE_DEVICE_STATE_INACTIVE)
|
if (!self->active)
|
||||||
{
|
/* The device is inactive already, complete the operation immediately. */
|
||||||
/* The device is inactive already, complete the operation immediately. */
|
fpi_image_device_deactivate_complete (dev, NULL);
|
||||||
fpi_image_device_deactivate_complete (dev, NULL);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
/* The device is not yet inactive, flag that we are deactivating (and
|
||||||
/* The device is not yet inactive, flag that we are deactivating (and
|
* need to signal back deactivation).
|
||||||
* need to signal back deactivation) and then ensure we will change
|
* Note that any running capture will be cancelled already if needed. */
|
||||||
* to the inactive state eventually. */
|
self->deactivating = TRUE;
|
||||||
self->deactivating = TRUE;
|
|
||||||
dev_change_state (dev, FPI_IMAGE_DEVICE_STATE_INACTIVE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@@ -70,6 +70,9 @@
|
|||||||
#define ELAN_CMD_TIMEOUT 10000
|
#define ELAN_CMD_TIMEOUT 10000
|
||||||
#define ELAN_FINGER_TIMEOUT 200
|
#define ELAN_FINGER_TIMEOUT 200
|
||||||
|
|
||||||
|
G_DECLARE_FINAL_TYPE (FpiDeviceElan, fpi_device_elan, FPI, DEVICE_ELAN,
|
||||||
|
FpImageDevice);
|
||||||
|
|
||||||
struct elan_cmd
|
struct elan_cmd
|
||||||
{
|
{
|
||||||
unsigned char cmd[ELAN_CMD_LEN];
|
unsigned char cmd[ELAN_CMD_LEN];
|
||||||
@@ -210,7 +213,14 @@ static const FpIdEntry elan_id_table[] = {
|
|||||||
{.vid = ELAN_VEND_ID, .pid = 0x0c31, .driver_data = ELAN_ALL_DEV},
|
{.vid = ELAN_VEND_ID, .pid = 0x0c31, .driver_data = ELAN_ALL_DEV},
|
||||||
{.vid = ELAN_VEND_ID, .pid = 0x0c32, .driver_data = ELAN_ALL_DEV},
|
{.vid = ELAN_VEND_ID, .pid = 0x0c32, .driver_data = ELAN_ALL_DEV},
|
||||||
{.vid = ELAN_VEND_ID, .pid = 0x0c33, .driver_data = ELAN_ALL_DEV},
|
{.vid = ELAN_VEND_ID, .pid = 0x0c33, .driver_data = ELAN_ALL_DEV},
|
||||||
|
{.vid = ELAN_VEND_ID, .pid = 0x0c3d, .driver_data = ELAN_ALL_DEV},
|
||||||
{.vid = ELAN_VEND_ID, .pid = 0x0c42, .driver_data = ELAN_0C42},
|
{.vid = ELAN_VEND_ID, .pid = 0x0c42, .driver_data = ELAN_0C42},
|
||||||
|
{.vid = ELAN_VEND_ID, .pid = 0x0c4b, .driver_data = ELAN_ALL_DEV},
|
||||||
|
{.vid = ELAN_VEND_ID, .pid = 0x0c4d, .driver_data = ELAN_ALL_DEV},
|
||||||
|
{.vid = ELAN_VEND_ID, .pid = 0x0c4f, .driver_data = ELAN_ALL_DEV},
|
||||||
|
{.vid = ELAN_VEND_ID, .pid = 0x0c63, .driver_data = ELAN_ALL_DEV},
|
||||||
|
{.vid = ELAN_VEND_ID, .pid = 0x0c6e, .driver_data = ELAN_ALL_DEV},
|
||||||
|
{.vid = ELAN_VEND_ID, .pid = 0x0c58, .driver_data = ELAN_ALL_DEV},
|
||||||
{.vid = 0, .pid = 0, .driver_data = 0},
|
{.vid = 0, .pid = 0, .driver_data = 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -218,8 +228,8 @@ static void elan_cmd_done (FpiSsm *ssm);
|
|||||||
static void elan_cmd_read (FpiSsm *ssm,
|
static void elan_cmd_read (FpiSsm *ssm,
|
||||||
FpDevice *dev);
|
FpDevice *dev);
|
||||||
|
|
||||||
static void elan_calibrate (FpDevice *dev);
|
static void elan_calibrate (FpiDeviceElan *self);
|
||||||
static void elan_capture (FpDevice *dev);
|
static void elan_capture (FpiDeviceElan *self);
|
||||||
|
|
||||||
static void dev_change_state (FpImageDevice *dev,
|
static void dev_change_state (FpImageDevice *dev,
|
||||||
FpiImageDeviceState state);
|
FpiImageDeviceState state);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,196 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2021 Elan Microelectronics
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
#include "fpi-device.h"
|
||||||
|
#include "fpi-ssm.h"
|
||||||
|
#include <libusb.h>
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
G_DECLARE_FINAL_TYPE (FpiDeviceElanmoc, fpi_device_elanmoc, FPI, DEVICE_ELANMOC, FpDevice)
|
||||||
|
|
||||||
|
#define ELAN_MOC_DRIVER_FULLNAME "Elan MOC Sensors"
|
||||||
|
#define ELAN_M0C_CMD_LEN 0x3
|
||||||
|
#define ELAN_EP_CMD_OUT (0x1 | LIBUSB_ENDPOINT_OUT)
|
||||||
|
#define ELAN_EP_CMD_IN (0x3 | LIBUSB_ENDPOINT_IN)
|
||||||
|
#define ELAN_EP_MOC_CMD_IN (0x4 | LIBUSB_ENDPOINT_IN)
|
||||||
|
#define ELAN_EP_IMG_IN (0x2 | LIBUSB_ENDPOINT_IN)
|
||||||
|
|
||||||
|
#define ELAN_MOC_CMD_TIMEOUT 5000
|
||||||
|
#define ELAN_MOC_CAL_RETRY 500
|
||||||
|
#define ELAN_MOC_ENROLL_TIMES 9
|
||||||
|
#define ELAN_MAX_USER_ID_LEN 92
|
||||||
|
#define ELAN_MAX_ENROLL_NUM 9
|
||||||
|
|
||||||
|
#define ELAN_MSG_VERIFY_ERR 0xfd
|
||||||
|
#define ELAN_MSG_DIRTY 0xfb
|
||||||
|
#define ELAN_MSG_AREA_NOT_ENOUGH 0xfe
|
||||||
|
#define ELAN_MSG_TOO_HIGH 0x41
|
||||||
|
#define ELAN_MSG_TOO_LEFT 0x42
|
||||||
|
#define ELAN_MSG_TOO_LOW 0x43
|
||||||
|
#define ELAN_MSG_TOO_RIGHT 0x44
|
||||||
|
#define ELAN_MSG_OK 0x00
|
||||||
|
|
||||||
|
#define ELAN_MAX_HDR_LEN 3
|
||||||
|
#define ELAN_USERDATE_SIZE (ELAN_MAX_USER_ID_LEN + 3)
|
||||||
|
|
||||||
|
#define ELAN_MSG_DRIVER_VERSION "1004"
|
||||||
|
|
||||||
|
struct elanmoc_cmd
|
||||||
|
{
|
||||||
|
unsigned char cmd_header[ELAN_MAX_HDR_LEN];
|
||||||
|
int cmd_len;
|
||||||
|
int resp_len;
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanmoc_cmd fw_ver_cmd = {
|
||||||
|
.cmd_header = {0x40, 0x19},
|
||||||
|
.cmd_len = 2,
|
||||||
|
.resp_len = 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanmoc_cmd sensor_dim_cmd = {
|
||||||
|
.cmd_header = {0x00, 0x0c},
|
||||||
|
.cmd_len = 2,
|
||||||
|
.resp_len = 4,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanmoc_cmd cal_status_cmd = {
|
||||||
|
.cmd_header = {0x40, 0xff, 0x00},
|
||||||
|
.cmd_len = 3,
|
||||||
|
.resp_len = 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanmoc_cmd enrolled_number_cmd = {
|
||||||
|
.cmd_header = {0x40, 0xff, 0x04},
|
||||||
|
.cmd_len = 3,
|
||||||
|
.resp_len = 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanmoc_cmd elanmoc_verify_cmd = {
|
||||||
|
.cmd_header = {0x40, 0xff, 0x73},
|
||||||
|
.cmd_len = 5,
|
||||||
|
.resp_len = 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanmoc_cmd elanmoc_above_cmd = {
|
||||||
|
.cmd_header = {0x40, 0xff, 0x02},
|
||||||
|
.cmd_len = 3,
|
||||||
|
.resp_len = 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanmoc_cmd elanmoc_enroll_cmd = {
|
||||||
|
.cmd_header = {0x40, 0xff, 0x01},
|
||||||
|
.cmd_len = 7,
|
||||||
|
.resp_len = 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanmoc_cmd elanmoc_delete_cmd = {
|
||||||
|
.cmd_header = {0x40, 0xff, 0x13},
|
||||||
|
.cmd_len = 128,
|
||||||
|
.resp_len = 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanmoc_cmd elanmoc_enroll_commit_cmd = {
|
||||||
|
.cmd_header = {0x40, 0xff, 0x11},
|
||||||
|
.cmd_len = 128,
|
||||||
|
.resp_len = 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanmoc_cmd elanmoc_remove_all_cmd = {
|
||||||
|
.cmd_header = {0x40, 0xff, 0x98},
|
||||||
|
.cmd_len = 3,
|
||||||
|
.resp_len = 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanmoc_cmd elanmoc_get_userid_cmd = {
|
||||||
|
.cmd_header = {0x43, 0x21, 0x00},
|
||||||
|
.cmd_len = 3,
|
||||||
|
.resp_len = 97,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanmoc_cmd elanmoc_set_mod_cmd = {
|
||||||
|
.cmd_header = {0x40, 0xff, 0x14},
|
||||||
|
.cmd_len = 4,
|
||||||
|
.resp_len = 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanmoc_cmd elanmoc_check_reenroll_cmd = {
|
||||||
|
.cmd_header = {0x40, 0xff, 0x22},
|
||||||
|
.cmd_len = 3 + ELAN_USERDATE_SIZE,
|
||||||
|
.resp_len = 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef void (*ElanCmdMsgCallback) (FpiDeviceElanmoc *self,
|
||||||
|
GError *error);
|
||||||
|
|
||||||
|
enum moc_enroll_states {
|
||||||
|
MOC_ENROLL_GET_ENROLLED_NUM,
|
||||||
|
MOC_ENROLL_REENROLL_CHECK,
|
||||||
|
MOC_ENROLL_WAIT_FINGER,
|
||||||
|
MOC_ENROLL_COMMIT_RESULT,
|
||||||
|
MOC_ENROLL_NUM_STATES,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum moc_list_states {
|
||||||
|
MOC_LIST_GET_ENROLLED,
|
||||||
|
MOC_LIST_GET_FINGER,
|
||||||
|
MOC_LIST_NUM_STATES,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum delete_states {
|
||||||
|
DELETE_SEND_CMD,
|
||||||
|
DELETE_NUM_STATES,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum dev_init_states {
|
||||||
|
DEV_WAIT_READY,
|
||||||
|
DEV_SET_MODE,
|
||||||
|
DEV_GET_VER,
|
||||||
|
DEV_GET_DIM,
|
||||||
|
DEV_GET_ENROLLED,
|
||||||
|
DEV_INIT_STATES,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum dev_exit_states {
|
||||||
|
DEV_EXIT_ABOVE,
|
||||||
|
DEV_EXIT_STATES,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _FpiDeviceElanmoc
|
||||||
|
{
|
||||||
|
FpDevice parent;
|
||||||
|
FpiSsm *task_ssm;
|
||||||
|
FpiSsm *cmd_ssm;
|
||||||
|
FpiUsbTransfer *cmd_transfer;
|
||||||
|
gboolean cmd_cancelable;
|
||||||
|
gsize cmd_len_in;
|
||||||
|
unsigned short fw_ver;
|
||||||
|
unsigned char x_trace;
|
||||||
|
unsigned char y_trace;
|
||||||
|
int num_frames;
|
||||||
|
int curr_enrolled;
|
||||||
|
int max_moc_enroll_time;
|
||||||
|
int cancel_result;
|
||||||
|
int cmd_retry_cnt;
|
||||||
|
int list_index;
|
||||||
|
GPtrArray *list_result;
|
||||||
|
};
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,382 @@
|
|||||||
|
/*
|
||||||
|
* Elan SPI driver for libfprint
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 Matthew Mirvish <matthew@mm12.xyz>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
#ifndef HAVE_UDEV
|
||||||
|
#error "elanspi requires udev"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <fp-device.h>
|
||||||
|
#include <fpi-device.h>
|
||||||
|
|
||||||
|
#define ELANSPI_TP_PID 0x04f3
|
||||||
|
|
||||||
|
/* Sensor ID information copied from the windows driver */
|
||||||
|
|
||||||
|
struct elanspi_sensor_entry
|
||||||
|
{
|
||||||
|
unsigned char sensor_id, height, width, ic_version;
|
||||||
|
gboolean is_otp_model;
|
||||||
|
const gchar * name;
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanspi_sensor_entry elanspi_sensor_table[] = {
|
||||||
|
{0x0, 0x78, 0x78, 0x0, 0x0, "eFSA120S"},
|
||||||
|
{0x1, 0x78, 0x78, 0x1, 0x1, "eFSA120SA"},
|
||||||
|
{0x2, 0xA0, 0xA0, 0x0, 0x0, "eFSA160S"},
|
||||||
|
{0x3, 0xd0, 0x50, 0x0, 0x0, "eFSA820R"},
|
||||||
|
{0x4, 0xC0, 0x38, 0x0, 0x0, "eFSA519R"},
|
||||||
|
{0x5, 0x60, 0x60, 0x0, 0x0, "eFSA96S"},
|
||||||
|
{0x6, 0x60, 0x60, 0x1, 0x1, "eFSA96SA"},
|
||||||
|
{0x7, 0x60, 0x60, 0x2, 0x1, "eFSA96SB"},
|
||||||
|
{0x8, 0xa0, 0x50, 0x1, 0x1, "eFSA816RA"},
|
||||||
|
{0x9, 0x90, 0x40, 0x1, 0x1, "eFSA614RA"},
|
||||||
|
{0xA, 0x90, 0x40, 0x2, 0x1, "eFSA614RB"},
|
||||||
|
{0xB, 0x40, 0x58, 0x1, 0x1, "eFSA688RA"},
|
||||||
|
{0xC, 0x50, 0x50, 0x1, 0x0, "eFSA80SA"},
|
||||||
|
{0xD, 0x47, 0x80, 0x1, 0x1, "eFSA712RA"},
|
||||||
|
{0xE, 0x50, 0x50, 0x2, 0x0, "eFSA80SC"},
|
||||||
|
{0, 0, 0, 0, 0, NULL}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct elanspi_reg_entry
|
||||||
|
{
|
||||||
|
unsigned char addr, value;
|
||||||
|
/* terminates with 0xFF, 0xFF since register 0x0 is valid */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct elanspi_regtable
|
||||||
|
{
|
||||||
|
const struct elanspi_reg_entry *other;
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
unsigned char sid;
|
||||||
|
const struct elanspi_reg_entry *table;
|
||||||
|
} entries[];
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanspi_reg_entry elanspi_calibration_table_default[] = {
|
||||||
|
{0x05, 0x60},
|
||||||
|
{0x06, 0xc0},
|
||||||
|
{0x07, 0x80},
|
||||||
|
{0x08, 0x04},
|
||||||
|
{0x0a, 0x97},
|
||||||
|
{0x0b, 0x72},
|
||||||
|
{0x0c, 0x69},
|
||||||
|
{0x0f, 0x2a},
|
||||||
|
{0x11, 0x2a},
|
||||||
|
{0x13, 0x27},
|
||||||
|
{0x15, 0x67},
|
||||||
|
{0x18, 0x04},
|
||||||
|
{0x21, 0x20},
|
||||||
|
{0x22, 0x36},
|
||||||
|
{0x2a, 0x5f},
|
||||||
|
{0x2b, 0xc0},
|
||||||
|
{0x2e, 0xff},
|
||||||
|
|
||||||
|
{0xff, 0xff}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanspi_reg_entry elanspi_calibration_table_id6[] = {
|
||||||
|
{0x2A, 0x07},
|
||||||
|
{0x1, 0x00},
|
||||||
|
{0x2, 0x5f},
|
||||||
|
{0x3, 0x00},
|
||||||
|
{0x4, 0x5f},
|
||||||
|
{0x5, 0x60},
|
||||||
|
{0x6, 0xC0},
|
||||||
|
{0x7, 0x80},
|
||||||
|
{0x8, 0x04},
|
||||||
|
{0xA, 0x97},
|
||||||
|
{0xB, 0x72},
|
||||||
|
{0xC, 0x69},
|
||||||
|
{0xF, 0x2A},
|
||||||
|
{0x11, 0x2A},
|
||||||
|
{0x13, 0x27},
|
||||||
|
{0x15, 0x67},
|
||||||
|
{0x18, 0x04},
|
||||||
|
{0x21, 0x20},
|
||||||
|
{0x22, 0x36},
|
||||||
|
{0x29, 0x02},
|
||||||
|
{0x2A, 0x03},
|
||||||
|
{0x2A, 0x5F},
|
||||||
|
{0x2B, 0xC0},
|
||||||
|
{0x2C, 0x10},
|
||||||
|
{0x2E, 0xFF},
|
||||||
|
|
||||||
|
{0xff, 0xff}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanspi_reg_entry elanspi_calibration_table_id57[] = {
|
||||||
|
{0x2A, 0x07},
|
||||||
|
{0x5, 0x60},
|
||||||
|
{0x6, 0xC0},
|
||||||
|
{0x7, 0x80},
|
||||||
|
{0x8, 0x04},
|
||||||
|
{0xA, 0x97},
|
||||||
|
{0xB, 0x72},
|
||||||
|
{0xC, 0x69},
|
||||||
|
{0xF, 0x2A},
|
||||||
|
{0x11, 0x2A},
|
||||||
|
{0x13, 0x27},
|
||||||
|
{0x15, 0x67},
|
||||||
|
{0x18, 0x04},
|
||||||
|
{0x21, 0x20},
|
||||||
|
{0x22, 0x36},
|
||||||
|
{0x2A, 0x5F},
|
||||||
|
{0x2B, 0xC0},
|
||||||
|
{0x2E, 0xFF},
|
||||||
|
|
||||||
|
{0xff, 0xff}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanspi_reg_entry elanspi_calibration_table_id0[] = {
|
||||||
|
{0x5, 0x60},
|
||||||
|
{0x6, 0xC0},
|
||||||
|
{0x8, 0x04},
|
||||||
|
{0xA, 0x97},
|
||||||
|
{0xB, 0x72},
|
||||||
|
{0xC, 0x69},
|
||||||
|
{0xF, 0x2B},
|
||||||
|
{0x11, 0x2B},
|
||||||
|
{0x13, 0x28},
|
||||||
|
{0x15, 0x28},
|
||||||
|
{0x18, 0x04},
|
||||||
|
{0x21, 0x20},
|
||||||
|
{0x2A, 0x4B},
|
||||||
|
|
||||||
|
{0xff, 0xff}
|
||||||
|
};
|
||||||
|
|
||||||
|
// old style sensor calibration, with only one page of registers
|
||||||
|
static const struct elanspi_regtable elanspi_calibration_table_old = {
|
||||||
|
.other = elanspi_calibration_table_default,
|
||||||
|
.entries = {
|
||||||
|
{ .sid = 0x0, .table = elanspi_calibration_table_id0 },
|
||||||
|
{ .sid = 0x5, .table = elanspi_calibration_table_id57 },
|
||||||
|
{ .sid = 0x6, .table = elanspi_calibration_table_id6 },
|
||||||
|
{ .sid = 0x7, .table = elanspi_calibration_table_id57 },
|
||||||
|
{ .sid = 0x0, .table = NULL }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// new style sensor calibration, with two pages of registers
|
||||||
|
static const struct elanspi_reg_entry elanspi_calibration_table_page0_id14[] = {
|
||||||
|
{0x00, 0x5a},
|
||||||
|
{0x01, 0x00},
|
||||||
|
{0x02, 0x4f},
|
||||||
|
{0x03, 0x00},
|
||||||
|
{0x04, 0x4f},
|
||||||
|
{0x05, 0xa0},
|
||||||
|
{0x06, 0x00},
|
||||||
|
{0x07, 0x00},
|
||||||
|
{0x08, 0x00},
|
||||||
|
{0x09, 0x04},
|
||||||
|
{0x0a, 0x74},
|
||||||
|
{0x0b, 0x05},
|
||||||
|
{0x0c, 0x08},
|
||||||
|
{0x0d, 0x00},
|
||||||
|
{0x0e, 0x00},
|
||||||
|
{0x0f, 0x14},
|
||||||
|
{0x10, 0x3c},
|
||||||
|
{0x11, 0x41},
|
||||||
|
{0x12, 0x0c},
|
||||||
|
{0x13, 0x00},
|
||||||
|
{0x14, 0x00},
|
||||||
|
{0x15, 0x04},
|
||||||
|
{0x16, 0x02},
|
||||||
|
{0x17, 0x00},
|
||||||
|
{0x18, 0x01},
|
||||||
|
{0x19, 0xf4},
|
||||||
|
{0x1a, 0x00},
|
||||||
|
{0x1b, 0x00},
|
||||||
|
{0x1c, 0x00},
|
||||||
|
{0x1d, 0x00},
|
||||||
|
{0x1e, 0x00},
|
||||||
|
{0x1f, 0x00},
|
||||||
|
{0x20, 0x00},
|
||||||
|
{0x21, 0x80},
|
||||||
|
{0x22, 0x06},
|
||||||
|
{0x23, 0x00},
|
||||||
|
{0x24, 0x00},
|
||||||
|
{0x25, 0x00},
|
||||||
|
{0x26, 0x00},
|
||||||
|
{0x27, 0x00},
|
||||||
|
{0x28, 0x00},
|
||||||
|
{0x29, 0x04},
|
||||||
|
{0x2a, 0x5f},
|
||||||
|
{0x2b, 0xe2},
|
||||||
|
{0x2c, 0xa0},
|
||||||
|
{0x2d, 0x00},
|
||||||
|
{0x2e, 0xff},
|
||||||
|
{0x2f, 0x40},
|
||||||
|
{0x30, 0x01},
|
||||||
|
{0x31, 0x38},
|
||||||
|
{0x32, 0x00},
|
||||||
|
{0x33, 0x00},
|
||||||
|
{0x34, 0x00},
|
||||||
|
{0x35, 0x1f},
|
||||||
|
{0x36, 0xff},
|
||||||
|
{0x37, 0x00},
|
||||||
|
{0x38, 0x00},
|
||||||
|
{0x39, 0x00},
|
||||||
|
{0x3a, 0x00},
|
||||||
|
{0xff, 0xff}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanspi_reg_entry elanspi_calibration_table_page1_id14[] = {
|
||||||
|
{0x00, 0x7b},
|
||||||
|
{0x01, 0x7f},
|
||||||
|
{0x02, 0x77},
|
||||||
|
{0x03, 0xd4},
|
||||||
|
{0x04, 0x7d},
|
||||||
|
{0x05, 0x19},
|
||||||
|
{0x06, 0x80},
|
||||||
|
{0x07, 0x40},
|
||||||
|
{0x08, 0x11},
|
||||||
|
{0x09, 0x00},
|
||||||
|
{0x0a, 0x00},
|
||||||
|
{0x0b, 0x14},
|
||||||
|
{0x0c, 0x00},
|
||||||
|
{0x0d, 0x00},
|
||||||
|
{0x0e, 0x32},
|
||||||
|
{0x0f, 0x02},
|
||||||
|
{0x10, 0x08},
|
||||||
|
{0x11, 0x6c},
|
||||||
|
{0x12, 0x00},
|
||||||
|
{0x13, 0x00},
|
||||||
|
{0x14, 0x32},
|
||||||
|
{0x15, 0x01},
|
||||||
|
{0x16, 0x16},
|
||||||
|
{0x17, 0x01},
|
||||||
|
{0x18, 0x14},
|
||||||
|
{0x19, 0x01},
|
||||||
|
{0x1a, 0x16},
|
||||||
|
{0x1b, 0x01},
|
||||||
|
{0x1c, 0x17},
|
||||||
|
{0x1d, 0x01},
|
||||||
|
{0x1e, 0x0a},
|
||||||
|
{0x1f, 0x01},
|
||||||
|
{0x20, 0x0a},
|
||||||
|
{0x21, 0x02},
|
||||||
|
{0x22, 0x08},
|
||||||
|
{0x23, 0x29},
|
||||||
|
{0x24, 0x00},
|
||||||
|
{0x25, 0x0c},
|
||||||
|
{0x26, 0x1a},
|
||||||
|
{0x27, 0x30},
|
||||||
|
{0x28, 0x1a},
|
||||||
|
{0x29, 0x30},
|
||||||
|
{0x2a, 0x00},
|
||||||
|
{0x2b, 0x00},
|
||||||
|
{0x2c, 0x01},
|
||||||
|
{0x2d, 0x16},
|
||||||
|
{0x2e, 0x01},
|
||||||
|
{0x2f, 0x17},
|
||||||
|
{0x30, 0x03},
|
||||||
|
{0x31, 0x2d},
|
||||||
|
{0x32, 0x03},
|
||||||
|
{0x33, 0x2d},
|
||||||
|
{0x34, 0x14},
|
||||||
|
{0x35, 0x00},
|
||||||
|
{0x36, 0x00},
|
||||||
|
{0x37, 0x00},
|
||||||
|
{0x38, 0x00},
|
||||||
|
{0x39, 0x03},
|
||||||
|
{0x3a, 0xfe},
|
||||||
|
{0x3b, 0x00},
|
||||||
|
{0x3c, 0x00},
|
||||||
|
{0x3d, 0x02},
|
||||||
|
{0x3e, 0x00},
|
||||||
|
{0x3f, 0x00},
|
||||||
|
{0xff, 0xff}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanspi_regtable elanspi_calibration_table_new_page0 = {
|
||||||
|
.other = NULL,
|
||||||
|
.entries = {
|
||||||
|
{ .sid = 0xe, .table = elanspi_calibration_table_page0_id14 },
|
||||||
|
{ .sid = 0x0, .table = NULL }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct elanspi_regtable elanspi_calibration_table_new_page1 = {
|
||||||
|
.other = NULL,
|
||||||
|
.entries = {
|
||||||
|
{ .sid = 0xe, .table = elanspi_calibration_table_page1_id14 },
|
||||||
|
{ .sid = 0x0, .table = NULL }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#define ELANSPI_NO_ROTATE 0
|
||||||
|
#define ELANSPI_90LEFT_ROTATE 1
|
||||||
|
#define ELANSPI_180_ROTATE 2
|
||||||
|
#define ELANSPI_90RIGHT_ROTATE 3
|
||||||
|
|
||||||
|
#define ELANSPI_HV_FLIPPED 1
|
||||||
|
|
||||||
|
#define ELANSPI_UDEV_TYPES FPI_DEVICE_UDEV_SUBTYPE_SPIDEV | FPI_DEVICE_UDEV_SUBTYPE_HIDRAW
|
||||||
|
#define ELANSPI_TP_VID 0x04f3
|
||||||
|
|
||||||
|
// using checkargs ACPI:HIDPID
|
||||||
|
static const FpIdEntry elanspi_id_table[] = {
|
||||||
|
{.udev_types = ELANSPI_UDEV_TYPES, .spi_acpi_id = "ELAN7001", .hid_id = {.vid = ELANSPI_TP_VID, .pid = 0x3057}, .driver_data = ELANSPI_180_ROTATE},
|
||||||
|
{.udev_types = ELANSPI_UDEV_TYPES, .spi_acpi_id = "ELAN7001", .hid_id = {.vid = ELANSPI_TP_VID, .pid = 0x3087}, .driver_data = ELANSPI_180_ROTATE},
|
||||||
|
{.udev_types = ELANSPI_UDEV_TYPES, .spi_acpi_id = "ELAN7001", .hid_id = {.vid = ELANSPI_TP_VID, .pid = 0x30c6}, .driver_data = ELANSPI_180_ROTATE},
|
||||||
|
{.udev_types = ELANSPI_UDEV_TYPES, .spi_acpi_id = "ELAN70A1", .hid_id = {.vid = ELANSPI_TP_VID, .pid = 0x3134}, .driver_data = ELANSPI_90LEFT_ROTATE},
|
||||||
|
{.udev_types = ELANSPI_UDEV_TYPES, .spi_acpi_id = "ELAN7001", .hid_id = {.vid = ELANSPI_TP_VID, .pid = 0x3148}, .driver_data = ELANSPI_180_ROTATE},
|
||||||
|
{.udev_types = ELANSPI_UDEV_TYPES, .spi_acpi_id = "ELAN7001", .hid_id = {.vid = ELANSPI_TP_VID, .pid = 0x30b2}, .driver_data = ELANSPI_NO_ROTATE},
|
||||||
|
{.udev_types = ELANSPI_UDEV_TYPES, .spi_acpi_id = "ELAN70A1", .hid_id = {.vid = ELANSPI_TP_VID, .pid = 0x30b2}, .driver_data = ELANSPI_NO_ROTATE},
|
||||||
|
{.udev_types = ELANSPI_UDEV_TYPES, .spi_acpi_id = "ELAN7001", .hid_id = {.vid = ELANSPI_TP_VID, .pid = 0x309f}, .driver_data = ELANSPI_180_ROTATE},
|
||||||
|
{.udev_types = ELANSPI_UDEV_TYPES, .spi_acpi_id = "ELAN7001", .hid_id = {.vid = ELANSPI_TP_VID, .pid = 0x241f}, .driver_data = ELANSPI_NO_ROTATE},
|
||||||
|
{.udev_types = 0}
|
||||||
|
};
|
||||||
|
|
||||||
|
#define ELANSPI_MAX_OLD_STAGE1_CALIBRATION_MEAN 1000
|
||||||
|
|
||||||
|
#define ELANSPI_MIN_OLD_STAGE2_CALBIRATION_MEAN 3000
|
||||||
|
#define ELANSPI_MAX_OLD_STAGE2_CALBIRATION_MEAN 8000
|
||||||
|
|
||||||
|
#define ELANSPI_HV_CALIBRATION_TARGET_MEAN 3000
|
||||||
|
|
||||||
|
#define ELANSPI_MIN_EMPTY_INVALID_PERCENT 6
|
||||||
|
#define ELANSPI_MAX_REAL_INVALID_PERCENT 3
|
||||||
|
|
||||||
|
#define ELANSPI_MIN_REAL_STDDEV (592 * 592)
|
||||||
|
#define ELANSPI_MAX_EMPTY_STDDEV (350 * 350)
|
||||||
|
|
||||||
|
#define ELANSPI_MIN_FRAMES_DEBOUNCE 2
|
||||||
|
|
||||||
|
#define ELANSPI_SWIPE_FRAMES_DISCARD 1
|
||||||
|
#define ELANSPI_MIN_FRAMES_SWIPE (7 + ELANSPI_SWIPE_FRAMES_DISCARD)
|
||||||
|
#define ELANSPI_MAX_FRAMES_SWIPE (20 + ELANSPI_SWIPE_FRAMES_DISCARD)
|
||||||
|
|
||||||
|
#define ELANSPI_MAX_FRAME_HEIGHT 43
|
||||||
|
#define ELANSPI_MIN_FRAME_TO_FRAME_DIFF (250 * 250)
|
||||||
|
|
||||||
|
#define ELANSPI_HV_SENSOR_FRAME_DELAY 23
|
||||||
|
|
||||||
|
#define ELANSPI_OTP_TIMEOUT_USEC (12 * 1000)
|
||||||
|
|
||||||
|
#define ELANSPI_OLD_CAPTURE_TIMEOUT_USEC (100 * 1000)
|
||||||
|
#define ELANSPI_HV_CAPTURE_TIMEOUT_USEC (50 * 1000)
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2021 Focaltech Microelectronics
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
#include "fpi-device.h"
|
||||||
|
#include "fpi-ssm.h"
|
||||||
|
#include <libusb.h>
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
G_DECLARE_FINAL_TYPE (FpiDeviceFocaltechMoc, fpi_device_focaltech_moc, FPI, DEVICE_FOCALTECH_MOC, FpDevice)
|
||||||
|
|
||||||
|
#define FOCALTECH_MOC_DRIVER_FULLNAME "Focaltech MOC Sensors"
|
||||||
|
|
||||||
|
#define FOCALTECH_MOC_CMD_TIMEOUT 1000
|
||||||
|
#define FOCALTECH_MOC_MAX_FINGERS 10
|
||||||
|
#define FOCALTECH_MOC_UID_PREFIX_LENGTH 8
|
||||||
|
#define FOCALTECH_MOC_USER_ID_LENGTH 64
|
||||||
|
|
||||||
|
typedef void (*FocaltechCmdMsgCallback) (FpiDeviceFocaltechMoc *self,
|
||||||
|
GError *error);
|
||||||
|
|
||||||
|
struct _FpiDeviceFocaltechMoc
|
||||||
|
{
|
||||||
|
FpDevice parent;
|
||||||
|
FpiSsm *task_ssm;
|
||||||
|
FpiSsm *cmd_ssm;
|
||||||
|
FpiUsbTransfer *cmd_transfer;
|
||||||
|
gboolean cmd_cancelable;
|
||||||
|
gsize cmd_len_in;
|
||||||
|
int num_frames;
|
||||||
|
int delete_slot;
|
||||||
|
guint8 bulk_in_ep;
|
||||||
|
guint8 bulk_out_ep;
|
||||||
|
};
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,221 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2022 Fingerprint Cards AB <tech@fingerprints.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
|
||||||
|
|
||||||
|
#include "fpi-device.h"
|
||||||
|
#include "fpi-ssm.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#define TEMPLATE_ID_SIZE (32)
|
||||||
|
#define MAX_FW_VERSION_STR_LEN (16)
|
||||||
|
#define FPC_CMD_INIT (0x01)
|
||||||
|
#define FPC_CMD_ARM (0x02)
|
||||||
|
#define FPC_CMD_ABORT (0x03)
|
||||||
|
#define FPC_CMD_INDICATE_S_STATE (0x08)
|
||||||
|
#define FPC_CMD_GET_IMG (0x09)
|
||||||
|
#define FPC_CMD_GET_KPI (0x0C)
|
||||||
|
#define FPC_CMD_LOAD_DB (0x60)
|
||||||
|
#define FPC_CMD_STORE_DB (0x61)
|
||||||
|
#define FPC_CMD_DELETE_DB (0x62)
|
||||||
|
#define FPC_CMD_DELETE_TEMPLATE (0x63)
|
||||||
|
#define FPC_CMD_BEGIN_ENROL (0x67)
|
||||||
|
#define FPC_CMD_ENROL (0x68)
|
||||||
|
#define FPC_CMD_END_ENROL (0x69)
|
||||||
|
#define FPC_CMD_BIND_IDENTITY (0x6A)
|
||||||
|
#define FPC_CMD_IDENTIFY (0x6B)
|
||||||
|
#define FPC_CMD_ENUM (0x70)
|
||||||
|
#define FPC_EVT_INIT_RESULT (0x02)
|
||||||
|
#define FPC_EVT_FINGER_DWN (0x06)
|
||||||
|
#define FPC_EVT_IMG (0x08)
|
||||||
|
#define FPC_EVT_FID_DATA (0x31)
|
||||||
|
#define FPC_DB_ID_LEN (16)
|
||||||
|
#define FPC_IDENTITY_TYPE_WILDCARD (0x1)
|
||||||
|
#define FPC_IDENTITY_TYPE_RESERVED (0x3)
|
||||||
|
#define FPC_IDENTITY_WILDCARD (0x25066282)
|
||||||
|
#define FPC_SUBTYPE_ANY (0xFF)
|
||||||
|
#define FPC_SUBTYPE_RESERVED (0xF5)
|
||||||
|
#define FPC_SUBTYPE_NOINFORMATION (0x00)
|
||||||
|
#define FPC_CAPTUREID_RESERVED (0x701100F)
|
||||||
|
#define FPC_SESSIONID_RESERVED (0x0077FF12)
|
||||||
|
#define FPC_TEMPLATES_MAX (10)
|
||||||
|
#define SECURITY_MAX_SID_SIZE (68)
|
||||||
|
#define FPC_HOST_MS_S0 (0x10)
|
||||||
|
#define FPC_HOST_MS_SX (0x11)
|
||||||
|
|
||||||
|
G_DECLARE_FINAL_TYPE (FpiDeviceFpcMoc, fpi_device_fpcmoc, FPI,
|
||||||
|
DEVICE_FPCMOC, FpDevice);
|
||||||
|
|
||||||
|
typedef struct _FPC_FID_DATA
|
||||||
|
{
|
||||||
|
guint32 identity_type;
|
||||||
|
guint32 reserved;
|
||||||
|
guint32 identity_size;
|
||||||
|
guint32 subfactor;
|
||||||
|
guint8 data[SECURITY_MAX_SID_SIZE];
|
||||||
|
} FPC_FID_DATA, *PFPC_FID_DATA;
|
||||||
|
|
||||||
|
typedef struct _FPC_LOAD_DB
|
||||||
|
{
|
||||||
|
gint32 status;
|
||||||
|
guint32 reserved;
|
||||||
|
guint32 database_id_size;
|
||||||
|
guint8 data[FPC_DB_ID_LEN];
|
||||||
|
} FPC_LOAD_DB, *PFPC_LOAD_DB;
|
||||||
|
|
||||||
|
typedef union _FPC_DELETE_DB
|
||||||
|
{
|
||||||
|
guint32 reserved;
|
||||||
|
guint32 database_id_size;
|
||||||
|
guint8 data[FPC_DB_ID_LEN];
|
||||||
|
} FPC_DB_OP, *PFPC_DB_OP;
|
||||||
|
|
||||||
|
typedef struct _FPC_BEGIN_ENROL
|
||||||
|
{
|
||||||
|
gint32 status;
|
||||||
|
guint32 reserved1;
|
||||||
|
guint32 reserved2;
|
||||||
|
} FPC_BEGIN_ENROL, *PFPC_BEGIN_ENROL;
|
||||||
|
|
||||||
|
typedef struct _FPC_ENROL
|
||||||
|
{
|
||||||
|
gint32 status;
|
||||||
|
guint32 remaining;
|
||||||
|
} FPC_ENROL, *PFPC_ENROL;
|
||||||
|
|
||||||
|
typedef struct _FPC_END_ENROL
|
||||||
|
{
|
||||||
|
gint32 status;
|
||||||
|
guint32 fid;
|
||||||
|
} FPC_END_ENROL, *PFPC_END_ENROL;
|
||||||
|
|
||||||
|
typedef struct _FPC_IDENTIFY
|
||||||
|
{
|
||||||
|
gint32 status;
|
||||||
|
guint32 identity_type;
|
||||||
|
guint32 identity_offset;
|
||||||
|
guint32 identity_size;
|
||||||
|
guint32 subfactor;
|
||||||
|
guint8 data[SECURITY_MAX_SID_SIZE];
|
||||||
|
} FPC_IDENTIFY, *PFPC_IDENTIFY;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
guint32 cmdid;
|
||||||
|
guint32 length;
|
||||||
|
guint32 status;
|
||||||
|
} evt_hdr_t;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
evt_hdr_t hdr;
|
||||||
|
guint16 sensor;
|
||||||
|
guint16 hw_id;
|
||||||
|
guint16 img_w;
|
||||||
|
guint16 img_h;
|
||||||
|
guint8 fw_version[MAX_FW_VERSION_STR_LEN];
|
||||||
|
guint16 fw_capabilities;
|
||||||
|
} evt_initiated_t;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
guint8 subfactor;
|
||||||
|
guint32 identity_type;
|
||||||
|
guint32 identity_size;
|
||||||
|
guint8 identity[SECURITY_MAX_SID_SIZE];
|
||||||
|
} __attribute__((packed)) fpc_fid_data_t;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
evt_hdr_t hdr;
|
||||||
|
gint status;
|
||||||
|
guint32 num_ids;
|
||||||
|
fpc_fid_data_t fid_data[FPC_TEMPLATES_MAX];
|
||||||
|
} __attribute__((packed)) evt_enum_fids_t;
|
||||||
|
|
||||||
|
typedef struct _fp_cmd_response
|
||||||
|
{
|
||||||
|
union
|
||||||
|
{
|
||||||
|
evt_hdr_t evt_hdr;
|
||||||
|
evt_initiated_t evt_inited;
|
||||||
|
evt_enum_fids_t evt_enum_fids;
|
||||||
|
};
|
||||||
|
} fpc_cmd_response_t, *pfpc_cmd_response_t;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
FPC_ENROL_STATUS_COMPLETED = 0,
|
||||||
|
FPC_ENROL_STATUS_PROGRESS = 1,
|
||||||
|
FPC_ENROL_STATUS_FAILED_COULD_NOT_COMPLETE = 2,
|
||||||
|
FPC_ENROL_STATUS_FAILED_ALREADY_ENROLED = 3,
|
||||||
|
FPC_ENROL_STATUS_IMAGE_LOW_COVERAGE = 4,
|
||||||
|
FPC_ENROL_STATUS_IMAGE_TOO_SIMILAR = 5,
|
||||||
|
FPC_ENROL_STATUS_IMAGE_LOW_QUALITY = 6,
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
FPC_CMDTYPE_UNKNOWN = 0,
|
||||||
|
FPC_CMDTYPE_TO_DEVICE,
|
||||||
|
FPC_CMDTYPE_TO_DEVICE_EVTDATA,
|
||||||
|
FPC_CMDTYPE_FROM_DEVICE,
|
||||||
|
} FpcCmdType;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
FP_CMD_SEND = 0,
|
||||||
|
FP_CMD_GET_DATA,
|
||||||
|
FP_CMD_SUSPENDED,
|
||||||
|
FP_CMD_RESUME,
|
||||||
|
FP_CMD_NUM_STATES,
|
||||||
|
} FpCmdState;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
FP_INIT = 0,
|
||||||
|
FP_LOAD_DB,
|
||||||
|
FP_INIT_NUM_STATES,
|
||||||
|
} FpInitState;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
FP_ENROLL_ENUM = 0,
|
||||||
|
FP_ENROLL_CREATE,
|
||||||
|
FP_ENROLL_CAPTURE,
|
||||||
|
FP_ENROLL_GET_IMG,
|
||||||
|
FP_ENROLL_UPDATE,
|
||||||
|
FP_ENROLL_COMPLETE,
|
||||||
|
FP_ENROLL_CHECK_DUPLICATE,
|
||||||
|
FP_ENROLL_BINDID,
|
||||||
|
FP_ENROLL_COMMIT,
|
||||||
|
FP_ENROLL_DICARD,
|
||||||
|
FP_ENROLL_CLEANUP,
|
||||||
|
FP_ENROLL_NUM_STATES,
|
||||||
|
} FpEnrollState;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
FP_VERIFY_CAPTURE = 0,
|
||||||
|
FP_VERIFY_GET_IMG,
|
||||||
|
FP_VERIFY_IDENTIFY,
|
||||||
|
FP_VERIFY_CANCEL,
|
||||||
|
FP_VERIFY_NUM_STATES,
|
||||||
|
} FpVerifyState;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
FP_CLEAR_DELETE_DB = 0,
|
||||||
|
FP_CLEAR_CREATE_DB,
|
||||||
|
FP_CLEAR_NUM_STATES,
|
||||||
|
} FpClearState;
|
||||||
@@ -53,10 +53,10 @@ struct _FpiDeviceGoodixMoc
|
|||||||
pgxfp_sensor_cfg_t sensorcfg;
|
pgxfp_sensor_cfg_t sensorcfg;
|
||||||
gint enroll_stage;
|
gint enroll_stage;
|
||||||
gint max_enroll_stage;
|
gint max_enroll_stage;
|
||||||
GCancellable *cancellable;
|
gint max_stored_prints;
|
||||||
GPtrArray *list_result;
|
GPtrArray *list_result;
|
||||||
guint8 template_id[TEMPLATE_ID_SIZE];
|
guint8 template_id[TEMPLATE_ID_SIZE];
|
||||||
gboolean is_enroll_identify;
|
gboolean is_power_button_shield_on;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -78,6 +78,44 @@ static gboolean parse_print_data (GVariant *data,
|
|||||||
gsize *tid_len,
|
gsize *tid_len,
|
||||||
const guint8 **user_id,
|
const guint8 **user_id,
|
||||||
gsize *user_id_len);
|
gsize *user_id_len);
|
||||||
|
|
||||||
|
static FpPrint *
|
||||||
|
fp_print_from_template (FpiDeviceGoodixMoc *self, template_format_t *template)
|
||||||
|
{
|
||||||
|
FpPrint *print;
|
||||||
|
GVariant *data;
|
||||||
|
GVariant *tid;
|
||||||
|
GVariant *uid;
|
||||||
|
g_autofree gchar *userid = NULL;
|
||||||
|
|
||||||
|
userid = g_strndup ((gchar *) template->payload.data, template->payload.size);
|
||||||
|
|
||||||
|
print = fp_print_new (FP_DEVICE (self));
|
||||||
|
|
||||||
|
tid = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
|
||||||
|
template->tid,
|
||||||
|
TEMPLATE_ID_SIZE,
|
||||||
|
1);
|
||||||
|
|
||||||
|
uid = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
|
||||||
|
template->payload.data,
|
||||||
|
template->payload.size,
|
||||||
|
1);
|
||||||
|
|
||||||
|
data = g_variant_new ("(y@ay@ay)",
|
||||||
|
template->finger_index,
|
||||||
|
tid,
|
||||||
|
uid);
|
||||||
|
|
||||||
|
fpi_print_set_type (print, FPI_PRINT_RAW);
|
||||||
|
fpi_print_set_device_stored (print, TRUE);
|
||||||
|
g_object_set (print, "fpi-data", data, NULL);
|
||||||
|
g_object_set (print, "description", userid, NULL);
|
||||||
|
fpi_print_fill_from_user_id (print, userid);
|
||||||
|
|
||||||
|
return print;
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
*
|
*
|
||||||
* fp_cmd_xxx Function
|
* fp_cmd_xxx Function
|
||||||
@@ -121,12 +159,12 @@ fp_cmd_receive_cb (FpiUsbTransfer *transfer,
|
|||||||
{
|
{
|
||||||
fpi_ssm_mark_failed (transfer->ssm,
|
fpi_ssm_mark_failed (transfer->ssm,
|
||||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||||
"Corrupted message received"));
|
"Corrupted message header received"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gx_proto_crc32_calc (transfer->buffer, PACKAGE_HEADER_SIZE + header.len, (uint8_t *) &crc32_calc);
|
gx_proto_crc32_calc (transfer->buffer, PACKAGE_HEADER_SIZE + header.len, (uint8_t *) &crc32_calc);
|
||||||
if(crc32_calc != *(uint32_t *) (transfer->buffer + PACKAGE_HEADER_SIZE + header.len))
|
if(crc32_calc != GUINT32_FROM_LE (*(uint32_t *) (transfer->buffer + PACKAGE_HEADER_SIZE + header.len)))
|
||||||
{
|
{
|
||||||
fpi_ssm_mark_failed (transfer->ssm,
|
fpi_ssm_mark_failed (transfer->ssm,
|
||||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||||
@@ -218,7 +256,7 @@ fp_cmd_run_state (FpiSsm *ssm,
|
|||||||
fpi_usb_transfer_fill_bulk (transfer, EP_IN, EP_IN_MAX_BUF_SIZE);
|
fpi_usb_transfer_fill_bulk (transfer, EP_IN, EP_IN_MAX_BUF_SIZE);
|
||||||
fpi_usb_transfer_submit (transfer,
|
fpi_usb_transfer_submit (transfer,
|
||||||
self->cmd_cancelable ? 0 : DATA_TIMEOUT,
|
self->cmd_cancelable ? 0 : DATA_TIMEOUT,
|
||||||
self->cmd_cancelable ? self->cancellable : NULL,
|
self->cmd_cancelable ? fpi_device_get_cancellable (dev) : NULL,
|
||||||
fp_cmd_receive_cb,
|
fp_cmd_receive_cb,
|
||||||
fpi_ssm_get_data (ssm));
|
fpi_ssm_get_data (ssm));
|
||||||
break;
|
break;
|
||||||
@@ -308,6 +346,35 @@ goodix_sensor_cmd (FpiDeviceGoodixMoc *self,
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
*
|
||||||
|
* fp_pwr_btn_shield_cb Function
|
||||||
|
*
|
||||||
|
*****************************************************************************/
|
||||||
|
static void
|
||||||
|
fp_pwr_btn_shield_cb (FpiDeviceGoodixMoc *self,
|
||||||
|
gxfp_cmd_response_t *resp,
|
||||||
|
GError *error)
|
||||||
|
{
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
fpi_ssm_mark_failed (self->task_ssm, error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (resp->result >= GX_FAILED)
|
||||||
|
{
|
||||||
|
fp_dbg ("Setting power button shield failed, result: 0x%x", resp->result);
|
||||||
|
fpi_ssm_mark_failed (self->task_ssm,
|
||||||
|
fpi_device_retry_new (FP_DEVICE_RETRY_GENERAL));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (resp->power_button_shield_resp.resp_cmd1 == MOC_CMD1_PWR_BTN_SHIELD_ON)
|
||||||
|
self->is_power_button_shield_on = true;
|
||||||
|
else
|
||||||
|
self->is_power_button_shield_on = false;
|
||||||
|
fpi_ssm_next_state (self->task_ssm);
|
||||||
|
}
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
*
|
*
|
||||||
* fp_verify_xxxx Function
|
* fp_verify_xxxx Function
|
||||||
@@ -330,7 +397,9 @@ fp_verify_capture_cb (FpiDeviceGoodixMoc *self,
|
|||||||
fpi_device_retry_new (FP_DEVICE_RETRY_GENERAL));
|
fpi_device_retry_new (FP_DEVICE_RETRY_GENERAL));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
fpi_device_report_finger_status_changes (FP_DEVICE (self),
|
||||||
|
FP_FINGER_STATUS_PRESENT,
|
||||||
|
FP_FINGER_STATUS_NONE);
|
||||||
if (resp->capture_data_resp.img_quality == 0)
|
if (resp->capture_data_resp.img_quality == 0)
|
||||||
{
|
{
|
||||||
fpi_ssm_mark_failed (self->task_ssm,
|
fpi_ssm_mark_failed (self->task_ssm,
|
||||||
@@ -341,6 +410,7 @@ fp_verify_capture_cb (FpiDeviceGoodixMoc *self,
|
|||||||
{
|
{
|
||||||
fpi_ssm_mark_failed (self->task_ssm,
|
fpi_ssm_mark_failed (self->task_ssm,
|
||||||
fpi_device_retry_new (FP_DEVICE_RETRY_CENTER_FINGER));
|
fpi_device_retry_new (FP_DEVICE_RETRY_CENTER_FINGER));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
fpi_ssm_next_state (self->task_ssm);
|
fpi_ssm_next_state (self->task_ssm);
|
||||||
}
|
}
|
||||||
@@ -351,10 +421,8 @@ fp_verify_cb (FpiDeviceGoodixMoc *self,
|
|||||||
GError *error)
|
GError *error)
|
||||||
{
|
{
|
||||||
FpDevice *device = FP_DEVICE (self);
|
FpDevice *device = FP_DEVICE (self);
|
||||||
FpPrint *print = NULL;
|
FpPrint *new_scan = NULL;
|
||||||
GPtrArray *templates = NULL;
|
FpPrint *matching = NULL;
|
||||||
gint cnt = 0;
|
|
||||||
gboolean find = false;
|
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
@@ -363,60 +431,36 @@ fp_verify_cb (FpiDeviceGoodixMoc *self,
|
|||||||
}
|
}
|
||||||
if (resp->verify.match)
|
if (resp->verify.match)
|
||||||
{
|
{
|
||||||
|
new_scan = fp_print_from_template (self, &resp->verify.template);
|
||||||
|
|
||||||
if (fpi_device_get_current_action (device) == FPI_DEVICE_ACTION_VERIFY)
|
if (fpi_device_get_current_action (device) == FPI_DEVICE_ACTION_VERIFY)
|
||||||
{
|
{
|
||||||
|
fpi_device_get_verify_data (device, &matching);
|
||||||
templates = g_ptr_array_new_with_free_func (g_object_unref);
|
if (!fp_print_equal (matching, new_scan))
|
||||||
fpi_device_get_verify_data (device, &print);
|
matching = NULL;
|
||||||
g_ptr_array_add (templates, g_object_ref_sink (print));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
GPtrArray *templates = NULL;
|
||||||
fpi_device_get_identify_data (device, &templates);
|
fpi_device_get_identify_data (device, &templates);
|
||||||
}
|
|
||||||
for (cnt = 0; cnt < templates->len; cnt++)
|
|
||||||
{
|
|
||||||
g_autoptr(GVariant) data = NULL;
|
|
||||||
guint8 finger;
|
|
||||||
const guint8 *user_id;
|
|
||||||
gsize user_id_len = 0;
|
|
||||||
const guint8 *tid;
|
|
||||||
gsize tid_len = 0;
|
|
||||||
print = g_ptr_array_index (templates, cnt);
|
|
||||||
g_object_get (print, "fpi-data", &data, NULL);
|
|
||||||
if (!parse_print_data (data, &finger, &tid, &tid_len, &user_id, &user_id_len))
|
|
||||||
{
|
|
||||||
fpi_ssm_mark_failed (self->task_ssm,
|
|
||||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_DATA_INVALID,
|
|
||||||
"Parse print error"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (memcmp (&resp->verify.template.tid, tid, TEMPLATE_ID_SIZE) == 0)
|
|
||||||
{
|
|
||||||
find = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
for (gint i = 0; i < templates->len; i++)
|
||||||
if (find)
|
{
|
||||||
{
|
if (fp_print_equal (g_ptr_array_index (templates, i), new_scan))
|
||||||
if (fpi_device_get_current_action (device) == FPI_DEVICE_ACTION_VERIFY)
|
{
|
||||||
fpi_device_verify_report (device, FPI_MATCH_SUCCESS, NULL, error);
|
matching = g_ptr_array_index (templates, i);
|
||||||
else
|
break;
|
||||||
fpi_device_identify_report (device, print, print, error);
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!find)
|
if (fpi_device_get_current_action (device) == FPI_DEVICE_ACTION_VERIFY)
|
||||||
{
|
fpi_device_verify_report (device, matching ? FPI_MATCH_SUCCESS : FPI_MATCH_FAIL, new_scan, error);
|
||||||
if (fpi_device_get_current_action (device) == FPI_DEVICE_ACTION_VERIFY)
|
else
|
||||||
fpi_device_verify_report (device, FPI_MATCH_FAIL, NULL, error);
|
fpi_device_identify_report (device, matching, new_scan, error);
|
||||||
else
|
|
||||||
fpi_device_identify_report (device, NULL, NULL, error);
|
|
||||||
}
|
|
||||||
|
|
||||||
fpi_ssm_mark_completed (self->task_ssm);
|
fpi_ssm_next_state (self->task_ssm);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -433,7 +477,18 @@ fp_verify_sm_run_state (FpiSsm *ssm, FpDevice *device)
|
|||||||
|
|
||||||
switch (fpi_ssm_get_cur_state (ssm))
|
switch (fpi_ssm_get_cur_state (ssm))
|
||||||
{
|
{
|
||||||
|
case FP_VERIFY_PWR_BTN_SHIELD_ON:
|
||||||
|
goodix_sensor_cmd (self, MOC_CMD0_PWR_BTN_SHIELD, MOC_CMD1_PWR_BTN_SHIELD_ON,
|
||||||
|
false,
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
fp_pwr_btn_shield_cb);
|
||||||
|
break;
|
||||||
|
|
||||||
case FP_VERIFY_CAPTURE:
|
case FP_VERIFY_CAPTURE:
|
||||||
|
fpi_device_report_finger_status_changes (device,
|
||||||
|
FP_FINGER_STATUS_NEEDED,
|
||||||
|
FP_FINGER_STATUS_NONE);
|
||||||
goodix_sensor_cmd (self, MOC_CMD0_CAPTURE_DATA, MOC_CMD1_DEFAULT,
|
goodix_sensor_cmd (self, MOC_CMD0_CAPTURE_DATA, MOC_CMD1_DEFAULT,
|
||||||
true,
|
true,
|
||||||
(const guint8 *) ¶m,
|
(const guint8 *) ¶m,
|
||||||
@@ -448,6 +503,14 @@ fp_verify_sm_run_state (FpiSsm *ssm, FpDevice *device)
|
|||||||
TEMPLATE_ID_SIZE,
|
TEMPLATE_ID_SIZE,
|
||||||
fp_verify_cb);
|
fp_verify_cb);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case FP_VERIFY_PWR_BTN_SHIELD_OFF:
|
||||||
|
goodix_sensor_cmd (self, MOC_CMD0_PWR_BTN_SHIELD, MOC_CMD1_PWR_BTN_SHIELD_OFF,
|
||||||
|
false,
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
fp_pwr_btn_shield_cb);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -462,9 +525,9 @@ fp_verify_ssm_done (FpiSsm *ssm, FpDevice *dev, GError *error)
|
|||||||
if (error && error->domain == FP_DEVICE_RETRY)
|
if (error && error->domain == FP_DEVICE_RETRY)
|
||||||
{
|
{
|
||||||
if (fpi_device_get_current_action (dev) == FPI_DEVICE_ACTION_VERIFY)
|
if (fpi_device_get_current_action (dev) == FPI_DEVICE_ACTION_VERIFY)
|
||||||
fpi_device_verify_report (dev, FPI_MATCH_ERROR, NULL, error);
|
fpi_device_verify_report (dev, FPI_MATCH_ERROR, NULL, g_steal_pointer (&error));
|
||||||
else
|
else
|
||||||
fpi_device_identify_report (dev, NULL, NULL, error);
|
fpi_device_identify_report (dev, NULL, NULL, g_steal_pointer (&error));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fpi_device_get_current_action (dev) == FPI_DEVICE_ACTION_VERIFY)
|
if (fpi_device_get_current_action (dev) == FPI_DEVICE_ACTION_VERIFY)
|
||||||
@@ -561,42 +624,27 @@ fp_enroll_enum_cb (FpiDeviceGoodixMoc *self,
|
|||||||
resp->result));
|
resp->result));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fpi_ssm_jump_to_state (self->task_ssm, FP_ENROLL_CAPTURE);
|
if (resp->finger_list_resp.finger_num >= self->max_stored_prints)
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
fp_enroll_identify_cb (FpiDeviceGoodixMoc *self,
|
|
||||||
gxfp_cmd_response_t *resp,
|
|
||||||
GError *error)
|
|
||||||
{
|
|
||||||
if (error)
|
|
||||||
{
|
|
||||||
fpi_ssm_mark_failed (self->task_ssm, error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (resp->verify.match)
|
|
||||||
{
|
{
|
||||||
fpi_ssm_mark_failed (self->task_ssm,
|
fpi_ssm_mark_failed (self->task_ssm,
|
||||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_DATA_DUPLICATE,
|
fpi_device_error_new (FP_DEVICE_ERROR_DATA_FULL));
|
||||||
"Finger is too similar to another, try use a different finger"));
|
|
||||||
// maybe need fpi_device_enroll_report_message ...
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fpi_ssm_next_state (self->task_ssm);
|
|
||||||
|
|
||||||
|
fpi_ssm_next_state (self->task_ssm);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fp_enroll_init_cb (FpiDeviceGoodixMoc *self,
|
fp_enroll_create_cb (FpiDeviceGoodixMoc *self,
|
||||||
gxfp_cmd_response_t *resp,
|
gxfp_cmd_response_t *resp,
|
||||||
GError *error)
|
GError *error)
|
||||||
{
|
{
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
fpi_ssm_mark_failed (self->task_ssm, error);
|
fpi_ssm_mark_failed (self->task_ssm, error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
memcpy (self->template_id, resp->enroll_init.tid, TEMPLATE_ID_SIZE);
|
memcpy (self->template_id, resp->enroll_create.tid, TEMPLATE_ID_SIZE);
|
||||||
fpi_ssm_next_state (self->task_ssm);
|
fpi_ssm_next_state (self->task_ssm);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -613,7 +661,7 @@ fp_enroll_capture_cb (FpiDeviceGoodixMoc *self,
|
|||||||
/* */
|
/* */
|
||||||
if (resp->result >= GX_FAILED)
|
if (resp->result >= GX_FAILED)
|
||||||
{
|
{
|
||||||
fp_warn ("Capture sample failed, result: 0x%x", resp->result);
|
fp_info ("Capture sample failed, result: 0x%x", resp->result);
|
||||||
fpi_device_enroll_progress (FP_DEVICE (self),
|
fpi_device_enroll_progress (FP_DEVICE (self),
|
||||||
self->enroll_stage,
|
self->enroll_stage,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -621,11 +669,13 @@ fp_enroll_capture_cb (FpiDeviceGoodixMoc *self,
|
|||||||
fpi_ssm_jump_to_state (self->task_ssm, FP_ENROLL_CAPTURE);
|
fpi_ssm_jump_to_state (self->task_ssm, FP_ENROLL_CAPTURE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
fpi_device_report_finger_status_changes (FP_DEVICE (self),
|
||||||
|
FP_FINGER_STATUS_PRESENT,
|
||||||
|
FP_FINGER_STATUS_NONE);
|
||||||
if ((resp->capture_data_resp.img_quality < self->sensorcfg->config[4]) ||
|
if ((resp->capture_data_resp.img_quality < self->sensorcfg->config[4]) ||
|
||||||
(resp->capture_data_resp.img_coverage < self->sensorcfg->config[5]))
|
(resp->capture_data_resp.img_coverage < self->sensorcfg->config[5]))
|
||||||
{
|
{
|
||||||
fp_warn ("Capture sample poor quality(%d): %d or coverage(%d): %d",
|
fp_info ("Capture sample poor quality(%d): %d or coverage(%d): %d",
|
||||||
self->sensorcfg->config[4],
|
self->sensorcfg->config[4],
|
||||||
resp->capture_data_resp.img_quality,
|
resp->capture_data_resp.img_quality,
|
||||||
self->sensorcfg->config[5],
|
self->sensorcfg->config[5],
|
||||||
@@ -637,11 +687,6 @@ fp_enroll_capture_cb (FpiDeviceGoodixMoc *self,
|
|||||||
fpi_ssm_jump_to_state (self->task_ssm, FP_ENROLL_CAPTURE);
|
fpi_ssm_jump_to_state (self->task_ssm, FP_ENROLL_CAPTURE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (self->is_enroll_identify)
|
|
||||||
{
|
|
||||||
self->is_enroll_identify = false;
|
|
||||||
fpi_ssm_jump_to_state (self->task_ssm, FP_ENROLL_IDENTIFY);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fpi_ssm_next_state (self->task_ssm);
|
fpi_ssm_next_state (self->task_ssm);
|
||||||
@@ -704,9 +749,14 @@ fp_enroll_check_duplicate_cb (FpiDeviceGoodixMoc *self,
|
|||||||
}
|
}
|
||||||
if (resp->check_duplicate_resp.duplicate)
|
if (resp->check_duplicate_resp.duplicate)
|
||||||
{
|
{
|
||||||
|
g_autoptr(FpPrint) print = NULL;
|
||||||
|
|
||||||
|
print = g_object_ref_sink (fp_print_from_template (self, &resp->check_duplicate_resp.template));
|
||||||
|
|
||||||
fpi_ssm_mark_failed (self->task_ssm,
|
fpi_ssm_mark_failed (self->task_ssm,
|
||||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_DATA_DUPLICATE,
|
fpi_device_error_new_msg (FP_DEVICE_ERROR_DATA_DUPLICATE,
|
||||||
"Finger has already enrolled"));
|
"Finger was already enrolled as '%s'",
|
||||||
|
fp_print_get_description (print)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -743,7 +793,7 @@ fp_finger_mode_cb (FpiDeviceGoodixMoc *self,
|
|||||||
fpi_ssm_mark_failed (self->task_ssm, error);
|
fpi_ssm_mark_failed (self->task_ssm, error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* if reach max timeout(5sec) finger not up, swtich to finger up again */
|
/* if reach max timeout(5sec) finger not up, switch to finger up again */
|
||||||
if (resp->finger_status.status == GX_ERROR_WAIT_FINGER_UP_TIMEOUT)
|
if (resp->finger_status.status == GX_ERROR_WAIT_FINGER_UP_TIMEOUT)
|
||||||
{
|
{
|
||||||
fpi_ssm_jump_to_state (self->task_ssm, FP_ENROLL_WAIT_FINGER_UP);
|
fpi_ssm_jump_to_state (self->task_ssm, FP_ENROLL_WAIT_FINGER_UP);
|
||||||
@@ -756,6 +806,9 @@ fp_finger_mode_cb (FpiDeviceGoodixMoc *self,
|
|||||||
"Switch finger mode failed"));
|
"Switch finger mode failed"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
fpi_device_report_finger_status_changes (FP_DEVICE (self),
|
||||||
|
FP_FINGER_STATUS_NONE,
|
||||||
|
FP_FINGER_STATUS_PRESENT);
|
||||||
if (self->enroll_stage < self->max_enroll_stage)
|
if (self->enroll_stage < self->max_enroll_stage)
|
||||||
{
|
{
|
||||||
fpi_ssm_jump_to_state (self->task_ssm, FP_ENROLL_CAPTURE);
|
fpi_ssm_jump_to_state (self->task_ssm, FP_ENROLL_CAPTURE);
|
||||||
@@ -784,6 +837,16 @@ fp_enroll_sm_run_state (FpiSsm *ssm, FpDevice *device)
|
|||||||
|
|
||||||
switch (fpi_ssm_get_cur_state (ssm))
|
switch (fpi_ssm_get_cur_state (ssm))
|
||||||
{
|
{
|
||||||
|
case FP_ENROLL_PWR_BTN_SHIELD_ON:
|
||||||
|
{
|
||||||
|
goodix_sensor_cmd (self, MOC_CMD0_PWR_BTN_SHIELD, MOC_CMD1_PWR_BTN_SHIELD_ON,
|
||||||
|
false,
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
fp_pwr_btn_shield_cb);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case FP_ENROLL_ENUM:
|
case FP_ENROLL_ENUM:
|
||||||
{
|
{
|
||||||
goodix_sensor_cmd (self, MOC_CMD0_GETFINGERLIST, MOC_CMD1_DEFAULT,
|
goodix_sensor_cmd (self, MOC_CMD0_GETFINGERLIST, MOC_CMD1_DEFAULT,
|
||||||
@@ -794,30 +857,20 @@ fp_enroll_sm_run_state (FpiSsm *ssm, FpDevice *device)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FP_ENROLL_IDENTIFY:
|
|
||||||
{
|
|
||||||
dummy[0] = 0x01;
|
|
||||||
dummy[1] = self->sensorcfg->config[10];
|
|
||||||
dummy[2] = self->sensorcfg->config[11];
|
|
||||||
goodix_sensor_cmd (self, MOC_CMD0_IDENTIFY, MOC_CMD1_DEFAULT,
|
|
||||||
false,
|
|
||||||
(const guint8 *) &self->template_id,
|
|
||||||
TEMPLATE_ID_SIZE,
|
|
||||||
fp_enroll_identify_cb);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case FP_ENROLL_CREATE:
|
case FP_ENROLL_CREATE:
|
||||||
{
|
{
|
||||||
goodix_sensor_cmd (self, MOC_CMD0_ENROLL_INIT, MOC_CMD1_DEFAULT,
|
goodix_sensor_cmd (self, MOC_CMD0_ENROLL_INIT, MOC_CMD1_DEFAULT,
|
||||||
false,
|
false,
|
||||||
(const guint8 *) &dummy,
|
(const guint8 *) &dummy,
|
||||||
1,
|
1,
|
||||||
fp_enroll_init_cb);
|
fp_enroll_create_cb);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FP_ENROLL_CAPTURE:
|
case FP_ENROLL_CAPTURE:
|
||||||
|
fpi_device_report_finger_status_changes (device,
|
||||||
|
FP_FINGER_STATUS_NEEDED,
|
||||||
|
FP_FINGER_STATUS_NONE);
|
||||||
goodix_sensor_cmd (self, MOC_CMD0_CAPTURE_DATA, MOC_CMD1_DEFAULT,
|
goodix_sensor_cmd (self, MOC_CMD0_CAPTURE_DATA, MOC_CMD1_DEFAULT,
|
||||||
true,
|
true,
|
||||||
(const guint8 *) &dummy,
|
(const guint8 *) &dummy,
|
||||||
@@ -905,9 +958,17 @@ fp_enroll_sm_run_state (FpiSsm *ssm, FpDevice *device)
|
|||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case FP_ENROLL_PWR_BTN_SHIELD_OFF:
|
||||||
|
{
|
||||||
|
goodix_sensor_cmd (self, MOC_CMD0_PWR_BTN_SHIELD, MOC_CMD1_PWR_BTN_SHIELD_OFF,
|
||||||
|
false,
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
fp_pwr_btn_shield_cb);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -976,10 +1037,51 @@ fp_init_config_cb (FpiDeviceGoodixMoc *self,
|
|||||||
fpi_ssm_mark_failed (self->task_ssm, error);
|
fpi_ssm_mark_failed (self->task_ssm, error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
self->max_stored_prints = resp->finger_config.max_stored_prints;
|
||||||
fpi_ssm_next_state (self->task_ssm);
|
fpi_ssm_next_state (self->task_ssm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
fp_init_cb_reset_or_complete (FpiDeviceGoodixMoc *self,
|
||||||
|
gxfp_cmd_response_t *resp,
|
||||||
|
GError *error)
|
||||||
|
{
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
fp_warn ("Template storage appears to have been corrupted! Error was: %s", error->message);
|
||||||
|
fp_warn ("A known reason for this to happen is a firmware bug triggered by another storage area being initialized.");
|
||||||
|
fpi_ssm_jump_to_state (self->task_ssm, FP_INIT_RESET_DEVICE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fpi_ssm_mark_completed (self->task_ssm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
fp_init_reset_device_cb (FpiDeviceGoodixMoc *self,
|
||||||
|
gxfp_cmd_response_t *resp,
|
||||||
|
GError *error)
|
||||||
|
{
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
fp_warn ("Reset failed: %s", error->message);
|
||||||
|
fpi_ssm_mark_failed (self->task_ssm, error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ((resp->result >= GX_FAILED) && (resp->result != GX_ERROR_FINGER_ID_NOEXIST))
|
||||||
|
{
|
||||||
|
fp_warn ("Reset failed, device reported: 0x%x", resp->result);
|
||||||
|
fpi_ssm_mark_failed (self->task_ssm,
|
||||||
|
fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL,
|
||||||
|
"Failed clear storage, result: 0x%x",
|
||||||
|
resp->result));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
fp_warn ("Reset completed");
|
||||||
|
fpi_ssm_mark_completed (self->task_ssm);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fp_init_sm_run_state (FpiSsm *ssm, FpDevice *device)
|
fp_init_sm_run_state (FpiSsm *ssm, FpDevice *device)
|
||||||
@@ -1004,6 +1106,30 @@ fp_init_sm_run_state (FpiSsm *ssm, FpDevice *device)
|
|||||||
sizeof (gxfp_sensor_cfg_t),
|
sizeof (gxfp_sensor_cfg_t),
|
||||||
fp_init_config_cb);
|
fp_init_config_cb);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case FP_INIT_TEMPLATE_LIST:
|
||||||
|
/* List prints to check whether the template DB was corrupted.
|
||||||
|
* As of 2022-06-13 there is a known firmware issue that can cause the
|
||||||
|
* stored templates for Linux to be corrupted when the Windows storage
|
||||||
|
* area is initialized.
|
||||||
|
* In that case, we'll get a protocol failure trying to retrieve the
|
||||||
|
* list of prints.
|
||||||
|
*/
|
||||||
|
goodix_sensor_cmd (self, MOC_CMD0_GETFINGERLIST, MOC_CMD1_DEFAULT,
|
||||||
|
FALSE,
|
||||||
|
(const guint8 *) &dummy,
|
||||||
|
1,
|
||||||
|
fp_init_cb_reset_or_complete);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case FP_INIT_RESET_DEVICE:
|
||||||
|
fp_warn ("Resetting device storage, you will need to enroll all prints again!");
|
||||||
|
goodix_sensor_cmd (self, MOC_CMD0_DELETETEMPLATE, MOC_CMD1_DELETE_ALL,
|
||||||
|
FALSE,
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
fp_init_reset_device_cb);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1099,6 +1225,32 @@ fp_template_delete_cb (FpiDeviceGoodixMoc *self,
|
|||||||
fp_info ("Successfully deleted enrolled user");
|
fp_info ("Successfully deleted enrolled user");
|
||||||
fpi_device_delete_complete (device, NULL);
|
fpi_device_delete_complete (device, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
fp_template_delete_all_cb (FpiDeviceGoodixMoc *self,
|
||||||
|
gxfp_cmd_response_t *resp,
|
||||||
|
GError *error)
|
||||||
|
{
|
||||||
|
FpDevice *device = FP_DEVICE (self);
|
||||||
|
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
fpi_device_clear_storage_complete (device, error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ((resp->result >= GX_FAILED) && (resp->result != GX_ERROR_FINGER_ID_NOEXIST))
|
||||||
|
{
|
||||||
|
fpi_device_clear_storage_complete (FP_DEVICE (self),
|
||||||
|
fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL,
|
||||||
|
"Failed clear storage, result: 0x%x",
|
||||||
|
resp->result));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
fp_info ("Successfully cleared storage");
|
||||||
|
fpi_device_clear_storage_complete (device, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
*
|
*
|
||||||
* fp_template_list Function
|
* fp_template_list Function
|
||||||
@@ -1140,36 +1292,10 @@ fp_template_list_cb (FpiDeviceGoodixMoc *self,
|
|||||||
|
|
||||||
for (int n = 0; n < resp->finger_list_resp.finger_num; n++)
|
for (int n = 0; n < resp->finger_list_resp.finger_num; n++)
|
||||||
{
|
{
|
||||||
GVariant *data = NULL;
|
|
||||||
GVariant *tid = NULL;
|
|
||||||
GVariant *uid = NULL;
|
|
||||||
FpPrint *print;
|
FpPrint *print;
|
||||||
gchar *userid;
|
|
||||||
|
|
||||||
userid = (gchar *) resp->finger_list_resp.finger_list[n].payload.data;
|
print = fp_print_from_template (self, &resp->finger_list_resp.finger_list[n]);
|
||||||
|
|
||||||
print = fp_print_new (FP_DEVICE (self));
|
|
||||||
|
|
||||||
tid = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
|
|
||||||
resp->finger_list_resp.finger_list[n].tid,
|
|
||||||
TEMPLATE_ID_SIZE,
|
|
||||||
1);
|
|
||||||
|
|
||||||
uid = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
|
|
||||||
resp->finger_list_resp.finger_list[n].payload.data,
|
|
||||||
resp->finger_list_resp.finger_list[n].payload.size,
|
|
||||||
1);
|
|
||||||
|
|
||||||
data = g_variant_new ("(y@ay@ay)",
|
|
||||||
resp->finger_list_resp.finger_list[n].finger_index,
|
|
||||||
tid,
|
|
||||||
uid);
|
|
||||||
|
|
||||||
fpi_print_set_type (print, FPI_PRINT_RAW);
|
|
||||||
fpi_print_set_device_stored (print, TRUE);
|
|
||||||
g_object_set (print, "fpi-data", data, NULL);
|
|
||||||
g_object_set (print, "description", userid, NULL);
|
|
||||||
fpi_print_fill_from_user_id (print, userid);
|
|
||||||
g_ptr_array_add (self->list_result, g_object_ref_sink (print));
|
g_ptr_array_add (self->list_result, g_object_ref_sink (print));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1233,6 +1359,24 @@ gx_fp_probe (FpDevice *device)
|
|||||||
{
|
{
|
||||||
case 0x6496:
|
case 0x6496:
|
||||||
case 0x60A2:
|
case 0x60A2:
|
||||||
|
case 0x60A4:
|
||||||
|
case 0x6014:
|
||||||
|
case 0x6092:
|
||||||
|
case 0x6094:
|
||||||
|
case 0x609C:
|
||||||
|
case 0x60BC:
|
||||||
|
case 0x6304:
|
||||||
|
case 0x631C:
|
||||||
|
case 0x633C:
|
||||||
|
case 0x634C:
|
||||||
|
case 0x6384:
|
||||||
|
case 0x639C:
|
||||||
|
case 0x63AC:
|
||||||
|
case 0x63BC:
|
||||||
|
case 0x63CC:
|
||||||
|
case 0x6582:
|
||||||
|
case 0x6A94:
|
||||||
|
case 0x659A:
|
||||||
self->max_enroll_stage = 12;
|
self->max_enroll_stage = 12;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1260,7 +1404,8 @@ gx_fp_init (FpDevice *device)
|
|||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
self->cancellable = g_cancellable_new ();
|
self->max_stored_prints = FP_MAX_FINGERNUM;
|
||||||
|
self->is_power_button_shield_on = false;
|
||||||
|
|
||||||
self->sensorcfg = g_new0 (gxfp_sensor_cfg_t, 1);
|
self->sensorcfg = g_new0 (gxfp_sensor_cfg_t, 1);
|
||||||
|
|
||||||
@@ -1294,20 +1439,58 @@ gx_fp_init (FpDevice *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gx_fp_exit (FpDevice *device)
|
gx_fp_release_interface (FpiDeviceGoodixMoc *self,
|
||||||
|
GError *error)
|
||||||
{
|
{
|
||||||
FpiDeviceGoodixMoc *self = FPI_DEVICE_GOODIXMOC (device);
|
g_autoptr(GError) release_error = NULL;
|
||||||
GError *error = NULL;
|
|
||||||
|
|
||||||
g_clear_object (&self->cancellable);
|
|
||||||
g_clear_pointer (&self->sensorcfg, g_free);
|
g_clear_pointer (&self->sensorcfg, g_free);
|
||||||
|
|
||||||
/* Release usb interface */
|
/* Release usb interface */
|
||||||
g_usb_device_release_interface (fpi_device_get_usb_device (FP_DEVICE (device)),
|
g_usb_device_release_interface (fpi_device_get_usb_device (FP_DEVICE (self)),
|
||||||
0, 0, &error);
|
0, 0, &release_error);
|
||||||
|
/* Retain passed error if set, otherwise propagate error from release. */
|
||||||
|
if (error == NULL)
|
||||||
|
error = g_steal_pointer (&release_error);
|
||||||
|
|
||||||
/* Notify close complete */
|
/* Notify close complete */
|
||||||
fpi_device_close_complete (FP_DEVICE (self), error);
|
fpi_device_close_complete (FP_DEVICE (self), error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gx_fp_exit_cb (FpiDeviceGoodixMoc *self,
|
||||||
|
gxfp_cmd_response_t *resp,
|
||||||
|
GError *error)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
if (resp->result >= GX_FAILED)
|
||||||
|
fp_dbg ("Setting power button shield failed, result: 0x%x", resp->result);
|
||||||
|
self->is_power_button_shield_on = false;
|
||||||
|
gx_fp_release_interface (self, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gx_fp_exit (FpDevice *device)
|
||||||
|
{
|
||||||
|
FpiDeviceGoodixMoc *self = FPI_DEVICE_GOODIXMOC (device);
|
||||||
|
|
||||||
|
if (self->is_power_button_shield_on)
|
||||||
|
{
|
||||||
|
goodix_sensor_cmd (self,
|
||||||
|
MOC_CMD0_PWR_BTN_SHIELD,
|
||||||
|
MOC_CMD1_PWR_BTN_SHIELD_OFF,
|
||||||
|
false,
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
gx_fp_exit_cb);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gx_fp_release_interface (self, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1316,8 +1499,10 @@ gx_fp_verify_identify (FpDevice *device)
|
|||||||
{
|
{
|
||||||
FpiDeviceGoodixMoc *self = FPI_DEVICE_GOODIXMOC (device);
|
FpiDeviceGoodixMoc *self = FPI_DEVICE_GOODIXMOC (device);
|
||||||
|
|
||||||
self->task_ssm = fpi_ssm_new (device, fp_verify_sm_run_state,
|
self->task_ssm = fpi_ssm_new_full (device, fp_verify_sm_run_state,
|
||||||
FP_VERIFY_NUM_STATES);
|
FP_VERIFY_NUM_STATES,
|
||||||
|
FP_VERIFY_PWR_BTN_SHIELD_OFF,
|
||||||
|
"verify");
|
||||||
|
|
||||||
fpi_ssm_start (self->task_ssm, fp_verify_ssm_done);
|
fpi_ssm_start (self->task_ssm, fp_verify_ssm_done);
|
||||||
|
|
||||||
@@ -1330,10 +1515,11 @@ gx_fp_enroll (FpDevice *device)
|
|||||||
FpiDeviceGoodixMoc *self = FPI_DEVICE_GOODIXMOC (device);
|
FpiDeviceGoodixMoc *self = FPI_DEVICE_GOODIXMOC (device);
|
||||||
|
|
||||||
self->enroll_stage = 0;
|
self->enroll_stage = 0;
|
||||||
self->is_enroll_identify = true;
|
|
||||||
|
|
||||||
self->task_ssm = fpi_ssm_new (device, fp_enroll_sm_run_state,
|
self->task_ssm = fpi_ssm_new_full (device, fp_enroll_sm_run_state,
|
||||||
FP_ENROLL_NUM_STATES);
|
FP_ENROLL_NUM_STATES,
|
||||||
|
FP_ENROLL_PWR_BTN_SHIELD_OFF,
|
||||||
|
"enroll");
|
||||||
|
|
||||||
fpi_ssm_start (self->task_ssm, fp_enroll_ssm_done);
|
fpi_ssm_start (self->task_ssm, fp_enroll_ssm_done);
|
||||||
|
|
||||||
@@ -1400,31 +1586,52 @@ gx_fp_template_delete (FpDevice *device)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gx_fp_template_delete_all (FpDevice *device)
|
||||||
|
{
|
||||||
|
FpiDeviceGoodixMoc *self = FPI_DEVICE_GOODIXMOC (device);
|
||||||
|
|
||||||
|
goodix_sensor_cmd (self, MOC_CMD0_DELETETEMPLATE, MOC_CMD1_DELETE_ALL,
|
||||||
|
false,
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
fp_template_delete_all_cb);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fpi_device_goodixmoc_init (FpiDeviceGoodixMoc *self)
|
fpi_device_goodixmoc_init (FpiDeviceGoodixMoc *self)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gx_fp_cancel (FpDevice *device)
|
|
||||||
{
|
|
||||||
|
|
||||||
FpiDeviceGoodixMoc *self = FPI_DEVICE_GOODIXMOC (device);
|
|
||||||
|
|
||||||
/* Cancel any current interrupt transfer (resulting us to go into
|
|
||||||
* response reading mode again); then create a new cancellable
|
|
||||||
* for the next transfers. */
|
|
||||||
g_cancellable_cancel (self->cancellable);
|
|
||||||
g_clear_object (&self->cancellable);
|
|
||||||
self->cancellable = g_cancellable_new ();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static const FpIdEntry id_table[] = {
|
static const FpIdEntry id_table[] = {
|
||||||
{ .vid = 0x27c6, .pid = 0x5840, },
|
{ .vid = 0x27c6, .pid = 0x5840, },
|
||||||
{ .vid = 0x27c6, .pid = 0x6496, },
|
{ .vid = 0x27c6, .pid = 0x6014, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x6092, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x6094, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x609C, },
|
||||||
{ .vid = 0x27c6, .pid = 0x60A2, },
|
{ .vid = 0x27c6, .pid = 0x60A2, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x60A4, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x60BC, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x6304, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x631C, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x633C, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x634C, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x6384, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x639C, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x63AC, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x63BC, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x63CC, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x6496, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x6582, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x6584, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x658C, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x6592, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x6594, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x659A, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x659C, },
|
||||||
|
{ .vid = 0x27c6, .pid = 0x6A94, },
|
||||||
{ .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */
|
{ .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1440,14 +1647,18 @@ fpi_device_goodixmoc_class_init (FpiDeviceGoodixMocClass *klass)
|
|||||||
dev_class->scan_type = FP_SCAN_TYPE_PRESS;
|
dev_class->scan_type = FP_SCAN_TYPE_PRESS;
|
||||||
dev_class->id_table = id_table;
|
dev_class->id_table = id_table;
|
||||||
dev_class->nr_enroll_stages = DEFAULT_ENROLL_SAMPLES;
|
dev_class->nr_enroll_stages = DEFAULT_ENROLL_SAMPLES;
|
||||||
|
dev_class->temp_hot_seconds = -1;
|
||||||
|
|
||||||
dev_class->open = gx_fp_init;
|
dev_class->open = gx_fp_init;
|
||||||
dev_class->close = gx_fp_exit;
|
dev_class->close = gx_fp_exit;
|
||||||
dev_class->probe = gx_fp_probe;
|
dev_class->probe = gx_fp_probe;
|
||||||
dev_class->enroll = gx_fp_enroll;
|
dev_class->enroll = gx_fp_enroll;
|
||||||
dev_class->delete = gx_fp_template_delete;
|
dev_class->delete = gx_fp_template_delete;
|
||||||
|
dev_class->clear_storage = gx_fp_template_delete_all;
|
||||||
dev_class->list = gx_fp_template_list;
|
dev_class->list = gx_fp_template_list;
|
||||||
dev_class->cancel = gx_fp_cancel;
|
|
||||||
dev_class->verify = gx_fp_verify_identify;
|
dev_class->verify = gx_fp_verify_identify;
|
||||||
dev_class->identify = gx_fp_verify_identify;
|
dev_class->identify = gx_fp_verify_identify;
|
||||||
|
|
||||||
|
fpi_device_class_auto_initialize_features (dev_class);
|
||||||
|
dev_class->features |= FP_DEVICE_FEATURE_DUPLICATES_CHECK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,24 +35,29 @@ typedef enum {
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
FP_INIT_VERSION = 0,
|
FP_INIT_VERSION = 0,
|
||||||
FP_INIT_CONFIG,
|
FP_INIT_CONFIG,
|
||||||
|
FP_INIT_TEMPLATE_LIST,
|
||||||
|
FP_INIT_RESET_DEVICE,
|
||||||
FP_INIT_NUM_STATES,
|
FP_INIT_NUM_STATES,
|
||||||
} FpInitState;
|
} FpInitState;
|
||||||
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
FP_ENROLL_ENUM = 0,
|
FP_ENROLL_PWR_BTN_SHIELD_ON = 0,
|
||||||
FP_ENROLL_IDENTIFY,
|
FP_ENROLL_ENUM,
|
||||||
FP_ENROLL_CREATE,
|
FP_ENROLL_CREATE,
|
||||||
FP_ENROLL_CAPTURE,
|
FP_ENROLL_CAPTURE,
|
||||||
FP_ENROLL_UPDATE,
|
FP_ENROLL_UPDATE,
|
||||||
FP_ENROLL_WAIT_FINGER_UP,
|
FP_ENROLL_WAIT_FINGER_UP,
|
||||||
FP_ENROLL_CHECK_DUPLICATE,
|
FP_ENROLL_CHECK_DUPLICATE,
|
||||||
FP_ENROLL_COMMIT,
|
FP_ENROLL_COMMIT,
|
||||||
|
FP_ENROLL_PWR_BTN_SHIELD_OFF,
|
||||||
FP_ENROLL_NUM_STATES,
|
FP_ENROLL_NUM_STATES,
|
||||||
} FpEnrollState;
|
} FpEnrollState;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
FP_VERIFY_CAPTURE = 0,
|
FP_VERIFY_PWR_BTN_SHIELD_ON = 0,
|
||||||
|
FP_VERIFY_CAPTURE,
|
||||||
FP_VERIFY_IDENTIFY,
|
FP_VERIFY_IDENTIFY,
|
||||||
|
FP_VERIFY_PWR_BTN_SHIELD_OFF,
|
||||||
FP_VERIFY_NUM_STATES,
|
FP_VERIFY_NUM_STATES,
|
||||||
} FpVerifyState;
|
} FpVerifyState;
|
||||||
|
|||||||
@@ -141,8 +141,11 @@ crc32_update (gf_crc32_context *ctx, const uint8_t *message, uint32_t n_bytes)
|
|||||||
static void
|
static void
|
||||||
crc32_final (gf_crc32_context *ctx, uint8_t *md)
|
crc32_final (gf_crc32_context *ctx, uint8_t *md)
|
||||||
{
|
{
|
||||||
|
uint32_t crc = 0;
|
||||||
|
|
||||||
ctx->crc = (REFLECT_REMAINDER (ctx->crc) ^ FINAL_XOR_VALUE);
|
ctx->crc = (REFLECT_REMAINDER (ctx->crc) ^ FINAL_XOR_VALUE);
|
||||||
memcpy (md, &ctx->crc, 4);
|
crc = GUINT32_TO_LE (ctx->crc);
|
||||||
|
memcpy (md, &crc, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t
|
uint8_t
|
||||||
@@ -184,7 +187,7 @@ init_pack_header (
|
|||||||
pheader->cmd1 = LOBYTE (cmd);
|
pheader->cmd1 = LOBYTE (cmd);
|
||||||
pheader->packagenum = packagenum;
|
pheader->packagenum = packagenum;
|
||||||
pheader->reserved = dump_seq++;
|
pheader->reserved = dump_seq++;
|
||||||
pheader->len = len + PACKAGE_CRC_SIZE;
|
pheader->len = GUINT16_TO_LE (len + PACKAGE_CRC_SIZE);
|
||||||
pheader->crc8 = gx_proto_crc8_calc ((uint8_t *) pheader, 6);
|
pheader->crc8 = gx_proto_crc8_calc ((uint8_t *) pheader, 6);
|
||||||
pheader->rev_crc8 = ~pheader->crc8;
|
pheader->rev_crc8 = ~pheader->crc8;
|
||||||
}
|
}
|
||||||
@@ -224,14 +227,14 @@ gx_proto_parse_header (
|
|||||||
{
|
{
|
||||||
if (!buffer || !pheader)
|
if (!buffer || !pheader)
|
||||||
return -1;
|
return -1;
|
||||||
if (buffer_len < PACKAGE_HEADER_SIZE)
|
if (buffer_len < PACKAGE_HEADER_SIZE + PACKAGE_CRC_SIZE)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
memcpy (pheader, buffer, sizeof (pack_header));
|
memcpy (pheader, buffer, sizeof (pack_header));
|
||||||
|
pheader->len = GUINT16_FROM_LE (pheader->len);
|
||||||
pheader->len = GUINT16_FROM_LE (*(buffer + 4));
|
if (buffer_len < pheader->len + PACKAGE_HEADER_SIZE)
|
||||||
|
return -1;
|
||||||
pheader->len -= PACKAGE_CRC_SIZE;
|
pheader->len -= PACKAGE_CRC_SIZE;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,7 +251,7 @@ gx_proto_parse_fingerid (
|
|||||||
if (!template || !fid_buffer)
|
if (!template || !fid_buffer)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (fid_buffer_size < 70)
|
if (fid_buffer_size < G_STRUCT_OFFSET (template_format_t, payload) + sizeof (uint32_t))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
buffer = fid_buffer;
|
buffer = fid_buffer;
|
||||||
@@ -260,24 +263,25 @@ gx_proto_parse_fingerid (
|
|||||||
template->type = buffer[Offset++];
|
template->type = buffer[Offset++];
|
||||||
template->finger_index = buffer[Offset++];
|
template->finger_index = buffer[Offset++];
|
||||||
Offset++;
|
Offset++;
|
||||||
|
memcpy (template->accountid, &buffer[Offset], sizeof (template->accountid));
|
||||||
memcpy (template->accountid, &buffer[Offset], 32);
|
Offset += sizeof (template->accountid);
|
||||||
Offset += 32;
|
memcpy (template->tid, &buffer[Offset], sizeof (template->tid));
|
||||||
|
Offset += sizeof (template->tid); // Offset == 68
|
||||||
memcpy (template->tid, &buffer[Offset], 32);
|
|
||||||
Offset += 32; // Offset == 68
|
|
||||||
|
|
||||||
template->payload.size = buffer[Offset++];
|
template->payload.size = buffer[Offset++];
|
||||||
memset (template->payload.data, 0, 56);
|
if (template->payload.size > sizeof (template->payload.data))
|
||||||
|
return -1;
|
||||||
|
if (template->payload.size + Offset > fid_buffer_size)
|
||||||
|
return -1;
|
||||||
|
memset (template->payload.data, 0, template->payload.size);
|
||||||
memcpy (template->payload.data, &buffer[Offset], template->payload.size);
|
memcpy (template->payload.data, &buffer[Offset], template->payload.size);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
gx_proto_parse_body (uint16_t cmd, uint8_t *buffer, uint32_t buffer_len, pgxfp_cmd_response_t presp)
|
gx_proto_parse_body (uint16_t cmd, uint8_t *buffer, uint16_t buffer_len, pgxfp_cmd_response_t presp)
|
||||||
{
|
{
|
||||||
uint32_t offset = 0;
|
uint16_t offset = 0;
|
||||||
uint8_t *fingerlist = NULL;
|
uint8_t *fingerlist = NULL;
|
||||||
|
|
||||||
if (!buffer || !presp)
|
if (!buffer || !presp)
|
||||||
@@ -289,33 +293,65 @@ gx_proto_parse_body (uint16_t cmd, uint8_t *buffer, uint32_t buffer_len, pgxfp_c
|
|||||||
{
|
{
|
||||||
case RESPONSE_PACKAGE_CMD:
|
case RESPONSE_PACKAGE_CMD:
|
||||||
{
|
{
|
||||||
|
if (buffer_len < sizeof (gxfp_parse_msg_t) + 1)
|
||||||
|
return -1;
|
||||||
presp->parse_msg.ack_cmd = buffer[1];
|
presp->parse_msg.ack_cmd = buffer[1];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MOC_CMD0_UPDATE_CONFIG:
|
case MOC_CMD0_UPDATE_CONFIG:
|
||||||
|
{
|
||||||
|
presp->finger_config.status = buffer[0];
|
||||||
|
if (buffer_len >= 3)
|
||||||
|
presp->finger_config.max_stored_prints = buffer[2];
|
||||||
|
else
|
||||||
|
/* to compatiable old version firmware */
|
||||||
|
presp->finger_config.max_stored_prints = FP_MAX_FINGERNUM;
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case MOC_CMD0_COMMITENROLLMENT:
|
case MOC_CMD0_COMMITENROLLMENT:
|
||||||
case MOC_CMD0_DELETETEMPLATE:
|
case MOC_CMD0_DELETETEMPLATE:
|
||||||
|
/* just check result */
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MOC_CMD0_PWR_BTN_SHIELD:
|
||||||
|
presp->power_button_shield_resp.resp_cmd1 = LOBYTE (cmd);
|
||||||
|
if (buffer_len >= 2)
|
||||||
|
{
|
||||||
|
uint8_t support_pwr_shield = buffer[1];
|
||||||
|
if (support_pwr_shield == 0xFF)
|
||||||
|
g_debug ("Power button shield feature not supported!\n");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MOC_CMD0_GET_VERSION:
|
case MOC_CMD0_GET_VERSION:
|
||||||
|
if (buffer_len < sizeof (gxfp_version_info_t) + 1)
|
||||||
|
return -1;
|
||||||
memcpy (&presp->version_info, buffer + 1, sizeof (gxfp_version_info_t));
|
memcpy (&presp->version_info, buffer + 1, sizeof (gxfp_version_info_t));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MOC_CMD0_CAPTURE_DATA:
|
case MOC_CMD0_CAPTURE_DATA:
|
||||||
if (LOBYTE (cmd) == MOC_CMD1_DEFAULT)
|
if (LOBYTE (cmd) == MOC_CMD1_DEFAULT)
|
||||||
{
|
{
|
||||||
|
if (buffer_len < sizeof (gxfp_capturedata_t) + 1)
|
||||||
|
return -1;
|
||||||
presp->capture_data_resp.img_quality = buffer[1];
|
presp->capture_data_resp.img_quality = buffer[1];
|
||||||
presp->capture_data_resp.img_coverage = buffer[2];
|
presp->capture_data_resp.img_coverage = buffer[2];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MOC_CMD0_ENROLL_INIT:
|
case MOC_CMD0_ENROLL_INIT:
|
||||||
|
if (buffer_len < sizeof (gxfp_enroll_create_t) + 1)
|
||||||
|
return -1;
|
||||||
if (presp->result == GX_SUCCESS)
|
if (presp->result == GX_SUCCESS)
|
||||||
memcpy (&presp->enroll_init.tid, &buffer[1], TEMPLATE_ID_SIZE);
|
memcpy (&presp->enroll_create.tid, &buffer[1], TEMPLATE_ID_SIZE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MOC_CMD0_ENROLL:
|
case MOC_CMD0_ENROLL:
|
||||||
|
if (buffer_len < sizeof (gxfp_enroll_update_t))
|
||||||
|
return -1;
|
||||||
presp->enroll_update.rollback = (buffer[0] < 0x80) ? false : true;
|
presp->enroll_update.rollback = (buffer[0] < 0x80) ? false : true;
|
||||||
presp->enroll_update.img_overlay = buffer[1];
|
presp->enroll_update.img_overlay = buffer[1];
|
||||||
presp->enroll_update.img_preoverlay = buffer[2];
|
presp->enroll_update.img_preoverlay = buffer[2];
|
||||||
@@ -325,34 +361,40 @@ gx_proto_parse_body (uint16_t cmd, uint8_t *buffer, uint32_t buffer_len, pgxfp_c
|
|||||||
presp->check_duplicate_resp.duplicate = (presp->result == 0) ? false : true;
|
presp->check_duplicate_resp.duplicate = (presp->result == 0) ? false : true;
|
||||||
if (presp->check_duplicate_resp.duplicate)
|
if (presp->check_duplicate_resp.duplicate)
|
||||||
{
|
{
|
||||||
uint16_t tid_size = GUINT16_FROM_LE (*(buffer + 1));
|
if (buffer_len < 3)
|
||||||
memcpy (&presp->check_duplicate_resp.template, buffer + 3, tid_size);
|
return -1;
|
||||||
|
uint16_t tid_size = GUINT16_FROM_LE (*(uint16_t *) (buffer + 1));
|
||||||
|
offset += 3;
|
||||||
|
|
||||||
|
if (buffer_len < tid_size + offset)
|
||||||
|
return -1;
|
||||||
|
if (gx_proto_parse_fingerid (buffer + offset, tid_size, &presp->check_duplicate_resp.template) != 0)
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MOC_CMD0_GETFINGERLIST:
|
case MOC_CMD0_GETFINGERLIST:
|
||||||
if (presp->result != GX_SUCCESS)
|
if (presp->result != GX_SUCCESS)
|
||||||
break;
|
break;
|
||||||
|
if (buffer_len < 2)
|
||||||
|
return -1;
|
||||||
presp->finger_list_resp.finger_num = buffer[1];
|
presp->finger_list_resp.finger_num = buffer[1];
|
||||||
if (presp->finger_list_resp.finger_num > FP_MAX_FINGERNUM)
|
|
||||||
{
|
|
||||||
presp->finger_list_resp.finger_num = 0;
|
|
||||||
presp->result = GX_ERROR_NO_AVAILABLE_SPACE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
fingerlist = buffer + 2;
|
fingerlist = buffer + 2;
|
||||||
for(uint8_t num = 0; num < presp->finger_list_resp.finger_num; num++)
|
for(uint8_t num = 0; num < presp->finger_list_resp.finger_num; num++)
|
||||||
{
|
{
|
||||||
uint16_t fingerid_length = GUINT16_FROM_LE (*(fingerlist + offset));
|
uint16_t fingerid_length;
|
||||||
|
if (buffer_len < offset + 2)
|
||||||
|
return -1;
|
||||||
|
fingerid_length = GUINT16_FROM_LE (*(uint16_t *) (fingerlist + offset));
|
||||||
offset += 2;
|
offset += 2;
|
||||||
|
if (buffer_len < fingerid_length + offset)
|
||||||
|
return -1;
|
||||||
if (gx_proto_parse_fingerid (fingerlist + offset,
|
if (gx_proto_parse_fingerid (fingerlist + offset,
|
||||||
fingerid_length,
|
fingerid_length,
|
||||||
&presp->finger_list_resp.finger_list[num]) != 0)
|
&presp->finger_list_resp.finger_list[num]) != 0)
|
||||||
{
|
{
|
||||||
g_error ("parse fingerlist error");
|
g_warning ("Failed to parse finger list");
|
||||||
presp->finger_list_resp.finger_num = 0;
|
return -1;
|
||||||
presp->result = GX_FAILED;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
offset += fingerid_length;
|
offset += fingerid_length;
|
||||||
}
|
}
|
||||||
@@ -366,15 +408,19 @@ gx_proto_parse_body (uint16_t cmd, uint8_t *buffer, uint32_t buffer_len, pgxfp_c
|
|||||||
presp->verify.match = (buffer[0] == 0) ? true : false;
|
presp->verify.match = (buffer[0] == 0) ? true : false;
|
||||||
if (presp->verify.match)
|
if (presp->verify.match)
|
||||||
{
|
{
|
||||||
|
if (buffer_len < 10)
|
||||||
|
return -1;
|
||||||
offset += 1;
|
offset += 1;
|
||||||
presp->verify.rejectdetail = GUINT16_FROM_LE (*(buffer + offset));
|
presp->verify.rejectdetail = GUINT16_FROM_LE (*(uint16_t *) (buffer + offset));
|
||||||
offset += 2;
|
offset += 2;
|
||||||
score = GUINT32_FROM_LE (*(buffer + offset));
|
score = GUINT32_FROM_LE (*(uint32_t *) (buffer + offset));
|
||||||
offset += 4;
|
offset += 4;
|
||||||
study = GUINT16_FROM_LE (*(buffer + offset));
|
study = buffer[offset];
|
||||||
offset += 1;
|
offset += 1;
|
||||||
fingerid_size = GUINT16_FROM_LE (*(buffer + offset));
|
fingerid_size = GUINT16_FROM_LE (*(uint16_t *) (buffer + offset));
|
||||||
offset += 2;
|
offset += 2;
|
||||||
|
if (buffer_len < fingerid_size + offset)
|
||||||
|
return -1;
|
||||||
if (gx_proto_parse_fingerid (buffer + offset, fingerid_size, &presp->verify.template) != 0)
|
if (gx_proto_parse_fingerid (buffer + offset, fingerid_size, &presp->verify.template) != 0)
|
||||||
{
|
{
|
||||||
presp->result = GX_FAILED;
|
presp->result = GX_FAILED;
|
||||||
@@ -411,7 +457,7 @@ gx_proto_init_sensor_config (pgxfp_sensor_cfg_t pconfig)
|
|||||||
memset (pconfig, 0, sizeof (*pconfig));
|
memset (pconfig, 0, sizeof (*pconfig));
|
||||||
|
|
||||||
//NOTICE: Do not change any value!
|
//NOTICE: Do not change any value!
|
||||||
memcpy (&pconfig->config, sensor_config, 26);
|
memcpy (&pconfig->config, sensor_config, G_N_ELEMENTS (sensor_config));
|
||||||
pconfig->reserved[0] = 1;
|
pconfig->reserved[0] = 1;
|
||||||
|
|
||||||
gx_proto_crc32_calc ((uint8_t *) pconfig, sizeof (*pconfig) - PACKAGE_CRC_SIZE, (uint8_t *) &crc32_calc);
|
gx_proto_crc32_calc ((uint8_t *) pconfig, sizeof (*pconfig) - PACKAGE_CRC_SIZE, (uint8_t *) &crc32_calc);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
#define PACKAGE_CRC_SIZE (4)
|
#define PACKAGE_CRC_SIZE (4)
|
||||||
#define PACKAGE_HEADER_SIZE (8)
|
#define PACKAGE_HEADER_SIZE (8)
|
||||||
|
|
||||||
#define FP_MAX_FINGERNUM (10)
|
#define FP_MAX_FINGERNUM (20)
|
||||||
|
|
||||||
#define TEMPLATE_ID_SIZE (32)
|
#define TEMPLATE_ID_SIZE (32)
|
||||||
|
|
||||||
@@ -75,6 +75,11 @@
|
|||||||
#define MOC_CMD1_GET_FINGER_MODE 0x00
|
#define MOC_CMD1_GET_FINGER_MODE 0x00
|
||||||
#define MOC_CMD1_SET_FINGER_DOWN 0x01
|
#define MOC_CMD1_SET_FINGER_DOWN 0x01
|
||||||
#define MOC_CMD1_SET_FINGER_UP 0x02
|
#define MOC_CMD1_SET_FINGER_UP 0x02
|
||||||
|
|
||||||
|
#define MOC_CMD0_PWR_BTN_SHIELD 0xE0
|
||||||
|
#define MOC_CMD1_PWR_BTN_SHIELD_OFF 0x00
|
||||||
|
#define MOC_CMD1_PWR_BTN_SHIELD_ON 0x01
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|
||||||
typedef struct _gxfp_version_info
|
typedef struct _gxfp_version_info
|
||||||
@@ -89,7 +94,7 @@ typedef struct _gxfp_version_info
|
|||||||
uint8_t interface[GX_VERSION_LEN];
|
uint8_t interface[GX_VERSION_LEN];
|
||||||
uint8_t protocol[GX_VERSION_LEN];
|
uint8_t protocol[GX_VERSION_LEN];
|
||||||
uint8_t flashVersion[GX_VERSION_LEN];
|
uint8_t flashVersion[GX_VERSION_LEN];
|
||||||
uint8_t reserved[62];
|
uint8_t reserved[38];
|
||||||
} gxfp_version_info_t, *pgxfp_version_info_t;
|
} gxfp_version_info_t, *pgxfp_version_info_t;
|
||||||
|
|
||||||
|
|
||||||
@@ -100,22 +105,24 @@ typedef struct _gxfp_parse_msg
|
|||||||
} gxfp_parse_msg_t, *pgxfp_parse_msg_t;
|
} gxfp_parse_msg_t, *pgxfp_parse_msg_t;
|
||||||
|
|
||||||
|
|
||||||
typedef struct _gxfp_enroll_init
|
typedef struct _gxfp_enroll_create
|
||||||
{
|
{
|
||||||
uint8_t tid[TEMPLATE_ID_SIZE];
|
uint8_t tid[TEMPLATE_ID_SIZE];
|
||||||
} gxfp_enroll_init_t, *pgxfp_enroll_init_t;
|
} gxfp_enroll_create_t, *pgxfp_enroll_create_t;
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
typedef struct _template_format
|
typedef struct _template_format
|
||||||
{
|
{
|
||||||
|
uint8_t _0x43_byte;
|
||||||
uint8_t type;
|
uint8_t type;
|
||||||
uint8_t finger_index;
|
uint8_t finger_index;
|
||||||
|
uint8_t pad0;
|
||||||
uint8_t accountid[32];
|
uint8_t accountid[32];
|
||||||
uint8_t tid[32];
|
uint8_t tid[32];
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
uint32_t size;
|
uint8_t size;
|
||||||
uint8_t data[56];
|
uint8_t data[56];
|
||||||
} payload;
|
} payload;
|
||||||
uint8_t reserve[2];
|
uint8_t reserve[2];
|
||||||
} template_format_t, *ptemplate_format_t;
|
} template_format_t, *ptemplate_format_t;
|
||||||
@@ -167,6 +174,16 @@ typedef struct _fp_finger_status
|
|||||||
uint8_t status;
|
uint8_t status;
|
||||||
} fp_finger_status_t, *pfp_finger_status_t;
|
} fp_finger_status_t, *pfp_finger_status_t;
|
||||||
|
|
||||||
|
typedef struct _fp_finger_config
|
||||||
|
{
|
||||||
|
uint8_t status;
|
||||||
|
uint8_t max_stored_prints;
|
||||||
|
} fp_finger_config_t, *pfp_finger_config_t;
|
||||||
|
|
||||||
|
typedef struct _fp_pwr_btn_shield
|
||||||
|
{
|
||||||
|
uint8_t resp_cmd1;
|
||||||
|
} fp_pwr_btn_shield_t, *pfp_pwr_btn_shield_t;
|
||||||
|
|
||||||
typedef struct _fp_cmd_response
|
typedef struct _fp_cmd_response
|
||||||
{
|
{
|
||||||
@@ -175,7 +192,7 @@ typedef struct _fp_cmd_response
|
|||||||
{
|
{
|
||||||
gxfp_parse_msg_t parse_msg;
|
gxfp_parse_msg_t parse_msg;
|
||||||
gxfp_verify_t verify;
|
gxfp_verify_t verify;
|
||||||
gxfp_enroll_init_t enroll_init;
|
gxfp_enroll_create_t enroll_create;
|
||||||
gxfp_capturedata_t capture_data_resp;
|
gxfp_capturedata_t capture_data_resp;
|
||||||
gxfp_check_duplicate_t check_duplicate_resp;
|
gxfp_check_duplicate_t check_duplicate_resp;
|
||||||
gxfp_enroll_commit_t enroll_commit;
|
gxfp_enroll_commit_t enroll_commit;
|
||||||
@@ -183,6 +200,8 @@ typedef struct _fp_cmd_response
|
|||||||
gxfp_enum_fingerlist_t finger_list_resp;
|
gxfp_enum_fingerlist_t finger_list_resp;
|
||||||
gxfp_version_info_t version_info;
|
gxfp_version_info_t version_info;
|
||||||
fp_finger_status_t finger_status;
|
fp_finger_status_t finger_status;
|
||||||
|
fp_finger_config_t finger_config;
|
||||||
|
fp_pwr_btn_shield_t power_button_shield_resp;
|
||||||
};
|
};
|
||||||
} gxfp_cmd_response_t, *pgxfp_cmd_response_t;
|
} gxfp_cmd_response_t, *pgxfp_cmd_response_t;
|
||||||
|
|
||||||
@@ -219,7 +238,7 @@ int gx_proto_parse_header (uint8_t *buffer,
|
|||||||
|
|
||||||
int gx_proto_parse_body (uint16_t cmd,
|
int gx_proto_parse_body (uint16_t cmd,
|
||||||
uint8_t *buffer,
|
uint8_t *buffer,
|
||||||
uint32_t buffer_len,
|
uint16_t buffer_len,
|
||||||
pgxfp_cmd_response_t presponse);
|
pgxfp_cmd_response_t presponse);
|
||||||
|
|
||||||
int gx_proto_init_sensor_config (pgxfp_sensor_cfg_t pconfig);
|
int gx_proto_init_sensor_config (pgxfp_sensor_cfg_t pconfig);
|
||||||
|
|||||||
@@ -0,0 +1,445 @@
|
|||||||
|
/*
|
||||||
|
* Next Biometrics driver for libfprint
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 Huan Wang <fredwanghuan@gmail.com>
|
||||||
|
* Copyright (C) 2011-2012 Andrej Krutak <dev@andree.sk>
|
||||||
|
*
|
||||||
|
* 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 "nb1010"
|
||||||
|
#include "fpi-log.h"
|
||||||
|
|
||||||
|
#include "drivers_api.h"
|
||||||
|
|
||||||
|
#define FRAME_HEIGHT 180
|
||||||
|
#define FRAME_WIDTH 256
|
||||||
|
|
||||||
|
#define NB1010_EP_OUT 0x02 | FPI_USB_ENDPOINT_OUT
|
||||||
|
#define NB1010_EP_IN 0x03 | FPI_USB_ENDPOINT_IN
|
||||||
|
|
||||||
|
#define NB1010_SENSITIVITY_BIT 12
|
||||||
|
|
||||||
|
#define NB1010_CMD_RECV_LEN 16
|
||||||
|
#define NB1010_CAPTURE_RECV_LEN 540
|
||||||
|
#define NB1010_CAPTURE_HEADER_LEN 25
|
||||||
|
|
||||||
|
#define NB1010_LINE_PER_PARTIAL 2
|
||||||
|
#define NB1010_N_PARTIAL (FRAME_HEIGHT / NB1010_LINE_PER_PARTIAL)
|
||||||
|
|
||||||
|
#define NB1010_DEFAULT_TIMEOUT 500
|
||||||
|
#define NB1010_TRANSITION_DELAY 50
|
||||||
|
|
||||||
|
/* Loop ssm states */
|
||||||
|
enum {
|
||||||
|
M_WAIT_PRINT,
|
||||||
|
M_REQUEST_PRINT,
|
||||||
|
M_CHECK_PRINT,
|
||||||
|
M_READ_PRINT_PRESTART,
|
||||||
|
M_READ_PRINT_START,
|
||||||
|
M_READ_PRINT_POLL,
|
||||||
|
M_SUBMIT_PRINT,
|
||||||
|
|
||||||
|
/* Number of states */
|
||||||
|
M_LOOP_NUM_STATES,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The Follow Commands are obtained by decoding the usbcap, so it does not expose all the command available to the device.
|
||||||
|
* Known:
|
||||||
|
* 1. every command starts with 0x80
|
||||||
|
* 2. second byte is the comand, third byte is the seqence nubmer, init with rand, gets incremented
|
||||||
|
* everytime a new instruction is sent to the device. However device does not care or check the sequence, just echo back
|
||||||
|
* whatever chosen by the host.
|
||||||
|
* 3. cmd: 0x07 check, expect [0x80, 0x29...] as response
|
||||||
|
* 4. cmd: 0x16 ???, expect [0x80, 0x20...] as response. Happens during device init.
|
||||||
|
* 5. cmd: 0x13 print device, expect [0x80, 0x23...] as response. Response contains the device string
|
||||||
|
* 6. cmd: 0x38 check finger, expect [0x80, 0x37...] as response. The 14th byte indicate whether finger present [0-255]
|
||||||
|
* 7. cmd: 0x0d ???, expect [0x80, 0x20...] as response. Happens before capture.
|
||||||
|
* 8. cmd: 0x12 capture, expect [0x80, 0x20...] as response. After capture read 90 times in sequence to get all the frame.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static guint8 nb1010_cmd_check_finger[] = {
|
||||||
|
0x80, 0x38, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||||
|
};
|
||||||
|
|
||||||
|
/* pre capture, dont know what does it do, but appears everytime a capture begins */
|
||||||
|
static guint8 nb1010_cmd_precapture[] = {
|
||||||
|
0x80, 0x0d, 0x03, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
|
||||||
|
};
|
||||||
|
|
||||||
|
static guint8 nb1010_cmd_capture[] = {
|
||||||
|
0x80, 0x12, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||||
|
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _FpiDeviceNb1010
|
||||||
|
{
|
||||||
|
FpImageDevice parent;
|
||||||
|
FpiSsm *ssm;
|
||||||
|
guint8 *scanline_buf;
|
||||||
|
gboolean deactivating;
|
||||||
|
int partial_received;
|
||||||
|
};
|
||||||
|
G_DECLARE_FINAL_TYPE (FpiDeviceNb1010, fpi_device_nb1010, FPI, DEVICE_NB1010, FpImageDevice);
|
||||||
|
G_DEFINE_TYPE (FpiDeviceNb1010, fpi_device_nb1010, FP_TYPE_IMAGE_DEVICE);
|
||||||
|
|
||||||
|
static void
|
||||||
|
nb1010_dev_init (FpImageDevice *dev)
|
||||||
|
{
|
||||||
|
FpiDeviceNb1010 *self = FPI_DEVICE_NB1010 (dev);
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
|
g_usb_device_claim_interface (fpi_device_get_usb_device (FP_DEVICE (dev)), 0, 0, &error);
|
||||||
|
|
||||||
|
self->scanline_buf = g_malloc0 (FRAME_WIDTH * FRAME_HEIGHT);
|
||||||
|
|
||||||
|
fpi_image_device_open_complete (dev, error);
|
||||||
|
fp_dbg ("nb1010 Initialized");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
nb1010_dev_deinit (FpImageDevice *dev)
|
||||||
|
{
|
||||||
|
FpiDeviceNb1010 *self = FPI_DEVICE_NB1010 (dev);
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
|
g_clear_pointer (&self->scanline_buf, g_free);
|
||||||
|
|
||||||
|
g_usb_device_release_interface (fpi_device_get_usb_device (FP_DEVICE (dev)), 0, 0, &error);
|
||||||
|
fpi_image_device_close_complete (dev, error);
|
||||||
|
fp_dbg ("nb1010 Deinitialized");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
nb1010_dev_activate (FpImageDevice *dev)
|
||||||
|
{
|
||||||
|
FpiDeviceNb1010 *self = FPI_DEVICE_NB1010 (dev);
|
||||||
|
|
||||||
|
self->deactivating = FALSE;
|
||||||
|
|
||||||
|
fpi_image_device_activate_complete (dev, NULL);
|
||||||
|
fp_dbg ("nb1010 Activated");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
nb1010_dev_deactivated (FpImageDevice *dev, GError * err)
|
||||||
|
{
|
||||||
|
fpi_image_device_deactivate_complete (dev, err);
|
||||||
|
fp_dbg ("nb1010 Deactivated");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
nb1010_dev_deactivate (FpImageDevice *dev)
|
||||||
|
{
|
||||||
|
FpiDeviceNb1010 *self = FPI_DEVICE_NB1010 (dev);
|
||||||
|
|
||||||
|
self->deactivating = TRUE;
|
||||||
|
if (self->ssm == NULL)
|
||||||
|
nb1010_dev_deactivated (dev, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
nb1010_request_fingerprint (FpiDeviceNb1010 *dev)
|
||||||
|
{
|
||||||
|
FpiUsbTransfer *transfer = NULL;
|
||||||
|
|
||||||
|
transfer = fpi_usb_transfer_new (FP_DEVICE ( dev));
|
||||||
|
transfer->short_is_error = TRUE;
|
||||||
|
transfer->ssm = dev->ssm;
|
||||||
|
|
||||||
|
fpi_usb_transfer_fill_bulk_full (transfer, NB1010_EP_OUT,
|
||||||
|
nb1010_cmd_check_finger, G_N_ELEMENTS (nb1010_cmd_check_finger),
|
||||||
|
NULL);
|
||||||
|
fpi_usb_transfer_submit (transfer, NB1010_DEFAULT_TIMEOUT,
|
||||||
|
fpi_device_get_cancellable (FP_DEVICE (dev)),
|
||||||
|
fpi_ssm_usb_transfer_cb, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
nb1010_check_fingerprint_cb (FpiUsbTransfer *transfer, FpDevice *dev,
|
||||||
|
gpointer unused_data, GError *error)
|
||||||
|
{
|
||||||
|
FpiDeviceNb1010 *self = FPI_DEVICE_NB1010 (dev);
|
||||||
|
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (self->deactivating)
|
||||||
|
{
|
||||||
|
fpi_ssm_mark_completed (transfer->ssm);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (transfer->buffer[NB1010_SENSITIVITY_BIT] > 0x30)
|
||||||
|
fpi_ssm_next_state (transfer->ssm);
|
||||||
|
else
|
||||||
|
fpi_ssm_jump_to_state (transfer->ssm, M_WAIT_PRINT);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
nb1010_cmd_check_fingerprint (FpiDeviceNb1010 *dev)
|
||||||
|
{
|
||||||
|
FpiUsbTransfer *transfer = NULL;
|
||||||
|
|
||||||
|
transfer = fpi_usb_transfer_new (FP_DEVICE ( dev));
|
||||||
|
transfer->short_is_error = TRUE;
|
||||||
|
transfer->ssm = dev->ssm;
|
||||||
|
|
||||||
|
fpi_usb_transfer_fill_bulk (transfer, NB1010_EP_IN, NB1010_CMD_RECV_LEN);
|
||||||
|
fpi_usb_transfer_submit (transfer, NB1010_DEFAULT_TIMEOUT,
|
||||||
|
fpi_device_get_cancellable (FP_DEVICE (dev)),
|
||||||
|
nb1010_check_fingerprint_cb, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
nb1010_read_ignore_data_cb (FpiUsbTransfer *transfer, FpDevice *dev,
|
||||||
|
gpointer unused_data, GError *error)
|
||||||
|
{
|
||||||
|
FpiDeviceNb1010 *self = FPI_DEVICE_NB1010 (dev);
|
||||||
|
FpiUsbTransfer *new_transfer = NULL;
|
||||||
|
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (self->deactivating)
|
||||||
|
{
|
||||||
|
fpi_ssm_mark_completed (transfer->ssm);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
new_transfer = fpi_usb_transfer_new ( dev );
|
||||||
|
new_transfer->short_is_error = TRUE;
|
||||||
|
new_transfer->ssm = transfer->ssm;
|
||||||
|
|
||||||
|
fpi_usb_transfer_fill_bulk (new_transfer, NB1010_EP_IN, NB1010_CMD_RECV_LEN);
|
||||||
|
fpi_usb_transfer_submit (new_transfer, NB1010_DEFAULT_TIMEOUT,
|
||||||
|
fpi_device_get_cancellable (FP_DEVICE (dev)),
|
||||||
|
fpi_ssm_usb_transfer_cb, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
nb1010_write_ignore_read (FpiDeviceNb1010 *dev, guint8 *buf, gsize len)
|
||||||
|
{
|
||||||
|
FpiUsbTransfer *transfer = NULL;
|
||||||
|
|
||||||
|
transfer = fpi_usb_transfer_new (FP_DEVICE ( dev));
|
||||||
|
transfer->short_is_error = TRUE;
|
||||||
|
transfer->ssm = dev->ssm;
|
||||||
|
|
||||||
|
fpi_usb_transfer_fill_bulk_full (transfer, NB1010_EP_OUT, buf, len, NULL);
|
||||||
|
fpi_usb_transfer_submit (transfer, NB1010_DEFAULT_TIMEOUT,
|
||||||
|
fpi_device_get_cancellable (FP_DEVICE (dev)),
|
||||||
|
nb1010_read_ignore_data_cb, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
nb1010_read_capture_cb (FpiUsbTransfer *transfer, FpDevice *dev,
|
||||||
|
gpointer unused_data, GError *error)
|
||||||
|
{
|
||||||
|
FpiDeviceNb1010 *self = FPI_DEVICE_NB1010 (dev);
|
||||||
|
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (self->deactivating)
|
||||||
|
{
|
||||||
|
fpi_ssm_mark_completed (transfer->ssm);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_assert (transfer->actual_length == NB1010_CAPTURE_RECV_LEN);
|
||||||
|
|
||||||
|
size_t offset = self->partial_received * NB1010_LINE_PER_PARTIAL * FRAME_WIDTH;
|
||||||
|
|
||||||
|
memcpy (self->scanline_buf + offset,
|
||||||
|
transfer->buffer + NB1010_CAPTURE_HEADER_LEN, NB1010_LINE_PER_PARTIAL * FRAME_WIDTH);
|
||||||
|
|
||||||
|
self->partial_received++;
|
||||||
|
if (self->partial_received == NB1010_N_PARTIAL)
|
||||||
|
{
|
||||||
|
fpi_ssm_next_state (transfer->ssm);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
fpi_usb_transfer_submit (fpi_usb_transfer_ref (transfer), NB1010_DEFAULT_TIMEOUT,
|
||||||
|
fpi_device_get_cancellable (FP_DEVICE (dev)),
|
||||||
|
nb1010_read_capture_cb, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
nb1010_read_capture (FpiDeviceNb1010 *dev)
|
||||||
|
{
|
||||||
|
FpiUsbTransfer *transfer = NULL;
|
||||||
|
|
||||||
|
transfer = fpi_usb_transfer_new ( FP_DEVICE ( dev));
|
||||||
|
transfer->short_is_error = TRUE;
|
||||||
|
transfer->ssm = dev->ssm;
|
||||||
|
|
||||||
|
fpi_usb_transfer_fill_bulk (transfer, NB1010_EP_IN, NB1010_CAPTURE_RECV_LEN);
|
||||||
|
fpi_usb_transfer_submit (transfer, NB1010_DEFAULT_TIMEOUT,
|
||||||
|
fpi_device_get_cancellable (FP_DEVICE (dev)),
|
||||||
|
nb1010_read_capture_cb, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
submit_image (FpiSsm *ssm,
|
||||||
|
FpImageDevice *dev)
|
||||||
|
{
|
||||||
|
FpiDeviceNb1010 *self = FPI_DEVICE_NB1010 (dev);
|
||||||
|
FpImage *img;
|
||||||
|
|
||||||
|
img = fp_image_new (FRAME_WIDTH, FRAME_HEIGHT);
|
||||||
|
if (img == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
memcpy (img->data, self->scanline_buf, FRAME_WIDTH * FRAME_HEIGHT);
|
||||||
|
fpi_image_device_image_captured (dev, img);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
m_loop_complete (FpiSsm *ssm, FpDevice *_dev, GError *error)
|
||||||
|
{
|
||||||
|
fp_dbg ("nb1010 ssm complete cb");
|
||||||
|
|
||||||
|
FpImageDevice *dev = FP_IMAGE_DEVICE (_dev);
|
||||||
|
FpiDeviceNb1010 *self = FPI_DEVICE_NB1010 (_dev);
|
||||||
|
|
||||||
|
self->ssm = NULL;
|
||||||
|
|
||||||
|
if (self->deactivating)
|
||||||
|
nb1010_dev_deactivated (dev, error);
|
||||||
|
else if (error != NULL)
|
||||||
|
fpi_image_device_session_error (dev, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
m_loop_state (FpiSsm *ssm, FpDevice *_dev)
|
||||||
|
{
|
||||||
|
FpImageDevice *dev = FP_IMAGE_DEVICE (_dev);
|
||||||
|
FpiDeviceNb1010 *self = FPI_DEVICE_NB1010 (_dev);
|
||||||
|
|
||||||
|
if (self->deactivating)
|
||||||
|
{
|
||||||
|
fp_dbg ("deactivating, marking completed");
|
||||||
|
fpi_ssm_mark_completed (ssm);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (fpi_ssm_get_cur_state (ssm))
|
||||||
|
{
|
||||||
|
case M_WAIT_PRINT:
|
||||||
|
/* Wait fingerprint scanning */
|
||||||
|
fpi_ssm_next_state_delayed (ssm, NB1010_TRANSITION_DELAY);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_REQUEST_PRINT:
|
||||||
|
nb1010_request_fingerprint (self);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_CHECK_PRINT:
|
||||||
|
nb1010_cmd_check_fingerprint (self);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_READ_PRINT_PRESTART:
|
||||||
|
fpi_image_device_report_finger_status (dev, TRUE);
|
||||||
|
nb1010_write_ignore_read (self, nb1010_cmd_precapture, G_N_ELEMENTS (nb1010_cmd_precapture));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_READ_PRINT_START:
|
||||||
|
self->partial_received = 0;
|
||||||
|
nb1010_write_ignore_read (self, nb1010_cmd_capture, G_N_ELEMENTS (nb1010_cmd_capture));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_READ_PRINT_POLL:
|
||||||
|
nb1010_read_capture (self);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_SUBMIT_PRINT:
|
||||||
|
if (submit_image (ssm, dev))
|
||||||
|
{
|
||||||
|
fpi_ssm_mark_completed (ssm);
|
||||||
|
fpi_image_device_report_finger_status (dev, FALSE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fpi_ssm_jump_to_state (ssm, M_WAIT_PRINT);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
g_assert_not_reached ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
nb1010_dev_change_state (FpImageDevice *dev, FpiImageDeviceState state)
|
||||||
|
{
|
||||||
|
FpiDeviceNb1010 *self = FPI_DEVICE_NB1010 (dev);
|
||||||
|
FpiSsm *ssm_loop;
|
||||||
|
|
||||||
|
if (state == FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON)
|
||||||
|
{
|
||||||
|
ssm_loop = fpi_ssm_new (FP_DEVICE (dev), m_loop_state, M_LOOP_NUM_STATES);
|
||||||
|
self->ssm = ssm_loop;
|
||||||
|
fpi_ssm_start (ssm_loop, m_loop_complete);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static const FpIdEntry id_table[] = {
|
||||||
|
{ .vid = 0x298d, .pid = 0x1010, },
|
||||||
|
{ .vid = 0, .pid = 0, .driver_data = 0 },
|
||||||
|
};
|
||||||
|
|
||||||
|
static void
|
||||||
|
fpi_device_nb1010_init (FpiDeviceNb1010 *self)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
fpi_device_nb1010_class_init (FpiDeviceNb1010Class *klass)
|
||||||
|
{
|
||||||
|
FpDeviceClass *dev_class = FP_DEVICE_CLASS (klass);
|
||||||
|
FpImageDeviceClass *img_class = FP_IMAGE_DEVICE_CLASS (klass);
|
||||||
|
|
||||||
|
dev_class->id = FP_COMPONENT;
|
||||||
|
dev_class->full_name = "NextBiometrics NB-1010-U";
|
||||||
|
dev_class->type = FP_DEVICE_TYPE_USB;
|
||||||
|
dev_class->id_table = id_table;
|
||||||
|
dev_class->scan_type = FP_SCAN_TYPE_PRESS;
|
||||||
|
|
||||||
|
img_class->img_height = FRAME_HEIGHT;
|
||||||
|
img_class->img_width = FRAME_WIDTH;
|
||||||
|
|
||||||
|
img_class->bz3_threshold = 24;
|
||||||
|
|
||||||
|
img_class->img_open = nb1010_dev_init;
|
||||||
|
img_class->img_close = nb1010_dev_deinit;
|
||||||
|
img_class->activate = nb1010_dev_activate;
|
||||||
|
img_class->deactivate = nb1010_dev_deactivate;
|
||||||
|
img_class->change_state = nb1010_dev_change_state;
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,220 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2022-2023 Realtek Corp.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
#include "fpi-device.h"
|
||||||
|
#include "fpi-ssm.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#define EP_IN (2 | FPI_USB_ENDPOINT_IN)
|
||||||
|
#define EP_OUT (1 | FPI_USB_ENDPOINT_OUT)
|
||||||
|
|
||||||
|
#define EP_IN_MAX_BUF_SIZE 2048
|
||||||
|
|
||||||
|
#define FP_RTK_CMD_TOTAL_LEN 12
|
||||||
|
#define FP_RTK_CMD_LEN 2
|
||||||
|
#define FP_RTK_CMD_PARAM_LEN 4
|
||||||
|
#define FP_RTK_CMD_ADDR_LEN 4
|
||||||
|
#define FP_RTK_CMD_DATA_LEN 2
|
||||||
|
|
||||||
|
#define TEMPLATE_LEN 35
|
||||||
|
#define SUBFACTOR_OFFSET 2
|
||||||
|
#define UID_OFFSET 3
|
||||||
|
#define UID_PAYLOAD_LEN 32
|
||||||
|
|
||||||
|
/* Command transfer timeout :ms*/
|
||||||
|
#define CMD_TIMEOUT 1000
|
||||||
|
#define DATA_TIMEOUT 5000
|
||||||
|
#define STATUS_TIMEOUT 2000
|
||||||
|
|
||||||
|
#define MAX_ENROLL_SAMPLES 8
|
||||||
|
#define DEFAULT_UID_LEN 28
|
||||||
|
#define SUB_FINGER_01 0xFF
|
||||||
|
|
||||||
|
#define GET_CMD_TYPE(val) ((val & 0xC0) >> 6)
|
||||||
|
#define GET_TRANS_DATA_LEN(len_h, len_l) ((len_h << 8) | len_l)
|
||||||
|
#define GET_LEN_L(total_data_len) ((total_data_len) & 0xff)
|
||||||
|
#define GET_LEN_H(total_data_len) ((total_data_len) >> 8)
|
||||||
|
|
||||||
|
G_DECLARE_FINAL_TYPE (FpiDeviceRealtek, fpi_device_realtek, FPI, DEVICE_REALTEK, FpDevice)
|
||||||
|
|
||||||
|
typedef void (*SynCmdMsgCallback) (FpiDeviceRealtek *self,
|
||||||
|
uint8_t *buffer_in,
|
||||||
|
GError *error);
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
SynCmdMsgCallback callback;
|
||||||
|
} CommandData;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
FP_RTK_CMD_ONLY = 0,
|
||||||
|
FP_RTK_CMD_READ,
|
||||||
|
FP_RTK_CMD_WRITE,
|
||||||
|
} FpRtkCmdType;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
FP_RTK_MSG_PLAINTEXT = 0,
|
||||||
|
FP_RTK_MSG_PLAINTEXT_NO_STATUS,
|
||||||
|
} FpRtkMsgType;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
FP_RTK_PURPOSE_IDENTIFY = 0x01, /* identify before enroll */
|
||||||
|
FP_RTK_PURPOSE_VERIFY = 0x02,
|
||||||
|
FP_RTK_PURPOSE_ENROLL = 0x04,
|
||||||
|
} FpRtkPurpose;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
FP_RTK_SUCCESS = 0x0,
|
||||||
|
FP_RTK_TOO_HIGH,
|
||||||
|
FP_RTK_TOO_LOW,
|
||||||
|
FP_RTK_TOO_LEFT,
|
||||||
|
FP_RTK_TOO_RIGHT,
|
||||||
|
FP_RTK_TOO_FAST,
|
||||||
|
FP_RTK_TOO_SLOW,
|
||||||
|
FP_RTK_POOR_QUALITY,
|
||||||
|
FP_RTK_TOO_SKEWED,
|
||||||
|
FP_RTK_TOO_SHORT,
|
||||||
|
FP_RTK_MERGE_FAILURE,
|
||||||
|
FP_RTK_MATCH_FAIL,
|
||||||
|
FP_RTK_CMD_ERR,
|
||||||
|
} FpRtkInStatus;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
FP_RTK_ENROLL_GET_TEMPLATE = 0,
|
||||||
|
FP_RTK_ENROLL_BEGIN_POS,
|
||||||
|
FP_RTK_ENROLL_CAPTURE,
|
||||||
|
FP_RTK_ENROLL_FINISH_CAPTURE,
|
||||||
|
FP_RTK_ENROLL_ACCEPT_SAMPLE,
|
||||||
|
FP_RTK_ENROLL_CHECK_DUPLICATE,
|
||||||
|
FP_RTK_ENROLL_COMMIT,
|
||||||
|
FP_RTK_ENROLL_NUM_STATES,
|
||||||
|
} FpRtkEnrollState;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
FP_RTK_VERIFY_CAPTURE = 0,
|
||||||
|
FP_RTK_VERIFY_FINISH_CAPTURE,
|
||||||
|
FP_RTK_VERIFY_ACCEPT_SAMPLE,
|
||||||
|
FP_RTK_VERIFY_INDENTIFY_FEATURE,
|
||||||
|
FP_RTK_VERIFY_UPDATE_TEMPLATE,
|
||||||
|
FP_RTK_VERIFY_NUM_STATES,
|
||||||
|
} FpRtkVerifyState;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
FP_RTK_DELETE_GET_POS = 0,
|
||||||
|
FP_RTK_DELETE_PRINT,
|
||||||
|
FP_RTK_DELETE_NUM_STATES,
|
||||||
|
} FpRtkDeleteState;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
FP_RTK_INIT_SELECT_OS = 0,
|
||||||
|
FP_RTK_INIT_GET_ENROLL_NUM,
|
||||||
|
FP_RTK_INIT_NUM_STATES,
|
||||||
|
} FpRtkInitState;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
FP_RTK_CMD_SEND = 0,
|
||||||
|
FP_RTK_CMD_TRANS_DATA,
|
||||||
|
FP_RTK_CMD_GET_STATUS,
|
||||||
|
FP_RTK_CMD_NUM_STATES,
|
||||||
|
} FpRtkCmdState;
|
||||||
|
|
||||||
|
struct _FpiDeviceRealtek
|
||||||
|
{
|
||||||
|
FpDevice parent;
|
||||||
|
FpiSsm *task_ssm;
|
||||||
|
FpiSsm *cmd_ssm;
|
||||||
|
FpiUsbTransfer *cmd_transfer;
|
||||||
|
FpiUsbTransfer *data_transfer;
|
||||||
|
gint cmd_type;
|
||||||
|
FpRtkMsgType message_type;
|
||||||
|
gboolean cmd_cancellable;
|
||||||
|
gint enroll_stage;
|
||||||
|
gint max_enroll_stage;
|
||||||
|
guchar *read_data;
|
||||||
|
gsize trans_data_len;
|
||||||
|
FpRtkPurpose fp_purpose;
|
||||||
|
gint pos_index;
|
||||||
|
gint template_num;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct realtek_fp_cmd
|
||||||
|
{
|
||||||
|
uint8_t cmd[FP_RTK_CMD_LEN];
|
||||||
|
uint8_t param[FP_RTK_CMD_PARAM_LEN];
|
||||||
|
uint8_t addr[FP_RTK_CMD_ADDR_LEN];
|
||||||
|
uint8_t data_len[FP_RTK_CMD_DATA_LEN];
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct realtek_fp_cmd co_start_capture = {
|
||||||
|
.cmd = {0x05, 0x05},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct realtek_fp_cmd co_finish_capture = {
|
||||||
|
.cmd = {0x45, 0x06},
|
||||||
|
.data_len = {0x05},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct realtek_fp_cmd co_accept_sample = {
|
||||||
|
.cmd = {0x45, 0x08},
|
||||||
|
.data_len = {0x09},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct realtek_fp_cmd tls_identify_feature = {
|
||||||
|
.cmd = {0x45, 0x22},
|
||||||
|
.data_len = {0x2A},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct realtek_fp_cmd co_get_enroll_num = {
|
||||||
|
.cmd = {0x45, 0x0d},
|
||||||
|
.data_len = {0x02},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct realtek_fp_cmd co_get_template = {
|
||||||
|
.cmd = {0x45, 0x0E},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct realtek_fp_cmd tls_enroll_begin = {
|
||||||
|
.cmd = {0x05, 0x20},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct realtek_fp_cmd co_check_duplicate = {
|
||||||
|
.cmd = {0x45, 0x10},
|
||||||
|
.data_len = {0x22},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct realtek_fp_cmd tls_enroll_commit = {
|
||||||
|
.cmd = {0x85, 0x21},
|
||||||
|
.data_len = {0x20},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct realtek_fp_cmd co_update_template = {
|
||||||
|
.cmd = {0x05, 0x11},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct realtek_fp_cmd co_delete_record = {
|
||||||
|
.cmd = {0x05, 0x0F},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct realtek_fp_cmd co_select_system = {
|
||||||
|
.cmd = {0x05, 0x13},
|
||||||
|
};
|
||||||
@@ -468,6 +468,7 @@ typedef union
|
|||||||
bmkt_del_all_users_resp_t del_all_users_resp;
|
bmkt_del_all_users_resp_t del_all_users_resp;
|
||||||
bmkt_enroll_templates_resp_t enroll_templates_resp;
|
bmkt_enroll_templates_resp_t enroll_templates_resp;
|
||||||
bmkt_del_user_resp_t del_user_resp;
|
bmkt_del_user_resp_t del_user_resp;
|
||||||
|
bmkt_del_all_users_resp_t del_all_user_resp;
|
||||||
bmkt_enrolled_fingers_resp_t enrolled_fingers_resp;
|
bmkt_enrolled_fingers_resp_t enrolled_fingers_resp;
|
||||||
} bmkt_response_data_t;
|
} bmkt_response_data_t;
|
||||||
|
|
||||||
|
|||||||
@@ -27,10 +27,27 @@
|
|||||||
|
|
||||||
G_DEFINE_TYPE (FpiDeviceSynaptics, fpi_device_synaptics, FP_TYPE_DEVICE)
|
G_DEFINE_TYPE (FpiDeviceSynaptics, fpi_device_synaptics, FP_TYPE_DEVICE)
|
||||||
|
|
||||||
|
static void init_identify_msg (FpDevice *device);
|
||||||
|
static void compose_and_send_identify_msg (FpDevice *device);
|
||||||
|
|
||||||
static const FpIdEntry id_table[] = {
|
static const FpIdEntry id_table[] = {
|
||||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0xBD, },
|
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x00BD, },
|
||||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0xE9, },
|
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x00DF, },
|
||||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0xDF, },
|
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x00F9, },
|
||||||
|
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x00FC, },
|
||||||
|
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x00C2, },
|
||||||
|
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0100, },
|
||||||
|
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x00F0, },
|
||||||
|
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0103, },
|
||||||
|
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0123, },
|
||||||
|
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0124, },
|
||||||
|
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0126, },
|
||||||
|
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0129, },
|
||||||
|
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0168, },
|
||||||
|
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x015F, },
|
||||||
|
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0104, },
|
||||||
|
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0173, },
|
||||||
|
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0106, },
|
||||||
{ .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */
|
{ .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -79,13 +96,24 @@ cmd_receive_cb (FpiUsbTransfer *transfer,
|
|||||||
if (msg_resp.payload[0] == 0x01)
|
if (msg_resp.payload[0] == 0x01)
|
||||||
{
|
{
|
||||||
self->finger_on_sensor = TRUE;
|
self->finger_on_sensor = TRUE;
|
||||||
|
fpi_device_report_finger_status_changes (device,
|
||||||
|
FP_FINGER_STATUS_PRESENT,
|
||||||
|
FP_FINGER_STATUS_NONE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
self->finger_on_sensor = FALSE;
|
self->finger_on_sensor = FALSE;
|
||||||
|
fpi_device_report_finger_status_changes (device,
|
||||||
|
FP_FINGER_STATUS_NONE,
|
||||||
|
FP_FINGER_STATUS_PRESENT);
|
||||||
|
|
||||||
if (self->cmd_complete_on_removal)
|
if (self->cmd_complete_on_removal)
|
||||||
{
|
{
|
||||||
fpi_ssm_mark_completed (transfer->ssm);
|
if (self->delay_error)
|
||||||
|
fpi_ssm_mark_failed (transfer->ssm,
|
||||||
|
g_steal_pointer (&self->delay_error));
|
||||||
|
else
|
||||||
|
fpi_ssm_mark_completed (transfer->ssm);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -109,7 +137,7 @@ cmd_receive_cb (FpiUsbTransfer *transfer,
|
|||||||
{
|
{
|
||||||
if (resp.response_id == BMKT_RSP_CANCEL_OP_OK)
|
if (resp.response_id == BMKT_RSP_CANCEL_OP_OK)
|
||||||
{
|
{
|
||||||
fp_dbg ("Received cancellation success resonse");
|
fp_dbg ("Received cancellation success response");
|
||||||
fpi_ssm_mark_failed (transfer->ssm,
|
fpi_ssm_mark_failed (transfer->ssm,
|
||||||
g_error_new_literal (G_IO_ERROR,
|
g_error_new_literal (G_IO_ERROR,
|
||||||
G_IO_ERROR_CANCELLED,
|
G_IO_ERROR_CANCELLED,
|
||||||
@@ -182,24 +210,37 @@ cmd_interrupt_cb (FpiUsbTransfer *transfer,
|
|||||||
GError *error)
|
GError *error)
|
||||||
{
|
{
|
||||||
g_debug ("interrupt transfer done");
|
g_debug ("interrupt transfer done");
|
||||||
|
fpi_device_critical_enter (device);
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||||
{
|
{
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
fpi_ssm_jump_to_state (transfer->ssm, SYNAPTICS_CMD_GET_RESP);
|
if (FPI_DEVICE_SYNAPTICS (device)->cmd_suspended)
|
||||||
|
fpi_ssm_jump_to_state (transfer->ssm, SYNAPTICS_CMD_SUSPENDED);
|
||||||
|
else
|
||||||
|
fpi_ssm_jump_to_state (transfer->ssm, SYNAPTICS_CMD_GET_RESP);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fpi_ssm_mark_failed (transfer->ssm, error);
|
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g_clear_pointer (&error, g_error_free);
|
|
||||||
|
|
||||||
if (transfer->buffer[0] & USB_ASYNC_MESSAGE_PENDING || error)
|
if (transfer->buffer[0] & USB_ASYNC_MESSAGE_PENDING)
|
||||||
fpi_ssm_next_state (transfer->ssm);
|
{
|
||||||
|
fpi_ssm_next_state (transfer->ssm);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
fpi_usb_transfer_submit (transfer, 1000, NULL, cmd_interrupt_cb, NULL);
|
{
|
||||||
|
fpi_device_critical_leave (device);
|
||||||
|
fpi_usb_transfer_submit (fpi_usb_transfer_ref (transfer),
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
cmd_interrupt_cb,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -241,6 +282,9 @@ synaptics_cmd_run_state (FpiSsm *ssm,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SYNAPTICS_CMD_WAIT_INTERRUPT:
|
case SYNAPTICS_CMD_WAIT_INTERRUPT:
|
||||||
|
/* Interruptions are permitted only during an interrupt transfer */
|
||||||
|
fpi_device_critical_leave (dev);
|
||||||
|
|
||||||
transfer = fpi_usb_transfer_new (dev);
|
transfer = fpi_usb_transfer_new (dev);
|
||||||
transfer->ssm = ssm;
|
transfer->ssm = ssm;
|
||||||
fpi_usb_transfer_fill_interrupt (transfer, USB_EP_INTERRUPT, USB_INTERRUPT_DATA_SIZE);
|
fpi_usb_transfer_fill_interrupt (transfer, USB_EP_INTERRUPT, USB_INTERRUPT_DATA_SIZE);
|
||||||
@@ -268,6 +312,17 @@ synaptics_cmd_run_state (FpiSsm *ssm,
|
|||||||
case SYNAPTICS_CMD_RESTART:
|
case SYNAPTICS_CMD_RESTART:
|
||||||
fpi_ssm_jump_to_state (ssm, SYNAPTICS_CMD_SEND_PENDING);
|
fpi_ssm_jump_to_state (ssm, SYNAPTICS_CMD_SEND_PENDING);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SYNAPTICS_CMD_SUSPENDED:
|
||||||
|
/* The resume handler continues to the next state! */
|
||||||
|
fpi_device_critical_leave (dev);
|
||||||
|
fpi_device_suspend_complete (dev, NULL);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SYNAPTICS_CMD_RESUME:
|
||||||
|
fpi_device_critical_enter (dev);
|
||||||
|
fpi_ssm_jump_to_state (ssm, SYNAPTICS_CMD_WAIT_INTERRUPT);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,6 +338,7 @@ cmd_ssm_done (FpiSsm *ssm, FpDevice *dev, GError *error)
|
|||||||
if (error || self->cmd_complete_on_removal)
|
if (error || self->cmd_complete_on_removal)
|
||||||
callback (self, NULL, error);
|
callback (self, NULL, error);
|
||||||
|
|
||||||
|
fpi_device_critical_leave (dev);
|
||||||
self->cmd_complete_on_removal = FALSE;
|
self->cmd_complete_on_removal = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -326,7 +382,7 @@ synaptics_sensor_cmd (FpiDeviceSynaptics *self,
|
|||||||
* may only be a cancellation currently). */
|
* may only be a cancellation currently). */
|
||||||
if (seq_num <= 0)
|
if (seq_num <= 0)
|
||||||
{
|
{
|
||||||
self->last_seq_num = MAX (1, self->last_seq_num + 1);
|
self->last_seq_num = MAX (1, (self->last_seq_num + 1) & 0xff);
|
||||||
real_seq_num = self->last_seq_num;
|
real_seq_num = self->last_seq_num;
|
||||||
if (seq_num == 0)
|
if (seq_num == 0)
|
||||||
self->cmd_seq_num = self->last_seq_num;
|
self->cmd_seq_num = self->last_seq_num;
|
||||||
@@ -392,6 +448,7 @@ synaptics_sensor_cmd (FpiDeviceSynaptics *self,
|
|||||||
SYNAPTICS_CMD_NUM_STATES);
|
SYNAPTICS_CMD_NUM_STATES);
|
||||||
fpi_ssm_set_data (self->cmd_ssm, callback, NULL);
|
fpi_ssm_set_data (self->cmd_ssm, callback, NULL);
|
||||||
|
|
||||||
|
fpi_device_critical_enter (FP_DEVICE (self));
|
||||||
fpi_ssm_start (self->cmd_ssm, cmd_ssm_done);
|
fpi_ssm_start (self->cmd_ssm, cmd_ssm_done);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -432,115 +489,35 @@ parse_print_data (GVariant *data,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static FpPrint *
|
||||||
list_msg_cb (FpiDeviceSynaptics *self,
|
create_print (FpiDeviceSynaptics *self,
|
||||||
bmkt_response_t *resp,
|
guint8 *user_id,
|
||||||
GError *error)
|
guint8 finger_id)
|
||||||
{
|
{
|
||||||
bmkt_enroll_templates_resp_t *get_enroll_templates_resp;
|
FpPrint *print;
|
||||||
|
g_autofree gchar *user_id_safe = NULL;
|
||||||
|
GVariant *data = NULL;
|
||||||
|
GVariant *uid = NULL;
|
||||||
|
|
||||||
if (error)
|
user_id_safe = g_strndup ((char *) user_id, BMKT_MAX_USER_ID_LEN);
|
||||||
{
|
|
||||||
g_clear_pointer (&self->list_result, g_ptr_array_unref);
|
|
||||||
fpi_device_list_complete (FP_DEVICE (self), NULL, error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
get_enroll_templates_resp = &resp->response.enroll_templates_resp;
|
print = fp_print_new (FP_DEVICE (self));
|
||||||
|
uid = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
|
||||||
|
user_id_safe,
|
||||||
|
strlen (user_id_safe),
|
||||||
|
1);
|
||||||
|
data = g_variant_new ("(y@ay)",
|
||||||
|
finger_id,
|
||||||
|
uid);
|
||||||
|
|
||||||
switch (resp->response_id)
|
fpi_print_set_type (print, FPI_PRINT_RAW);
|
||||||
{
|
fpi_print_set_device_stored (print, TRUE);
|
||||||
case BMKT_RSP_QUERY_FAIL:
|
g_object_set (print, "fpi-data", data, NULL);
|
||||||
if (resp->result == BMKT_FP_DATABASE_EMPTY)
|
g_object_set (print, "description", user_id_safe, NULL);
|
||||||
{
|
|
||||||
fp_info ("Database is empty");
|
|
||||||
|
|
||||||
fpi_device_list_complete (FP_DEVICE (self),
|
fpi_print_fill_from_user_id (print, user_id_safe);
|
||||||
g_steal_pointer (&self->list_result),
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fp_info ("Failed to query enrolled users: %d", resp->result);
|
|
||||||
g_clear_pointer (&self->list_result, g_ptr_array_unref);
|
|
||||||
fpi_device_list_complete (FP_DEVICE (self),
|
|
||||||
NULL,
|
|
||||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL,
|
|
||||||
"Failed to query enrolled users: %d",
|
|
||||||
resp->result));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BMKT_RSP_QUERY_RESPONSE_COMPLETE:
|
return print;
|
||||||
fp_info ("Query complete!");
|
|
||||||
|
|
||||||
fpi_device_list_complete (FP_DEVICE (self),
|
|
||||||
g_steal_pointer (&self->list_result),
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BMKT_RSP_TEMPLATE_RECORDS_REPORT:
|
|
||||||
|
|
||||||
for (int n = 0; n < BMKT_MAX_NUM_TEMPLATES_INTERNAL_FLASH; n++)
|
|
||||||
{
|
|
||||||
GVariant *data = NULL;
|
|
||||||
GVariant *uid = NULL;
|
|
||||||
FpPrint *print;
|
|
||||||
gchar *userid;
|
|
||||||
|
|
||||||
if (get_enroll_templates_resp->templates[n].user_id_len == 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
fp_info ("![query %d of %d] template %d: status=0x%x, userId=%s, fingerId=%d",
|
|
||||||
get_enroll_templates_resp->query_sequence,
|
|
||||||
get_enroll_templates_resp->total_query_messages,
|
|
||||||
n,
|
|
||||||
get_enroll_templates_resp->templates[n].template_status,
|
|
||||||
get_enroll_templates_resp->templates[n].user_id,
|
|
||||||
get_enroll_templates_resp->templates[n].finger_id);
|
|
||||||
|
|
||||||
userid = (gchar *) get_enroll_templates_resp->templates[n].user_id;
|
|
||||||
|
|
||||||
print = fp_print_new (FP_DEVICE (self));
|
|
||||||
uid = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
|
|
||||||
get_enroll_templates_resp->templates[n].user_id,
|
|
||||||
get_enroll_templates_resp->templates[n].user_id_len,
|
|
||||||
1);
|
|
||||||
data = g_variant_new ("(y@ay)",
|
|
||||||
get_enroll_templates_resp->templates[n].finger_id,
|
|
||||||
uid);
|
|
||||||
|
|
||||||
fpi_print_set_type (print, FPI_PRINT_RAW);
|
|
||||||
fpi_print_set_device_stored (print, TRUE);
|
|
||||||
g_object_set (print, "fpi-data", data, NULL);
|
|
||||||
g_object_set (print, "description", get_enroll_templates_resp->templates[n].user_id, NULL);
|
|
||||||
|
|
||||||
fpi_print_fill_from_user_id (print, userid);
|
|
||||||
|
|
||||||
g_ptr_array_add (self->list_result, g_object_ref_sink (print));
|
|
||||||
}
|
|
||||||
|
|
||||||
synaptics_sensor_cmd (self,
|
|
||||||
self->cmd_seq_num,
|
|
||||||
BMKT_CMD_GET_NEXT_QUERY_RESPONSE,
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
list (FpDevice *device)
|
|
||||||
{
|
|
||||||
FpiDeviceSynaptics *self = FPI_DEVICE_SYNAPTICS (device);
|
|
||||||
|
|
||||||
G_DEBUG_HERE ();
|
|
||||||
|
|
||||||
self->list_result = g_ptr_array_new_with_free_func (g_object_unref);
|
|
||||||
synaptics_sensor_cmd (self, 0, BMKT_CMD_GET_TEMPLATE_RECORDS, NULL, 0, list_msg_cb);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -567,6 +544,12 @@ verify_msg_cb (FpiDeviceSynaptics *self,
|
|||||||
FpDevice *device = FP_DEVICE (self);
|
FpDevice *device = FP_DEVICE (self);
|
||||||
bmkt_verify_resp_t *verify_resp;
|
bmkt_verify_resp_t *verify_resp;
|
||||||
|
|
||||||
|
if (self->action_starting)
|
||||||
|
{
|
||||||
|
fpi_device_critical_leave (device);
|
||||||
|
self->action_starting = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
fpi_device_verify_complete (device, error);
|
fpi_device_verify_complete (device, error);
|
||||||
@@ -586,6 +569,9 @@ verify_msg_cb (FpiDeviceSynaptics *self,
|
|||||||
switch (resp->response_id)
|
switch (resp->response_id)
|
||||||
{
|
{
|
||||||
case BMKT_RSP_VERIFY_READY:
|
case BMKT_RSP_VERIFY_READY:
|
||||||
|
fpi_device_report_finger_status_changes (device,
|
||||||
|
FP_FINGER_STATUS_NEEDED,
|
||||||
|
FP_FINGER_STATUS_NONE);
|
||||||
fp_info ("Place Finger on the Sensor!");
|
fp_info ("Place Finger on the Sensor!");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -627,7 +613,7 @@ verify_msg_cb (FpiDeviceSynaptics *self,
|
|||||||
fp_info ("Verify was successful! for user: %s finger: %d score: %f",
|
fp_info ("Verify was successful! for user: %s finger: %d score: %f",
|
||||||
verify_resp->user_id, verify_resp->finger_id, verify_resp->match_result);
|
verify_resp->user_id, verify_resp->finger_id, verify_resp->match_result);
|
||||||
fpi_device_verify_report (device, FPI_MATCH_SUCCESS, NULL, NULL);
|
fpi_device_verify_report (device, FPI_MATCH_SUCCESS, NULL, NULL);
|
||||||
fpi_device_verify_complete (device, NULL);
|
verify_complete_after_finger_removal (self);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -656,9 +642,244 @@ verify (FpDevice *device)
|
|||||||
|
|
||||||
G_DEBUG_HERE ();
|
G_DEBUG_HERE ();
|
||||||
|
|
||||||
|
self->action_starting = TRUE;
|
||||||
|
fpi_device_critical_enter (device);
|
||||||
synaptics_sensor_cmd (self, 0, BMKT_CMD_VERIFY_USER, user_id, user_id_len, verify_msg_cb);
|
synaptics_sensor_cmd (self, 0, BMKT_CMD_VERIFY_USER, user_id, user_id_len, verify_msg_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
identify_complete_after_finger_removal (FpiDeviceSynaptics *self, GError *error)
|
||||||
|
{
|
||||||
|
FpDevice *device = FP_DEVICE (self);
|
||||||
|
|
||||||
|
if (self->finger_on_sensor)
|
||||||
|
{
|
||||||
|
fp_dbg ("delaying identify report until after finger removal!");
|
||||||
|
if (error)
|
||||||
|
g_propagate_error (&self->delay_error, error);
|
||||||
|
|
||||||
|
self->cmd_complete_on_removal = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fpi_device_identify_complete (device, error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
identify_msg_cb (FpiDeviceSynaptics *self,
|
||||||
|
bmkt_response_t *resp,
|
||||||
|
GError *error)
|
||||||
|
{
|
||||||
|
FpDevice *device = FP_DEVICE (self);
|
||||||
|
|
||||||
|
if (self->action_starting)
|
||||||
|
{
|
||||||
|
fpi_device_critical_leave (device);
|
||||||
|
self->action_starting = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
fpi_device_identify_complete (device, error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (resp == NULL && self->cmd_complete_on_removal)
|
||||||
|
{
|
||||||
|
fpi_device_identify_complete (device, NULL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_assert (resp != NULL);
|
||||||
|
|
||||||
|
switch (resp->response_id)
|
||||||
|
{
|
||||||
|
case BMKT_RSP_ID_READY:
|
||||||
|
fp_info ("Place Finger on the Sensor!");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BMKT_RSP_SEND_NEXT_USER_ID:
|
||||||
|
{
|
||||||
|
compose_and_send_identify_msg (device);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case BMKT_RSP_ID_FAIL:
|
||||||
|
if (resp->result == BMKT_SENSOR_STIMULUS_ERROR)
|
||||||
|
{
|
||||||
|
fp_info ("Match error occurred");
|
||||||
|
fpi_device_identify_report (device, NULL, NULL,
|
||||||
|
fpi_device_retry_new (FP_DEVICE_RETRY_GENERAL));
|
||||||
|
identify_complete_after_finger_removal (self, NULL);
|
||||||
|
}
|
||||||
|
else if (resp->result == BMKT_FP_NO_MATCH)
|
||||||
|
{
|
||||||
|
fp_info ("Print didn't match");
|
||||||
|
fpi_device_identify_report (device, NULL, NULL, NULL);
|
||||||
|
identify_complete_after_finger_removal (self, NULL);
|
||||||
|
}
|
||||||
|
else if (resp->result == BMKT_FP_DATABASE_NO_RECORD_EXISTS || resp->result == BMKT_FP_DATABASE_EMPTY)
|
||||||
|
{
|
||||||
|
fp_info ("Print is not in database");
|
||||||
|
identify_complete_after_finger_removal (self, fpi_device_error_new (FP_DEVICE_ERROR_DATA_NOT_FOUND));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fp_warn ("identify has failed: %d", resp->result);
|
||||||
|
fpi_device_identify_complete (device,
|
||||||
|
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||||
|
"Unexpected result from device %d",
|
||||||
|
resp->result));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BMKT_RSP_ID_OK:
|
||||||
|
{
|
||||||
|
FpPrint *print = NULL;
|
||||||
|
GPtrArray *prints = NULL;
|
||||||
|
g_autoptr(GVariant) data = NULL;
|
||||||
|
gboolean found = FALSE;
|
||||||
|
guint index;
|
||||||
|
|
||||||
|
print = create_print (self,
|
||||||
|
resp->response.id_resp.user_id,
|
||||||
|
resp->response.id_resp.finger_id);
|
||||||
|
|
||||||
|
fpi_device_get_identify_data (device, &prints);
|
||||||
|
|
||||||
|
found = g_ptr_array_find_with_equal_func (prints,
|
||||||
|
print,
|
||||||
|
(GEqualFunc) fp_print_equal,
|
||||||
|
&index);
|
||||||
|
|
||||||
|
if (found)
|
||||||
|
fpi_device_identify_report (device, g_ptr_array_index (prints, index), print, NULL);
|
||||||
|
else
|
||||||
|
fpi_device_identify_report (device, NULL, print, NULL);
|
||||||
|
|
||||||
|
identify_complete_after_finger_removal (self, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
identify (FpDevice *device)
|
||||||
|
{
|
||||||
|
GPtrArray *prints = NULL;
|
||||||
|
FpiDeviceSynaptics *self = FPI_DEVICE_SYNAPTICS (device);
|
||||||
|
|
||||||
|
fpi_device_get_identify_data (device, &prints);
|
||||||
|
|
||||||
|
/* Identify over no prints does not work for synaptics.
|
||||||
|
* This *may* make sense for other devices though, as identify may return
|
||||||
|
* a matched print even if it is not in the list of prints.
|
||||||
|
*/
|
||||||
|
if (prints->len == 0)
|
||||||
|
{
|
||||||
|
fpi_device_identify_report (device, NULL, NULL, NULL);
|
||||||
|
fpi_device_identify_complete (device, NULL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
self->action_starting = TRUE;
|
||||||
|
fpi_device_critical_enter (device);
|
||||||
|
|
||||||
|
init_identify_msg (device);
|
||||||
|
compose_and_send_identify_msg (device);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
init_identify_msg (FpDevice *device)
|
||||||
|
{
|
||||||
|
FpiDeviceSynaptics *self = FPI_DEVICE_SYNAPTICS (device);
|
||||||
|
|
||||||
|
self->id_idx = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
compose_and_send_identify_msg (FpDevice *device)
|
||||||
|
{
|
||||||
|
FpiDeviceSynaptics *self = FPI_DEVICE_SYNAPTICS (device);
|
||||||
|
FpPrint *print = NULL;
|
||||||
|
GPtrArray *prints = NULL;
|
||||||
|
|
||||||
|
g_autoptr(GVariant) data = NULL;
|
||||||
|
guint8 finger;
|
||||||
|
const guint8 *user_id;
|
||||||
|
gsize user_id_len = 0;
|
||||||
|
g_autofree guint8 *payload = NULL;
|
||||||
|
guint8 payload_len = 0;
|
||||||
|
guint8 payloadOffset = 0;
|
||||||
|
|
||||||
|
fpi_device_get_identify_data (device, &prints);
|
||||||
|
if (prints->len > UINT8_MAX)
|
||||||
|
{
|
||||||
|
fpi_device_identify_complete (device,
|
||||||
|
fpi_device_error_new (FP_DEVICE_ERROR_DATA_INVALID));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(self->id_idx >= prints->len)
|
||||||
|
{
|
||||||
|
fp_warn ("Device asked for more prints than we are providing.");
|
||||||
|
fpi_device_identify_complete (device,
|
||||||
|
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||||
|
"Unexpected index"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
print = g_ptr_array_index (prints, self->id_idx);
|
||||||
|
g_object_get (print, "fpi-data", &data, NULL);
|
||||||
|
g_debug ("data is %p", data);
|
||||||
|
if (!parse_print_data (data, &finger, &user_id, &user_id_len))
|
||||||
|
{
|
||||||
|
fpi_device_identify_complete (device,
|
||||||
|
fpi_device_error_new (FP_DEVICE_ERROR_DATA_INVALID));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(self->id_idx == 0)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Construct payload.
|
||||||
|
* 1st byte is total number of IDs in list.
|
||||||
|
* 2nd byte is number of IDs in list.
|
||||||
|
* 1 byte for each ID length, maximum id length is 100.
|
||||||
|
* user_id_len bytes of each ID
|
||||||
|
*/
|
||||||
|
payload_len = 2 + 1 + user_id_len;
|
||||||
|
payload = g_malloc0 (payload_len);
|
||||||
|
payload[payloadOffset] = prints->len;
|
||||||
|
payloadOffset += 1;
|
||||||
|
payload[payloadOffset] = 1; /* send one id per message */
|
||||||
|
payloadOffset += 1;
|
||||||
|
payload[payloadOffset] = user_id_len;
|
||||||
|
payloadOffset += 1;
|
||||||
|
memcpy (&payload[payloadOffset], user_id, user_id_len);
|
||||||
|
payloadOffset += user_id_len;
|
||||||
|
|
||||||
|
G_DEBUG_HERE ();
|
||||||
|
|
||||||
|
synaptics_sensor_cmd (self, 0, BMKT_CMD_ID_USER_IN_ORDER, payload, payloadOffset, identify_msg_cb);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* 1st byte is the number of IDs
|
||||||
|
* 1 byte for each ID length
|
||||||
|
* id_length bytes for each ID
|
||||||
|
*/
|
||||||
|
payload_len = 1 + 1 + user_id_len;
|
||||||
|
payload = g_malloc0 (payload_len);
|
||||||
|
payload[payloadOffset] = 1; /* send one id per message */
|
||||||
|
payloadOffset += 1;
|
||||||
|
payload[payloadOffset] = user_id_len;
|
||||||
|
payloadOffset += 1;
|
||||||
|
memcpy (&payload[payloadOffset], user_id, user_id_len);
|
||||||
|
payloadOffset += user_id_len;
|
||||||
|
synaptics_sensor_cmd (self, self->cmd_seq_num, BMKT_CMD_ID_NEXT_USER, payload, payloadOffset, NULL);
|
||||||
|
}
|
||||||
|
self->id_idx++;
|
||||||
|
}
|
||||||
static void
|
static void
|
||||||
enroll_msg_cb (FpiDeviceSynaptics *self,
|
enroll_msg_cb (FpiDeviceSynaptics *self,
|
||||||
bmkt_response_t *resp,
|
bmkt_response_t *resp,
|
||||||
@@ -667,6 +888,12 @@ enroll_msg_cb (FpiDeviceSynaptics *self,
|
|||||||
FpDevice *device = FP_DEVICE (self);
|
FpDevice *device = FP_DEVICE (self);
|
||||||
bmkt_enroll_resp_t *enroll_resp;
|
bmkt_enroll_resp_t *enroll_resp;
|
||||||
|
|
||||||
|
if (self->action_starting)
|
||||||
|
{
|
||||||
|
fpi_device_critical_leave (device);
|
||||||
|
self->action_starting = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
fpi_device_enroll_complete (device, NULL, error);
|
fpi_device_enroll_complete (device, NULL, error);
|
||||||
@@ -680,6 +907,9 @@ enroll_msg_cb (FpiDeviceSynaptics *self,
|
|||||||
case BMKT_RSP_ENROLL_READY:
|
case BMKT_RSP_ENROLL_READY:
|
||||||
{
|
{
|
||||||
self->enroll_stage = 0;
|
self->enroll_stage = 0;
|
||||||
|
fpi_device_report_finger_status_changes (device,
|
||||||
|
FP_FINGER_STATUS_NEEDED,
|
||||||
|
FP_FINGER_STATUS_NONE);
|
||||||
fp_info ("Place Finger on the Sensor!");
|
fp_info ("Place Finger on the Sensor!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -810,6 +1040,9 @@ enroll (FpDevice *device)
|
|||||||
payload[1] = finger;
|
payload[1] = finger;
|
||||||
memcpy (payload + 2, user_id, user_id_len);
|
memcpy (payload + 2, user_id, user_id_len);
|
||||||
|
|
||||||
|
self->action_starting = TRUE;
|
||||||
|
fpi_device_critical_enter (device);
|
||||||
|
|
||||||
synaptics_sensor_cmd (self, 0, BMKT_CMD_ENROLL_USER, payload, user_id_len + 2, enroll_msg_cb);
|
synaptics_sensor_cmd (self, 0, BMKT_CMD_ENROLL_USER, payload, user_id_len + 2, enroll_msg_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -823,6 +1056,7 @@ delete_msg_cb (FpiDeviceSynaptics *self,
|
|||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
|
fpi_device_critical_leave (device);
|
||||||
fpi_device_delete_complete (device, error);
|
fpi_device_delete_complete (device, error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -837,17 +1071,24 @@ delete_msg_cb (FpiDeviceSynaptics *self,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case BMKT_RSP_DEL_USER_FP_FAIL:
|
case BMKT_RSP_DEL_USER_FP_FAIL:
|
||||||
fp_info ("Failed to delete enrolled user: %d", resp->result);
|
fpi_device_critical_leave (device);
|
||||||
if (resp->result == BMKT_FP_DATABASE_NO_RECORD_EXISTS)
|
if (resp->result == BMKT_FP_DATABASE_NO_RECORD_EXISTS ||
|
||||||
fpi_device_delete_complete (device,
|
resp->result == BMKT_FP_DATABASE_EMPTY)
|
||||||
fpi_device_error_new (FP_DEVICE_ERROR_DATA_NOT_FOUND));
|
{
|
||||||
|
fp_info ("Database no record");
|
||||||
|
fpi_device_delete_complete (device, NULL);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
fpi_device_delete_complete (device,
|
{
|
||||||
fpi_device_error_new (FP_DEVICE_ERROR_GENERAL));
|
fp_info ("Failed to delete enrolled user: %d", resp->result);
|
||||||
|
fpi_device_delete_complete (device,
|
||||||
|
fpi_device_error_new (FP_DEVICE_ERROR_GENERAL));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BMKT_RSP_DEL_USER_FP_OK:
|
case BMKT_RSP_DEL_USER_FP_OK:
|
||||||
fp_info ("Successfully deleted enrolled user");
|
fp_info ("Successfully deleted enrolled user");
|
||||||
|
fpi_device_critical_leave (device);
|
||||||
fpi_device_delete_complete (device, NULL);
|
fpi_device_delete_complete (device, NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -882,9 +1123,105 @@ delete_print (FpDevice *device)
|
|||||||
payload[0] = finger;
|
payload[0] = finger;
|
||||||
memcpy (payload + 1, user_id, user_id_len);
|
memcpy (payload + 1, user_id, user_id_len);
|
||||||
|
|
||||||
|
fpi_device_critical_enter (device);
|
||||||
synaptics_sensor_cmd (self, 0, BMKT_CMD_DEL_USER_FP, payload, user_id_len + 1, delete_msg_cb);
|
synaptics_sensor_cmd (self, 0, BMKT_CMD_DEL_USER_FP, payload, user_id_len + 1, delete_msg_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clear_storage_msg_cb (FpiDeviceSynaptics *self,
|
||||||
|
bmkt_response_t *resp,
|
||||||
|
GError *error)
|
||||||
|
{
|
||||||
|
FpDevice *device = FP_DEVICE (self);
|
||||||
|
bmkt_del_all_users_resp_t *del_all_user_resp;
|
||||||
|
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
fpi_device_clear_storage_complete (device, error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
del_all_user_resp = &resp->response.del_all_user_resp;
|
||||||
|
|
||||||
|
switch (resp->response_id)
|
||||||
|
{
|
||||||
|
case BMKT_RSP_DELETE_PROGRESS:
|
||||||
|
fp_info ("Deleting All Enrolled Users is %d%% complete",
|
||||||
|
del_all_user_resp->progress);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BMKT_RSP_DEL_FULL_DB_FAIL:
|
||||||
|
if (resp->result == BMKT_FP_DATABASE_EMPTY)
|
||||||
|
fpi_device_clear_storage_complete (device, NULL);
|
||||||
|
else
|
||||||
|
fpi_device_clear_storage_complete (device,
|
||||||
|
fpi_device_error_new (FP_DEVICE_ERROR_GENERAL));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BMKT_RSP_DEL_FULL_DB_OK:
|
||||||
|
fp_info ("Successfully deleted all enrolled user");
|
||||||
|
fpi_device_clear_storage_complete (device, NULL);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clear_storage (FpDevice *device)
|
||||||
|
{
|
||||||
|
FpiDeviceSynaptics *self = FPI_DEVICE_SYNAPTICS (device);
|
||||||
|
|
||||||
|
g_debug ("clear all prints in database");
|
||||||
|
synaptics_sensor_cmd (self, 0, BMKT_CMD_DEL_FULL_DB, NULL, 0, clear_storage_msg_cb);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
prob_msg_cb (FpiDeviceSynaptics *self,
|
||||||
|
bmkt_response_t *resp,
|
||||||
|
GError *error)
|
||||||
|
{
|
||||||
|
GUsbDevice *usb_dev = NULL;
|
||||||
|
g_autofree gchar *serial = NULL;
|
||||||
|
GError *err = NULL;
|
||||||
|
|
||||||
|
usb_dev = fpi_device_get_usb_device (FP_DEVICE (self));
|
||||||
|
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||||
|
err = fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL, "unsupported firmware version");
|
||||||
|
|
||||||
|
g_usb_device_close (usb_dev, NULL);
|
||||||
|
fpi_device_probe_complete (FP_DEVICE (self), NULL, NULL, err);
|
||||||
|
g_clear_error (&error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g_strcmp0 (g_getenv ("FP_DEVICE_EMULATION"), "1") == 0)
|
||||||
|
serial = g_strdup ("emulated-device");
|
||||||
|
else
|
||||||
|
serial = g_usb_device_get_string_descriptor (usb_dev,
|
||||||
|
g_usb_device_get_serial_number_index (usb_dev),
|
||||||
|
&err);
|
||||||
|
|
||||||
|
/* BMKT_OPERATION_DENIED is returned if the sensor is already initialized */
|
||||||
|
if (resp->result == BMKT_SUCCESS || resp->result == BMKT_OPERATION_DENIED)
|
||||||
|
{
|
||||||
|
g_usb_device_close (usb_dev, NULL);
|
||||||
|
fpi_device_probe_complete (FP_DEVICE (self), serial, NULL, err);
|
||||||
|
}
|
||||||
|
else if (resp->result == BMKT_FP_SYSTEM_BUSY)
|
||||||
|
{
|
||||||
|
synaptics_sensor_cmd (self, self->cmd_seq_num, BMKT_CMD_CANCEL_OP, NULL, 0, NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_warning ("Probe fingerprint sensor failed with %d!", resp->result);
|
||||||
|
g_usb_device_close (usb_dev, NULL);
|
||||||
|
fpi_device_probe_complete (FP_DEVICE (self), serial, NULL, fpi_device_error_new (FP_DEVICE_ERROR_GENERAL));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dev_probe (FpDevice *device)
|
dev_probe (FpDevice *device)
|
||||||
{
|
{
|
||||||
@@ -910,9 +1247,6 @@ dev_probe (FpDevice *device)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_usb_device_reset (usb_dev, &error))
|
|
||||||
goto err_close;
|
|
||||||
|
|
||||||
if (!g_usb_device_claim_interface (usb_dev, 0, 0, &error))
|
if (!g_usb_device_claim_interface (usb_dev, 0, 0, &error))
|
||||||
goto err_close;
|
goto err_close;
|
||||||
|
|
||||||
@@ -985,40 +1319,7 @@ dev_probe (FpDevice *device)
|
|||||||
fp_dbg ("Target: %d", self->mis_version.target);
|
fp_dbg ("Target: %d", self->mis_version.target);
|
||||||
fp_dbg ("Product: %d", self->mis_version.product);
|
fp_dbg ("Product: %d", self->mis_version.product);
|
||||||
|
|
||||||
|
synaptics_sensor_cmd (self, 0, BMKT_CMD_FPS_INIT, NULL, 0, prob_msg_cb);
|
||||||
/* We need at least firmware version 10.1, and for 10.1 build 2989158 */
|
|
||||||
if (self->mis_version.version_major < 10 ||
|
|
||||||
self->mis_version.version_minor < 1 ||
|
|
||||||
(self->mis_version.version_major == 10 &&
|
|
||||||
self->mis_version.version_minor == 1 &&
|
|
||||||
self->mis_version.build_num < 2989158))
|
|
||||||
{
|
|
||||||
fp_warn ("Firmware version %d.%d with build number %d is unsupported",
|
|
||||||
self->mis_version.version_major,
|
|
||||||
self->mis_version.version_minor,
|
|
||||||
self->mis_version.build_num);
|
|
||||||
|
|
||||||
error = fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL,
|
|
||||||
"Unsupported firmware version "
|
|
||||||
"(%d.%d with build number %d)",
|
|
||||||
self->mis_version.version_major,
|
|
||||||
self->mis_version.version_minor,
|
|
||||||
self->mis_version.build_num);
|
|
||||||
goto err_close;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This is the same as the serial_number from above, hex encoded and somewhat reordered */
|
|
||||||
/* Should we add in more, e.g. the chip revision? */
|
|
||||||
if (g_strcmp0 (g_getenv ("FP_DEVICE_EMULATION"), "1") == 0)
|
|
||||||
serial = g_strdup ("emulated-device");
|
|
||||||
else
|
|
||||||
serial = g_usb_device_get_string_descriptor (usb_dev,
|
|
||||||
g_usb_device_get_serial_number_index (usb_dev),
|
|
||||||
&error);
|
|
||||||
|
|
||||||
g_usb_device_close (usb_dev, NULL);
|
|
||||||
|
|
||||||
fpi_device_probe_complete (device, serial, NULL, error);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1034,6 +1335,9 @@ fps_init_msg_cb (FpiDeviceSynaptics *self,
|
|||||||
{
|
{
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
|
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||||
|
g_clear_error (&error);
|
||||||
|
|
||||||
fpi_device_open_complete (FP_DEVICE (self), error);
|
fpi_device_open_complete (FP_DEVICE (self), error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1043,6 +1347,10 @@ fps_init_msg_cb (FpiDeviceSynaptics *self,
|
|||||||
{
|
{
|
||||||
fpi_device_open_complete (FP_DEVICE (self), NULL);
|
fpi_device_open_complete (FP_DEVICE (self), NULL);
|
||||||
}
|
}
|
||||||
|
else if (resp->result == BMKT_FP_SYSTEM_BUSY)
|
||||||
|
{
|
||||||
|
synaptics_sensor_cmd (self, self->cmd_seq_num, BMKT_CMD_CANCEL_OP, NULL, 0, NULL);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_warning ("Initializing fingerprint sensor failed with %d!", resp->result);
|
g_warning ("Initializing fingerprint sensor failed with %d!", resp->result);
|
||||||
@@ -1055,8 +1363,12 @@ fps_deinit_cb (FpiDeviceSynaptics *self,
|
|||||||
bmkt_response_t *resp,
|
bmkt_response_t *resp,
|
||||||
GError *error)
|
GError *error)
|
||||||
{
|
{
|
||||||
|
g_autoptr(GError) err = NULL;
|
||||||
|
|
||||||
/* Release usb interface */
|
/* Release usb interface */
|
||||||
g_usb_device_release_interface (fpi_device_get_usb_device (FP_DEVICE (self)), 0, 0, &error);
|
g_usb_device_release_interface (fpi_device_get_usb_device (FP_DEVICE (self)), 0, 0, &err);
|
||||||
|
if (!error)
|
||||||
|
error = g_steal_pointer (&err);
|
||||||
|
|
||||||
g_clear_object (&self->interrupt_cancellable);
|
g_clear_object (&self->interrupt_cancellable);
|
||||||
|
|
||||||
@@ -1089,9 +1401,6 @@ dev_init (FpDevice *device)
|
|||||||
|
|
||||||
self->interrupt_cancellable = g_cancellable_new ();
|
self->interrupt_cancellable = g_cancellable_new ();
|
||||||
|
|
||||||
if (!g_usb_device_reset (fpi_device_get_usb_device (device), &error))
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
/* Claim usb interface */
|
/* Claim usb interface */
|
||||||
if (!g_usb_device_claim_interface (fpi_device_get_usb_device (device), 0, 0, &error))
|
if (!g_usb_device_claim_interface (fpi_device_get_usb_device (device), 0, 0, &error))
|
||||||
goto error;
|
goto error;
|
||||||
@@ -1130,6 +1439,59 @@ cancel (FpDevice *dev)
|
|||||||
self->interrupt_cancellable = g_cancellable_new ();
|
self->interrupt_cancellable = g_cancellable_new ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
suspend (FpDevice *dev)
|
||||||
|
{
|
||||||
|
FpiDeviceSynaptics *self = FPI_DEVICE_SYNAPTICS (dev);
|
||||||
|
FpiDeviceAction action = fpi_device_get_current_action (dev);
|
||||||
|
|
||||||
|
g_debug ("got suspend request");
|
||||||
|
|
||||||
|
if (action != FPI_DEVICE_ACTION_VERIFY && action != FPI_DEVICE_ACTION_IDENTIFY)
|
||||||
|
{
|
||||||
|
fpi_device_suspend_complete (dev, fpi_device_error_new (FP_DEVICE_ERROR_NOT_SUPPORTED));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* We are guaranteed to have a cmd_ssm running at this time. */
|
||||||
|
g_assert (self->cmd_ssm);
|
||||||
|
g_assert (fpi_ssm_get_cur_state (self->cmd_ssm) == SYNAPTICS_CMD_WAIT_INTERRUPT);
|
||||||
|
self->cmd_suspended = TRUE;
|
||||||
|
|
||||||
|
/* Cancel the current transfer.
|
||||||
|
* The CMD SSM will go into the suspend state and signal readyness. */
|
||||||
|
g_cancellable_cancel (self->interrupt_cancellable);
|
||||||
|
g_clear_object (&self->interrupt_cancellable);
|
||||||
|
self->interrupt_cancellable = g_cancellable_new ();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
resume (FpDevice *dev)
|
||||||
|
{
|
||||||
|
FpiDeviceSynaptics *self = FPI_DEVICE_SYNAPTICS (dev);
|
||||||
|
FpiDeviceAction action = fpi_device_get_current_action (dev);
|
||||||
|
|
||||||
|
g_debug ("got resume request");
|
||||||
|
|
||||||
|
if (action != FPI_DEVICE_ACTION_VERIFY && action != FPI_DEVICE_ACTION_IDENTIFY)
|
||||||
|
{
|
||||||
|
g_assert_not_reached ();
|
||||||
|
fpi_device_resume_complete (dev, fpi_device_error_new (FP_DEVICE_ERROR_NOT_SUPPORTED));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* We must have a suspended cmd_ssm at this point */
|
||||||
|
g_assert (self->cmd_ssm);
|
||||||
|
g_assert (self->cmd_suspended);
|
||||||
|
g_assert (fpi_ssm_get_cur_state (self->cmd_ssm) == SYNAPTICS_CMD_SUSPENDED);
|
||||||
|
self->cmd_suspended = FALSE;
|
||||||
|
|
||||||
|
/* Restart interrupt transfer. */
|
||||||
|
fpi_ssm_jump_to_state (self->cmd_ssm, SYNAPTICS_CMD_RESUME);
|
||||||
|
|
||||||
|
fpi_device_resume_complete (dev, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fpi_device_synaptics_init (FpiDeviceSynaptics *self)
|
fpi_device_synaptics_init (FpiDeviceSynaptics *self)
|
||||||
{
|
{
|
||||||
@@ -1147,13 +1509,19 @@ fpi_device_synaptics_class_init (FpiDeviceSynapticsClass *klass)
|
|||||||
dev_class->scan_type = FP_SCAN_TYPE_PRESS;
|
dev_class->scan_type = FP_SCAN_TYPE_PRESS;
|
||||||
dev_class->id_table = id_table;
|
dev_class->id_table = id_table;
|
||||||
dev_class->nr_enroll_stages = ENROLL_SAMPLES;
|
dev_class->nr_enroll_stages = ENROLL_SAMPLES;
|
||||||
|
dev_class->temp_hot_seconds = -1;
|
||||||
|
|
||||||
dev_class->open = dev_init;
|
dev_class->open = dev_init;
|
||||||
dev_class->close = dev_exit;
|
dev_class->close = dev_exit;
|
||||||
dev_class->probe = dev_probe;
|
dev_class->probe = dev_probe;
|
||||||
dev_class->verify = verify;
|
dev_class->verify = verify;
|
||||||
|
dev_class->identify = identify;
|
||||||
dev_class->enroll = enroll;
|
dev_class->enroll = enroll;
|
||||||
dev_class->delete = delete_print;
|
dev_class->delete = delete_print;
|
||||||
|
dev_class->clear_storage = clear_storage;
|
||||||
dev_class->cancel = cancel;
|
dev_class->cancel = cancel;
|
||||||
dev_class->list = list;
|
dev_class->suspend = suspend;
|
||||||
|
dev_class->resume = resume;
|
||||||
|
|
||||||
|
fpi_device_class_auto_initialize_features (dev_class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,8 @@ typedef enum {
|
|||||||
SYNAPTICS_CMD_WAIT_INTERRUPT,
|
SYNAPTICS_CMD_WAIT_INTERRUPT,
|
||||||
SYNAPTICS_CMD_SEND_ASYNC,
|
SYNAPTICS_CMD_SEND_ASYNC,
|
||||||
SYNAPTICS_CMD_RESTART,
|
SYNAPTICS_CMD_RESTART,
|
||||||
|
SYNAPTICS_CMD_SUSPENDED,
|
||||||
|
SYNAPTICS_CMD_RESUME,
|
||||||
SYNAPTICS_CMD_NUM_STATES,
|
SYNAPTICS_CMD_NUM_STATES,
|
||||||
} SynapticsCmdState;
|
} SynapticsCmdState;
|
||||||
|
|
||||||
@@ -110,9 +112,12 @@ struct _FpiDeviceSynaptics
|
|||||||
FpiSsm *cmd_ssm;
|
FpiSsm *cmd_ssm;
|
||||||
FpiUsbTransfer *cmd_pending_transfer;
|
FpiUsbTransfer *cmd_pending_transfer;
|
||||||
gboolean cmd_complete_on_removal;
|
gboolean cmd_complete_on_removal;
|
||||||
|
gboolean cmd_suspended;
|
||||||
|
guint8 id_idx;
|
||||||
|
|
||||||
bmkt_sensor_version_t mis_version;
|
bmkt_sensor_version_t mis_version;
|
||||||
|
|
||||||
|
gboolean action_starting;
|
||||||
GCancellable *interrupt_cancellable;
|
GCancellable *interrupt_cancellable;
|
||||||
|
|
||||||
gint enroll_stage;
|
gint enroll_stage;
|
||||||
@@ -122,4 +127,5 @@ struct _FpiDeviceSynaptics
|
|||||||
|
|
||||||
struct syna_enroll_resp_data enroll_resp_data;
|
struct syna_enroll_resp_data enroll_resp_data;
|
||||||
syna_state_t state;
|
syna_state_t state;
|
||||||
|
GError *delay_error;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,21 +1,24 @@
|
|||||||
/*
|
/*
|
||||||
* LGPL CRC code copied from GStreamer-0.10.10:
|
* Code copied from gstreamer-plugins-bad gst/gdp/dataprotocol.c
|
||||||
|
*
|
||||||
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
||||||
* Copyright (C) 2004,2006 Thomas Vander Stichele <thomas at apestaart dot org>
|
* Copyright (C) 2004,2006 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
* Copyright (C) 2014 Tim-Philipp Müller <tim centricular 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; version
|
|
||||||
* 2.1 of the License.
|
|
||||||
*
|
*
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* 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
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* Lesser General Public License for more details.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
|
* 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "upek_proto.h"
|
#include "upek_proto.h"
|
||||||
|
|||||||
@@ -1,21 +1,24 @@
|
|||||||
/*
|
/*
|
||||||
* LGPL CRC code copied from GStreamer-0.10.10:
|
* Code copied from gstreamer-plugins-bad gst/gdp/dataprotocol.c
|
||||||
|
*
|
||||||
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
||||||
* Copyright (C) 2004,2006 Thomas Vander Stichele <thomas at apestaart dot org>
|
* Copyright (C) 2004,2006 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
* Copyright (C) 2014 Tim-Philipp Müller <tim centricular 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; version
|
|
||||||
* 2.1 of the License.
|
|
||||||
*
|
*
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* 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
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* Lesser General Public License for more details.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
|
* 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|||||||
@@ -74,26 +74,26 @@ struct _FpiDeviceUpeksonly
|
|||||||
FpiSsm *loopsm;
|
FpiSsm *loopsm;
|
||||||
|
|
||||||
/* Do we really need multiple concurrent transfers? */
|
/* Do we really need multiple concurrent transfers? */
|
||||||
GCancellable *img_cancellable;
|
GCancellable *img_cancellable;
|
||||||
GPtrArray *img_transfers;
|
GPtrArray *img_transfers;
|
||||||
int num_flying;
|
int num_flying;
|
||||||
|
|
||||||
GSList *rows;
|
GSList *rows;
|
||||||
size_t num_rows;
|
unsigned num_rows;
|
||||||
unsigned char *rowbuf;
|
unsigned char *rowbuf;
|
||||||
int rowbuf_offset;
|
int rowbuf_offset;
|
||||||
|
|
||||||
int wraparounds;
|
int wraparounds;
|
||||||
int num_blank;
|
int num_blank;
|
||||||
int num_nonblank;
|
int num_nonblank;
|
||||||
enum sonly_fs finger_state;
|
enum sonly_fs finger_state;
|
||||||
int last_seqnum;
|
int last_seqnum;
|
||||||
|
|
||||||
enum sonly_kill_transfers_action killing_transfers;
|
enum sonly_kill_transfers_action killing_transfers;
|
||||||
GError *kill_error;
|
GError *kill_error;
|
||||||
FpiSsm *kill_ssm;
|
FpiSsm *kill_ssm;
|
||||||
|
|
||||||
struct fpi_line_asmbl_ctx assembling_ctx;
|
struct fpi_line_asmbl_ctx assembling_ctx;
|
||||||
};
|
};
|
||||||
G_DECLARE_FINAL_TYPE (FpiDeviceUpeksonly, fpi_device_upeksonly, FPI,
|
G_DECLARE_FINAL_TYPE (FpiDeviceUpeksonly, fpi_device_upeksonly, FPI,
|
||||||
DEVICE_UPEKSONLY, FpImageDevice);
|
DEVICE_UPEKSONLY, FpImageDevice);
|
||||||
@@ -176,6 +176,7 @@ last_transfer_killed (FpImageDevice *dev)
|
|||||||
fpi_image_device_session_error (dev, g_steal_pointer (&self->kill_error));
|
fpi_image_device_session_error (dev, g_steal_pointer (&self->kill_error));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
case NOT_KILLING:
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -214,7 +215,7 @@ handoff_img (FpImageDevice *dev)
|
|||||||
|
|
||||||
self->rows = g_slist_reverse (self->rows);
|
self->rows = g_slist_reverse (self->rows);
|
||||||
|
|
||||||
fp_dbg ("%lu rows", self->num_rows);
|
fp_dbg ("%u rows", self->num_rows);
|
||||||
img = fpi_assemble_lines (&self->assembling_ctx, self->rows, self->num_rows);
|
img = fpi_assemble_lines (&self->assembling_ctx, self->rows, self->num_rows);
|
||||||
|
|
||||||
g_slist_free_full (self->rows, g_free);
|
g_slist_free_full (self->rows, g_free);
|
||||||
@@ -294,7 +295,7 @@ row_complete (FpImageDevice *dev)
|
|||||||
if (self->num_blank > FINGER_REMOVED_THRESHOLD)
|
if (self->num_blank > FINGER_REMOVED_THRESHOLD)
|
||||||
{
|
{
|
||||||
self->finger_state = FINGER_REMOVED;
|
self->finger_state = FINGER_REMOVED;
|
||||||
fp_dbg ("detected finger removal. Blank rows: %d, Full rows: %lu",
|
fp_dbg ("detected finger removal. Blank rows: %d, Full rows: %u",
|
||||||
self->num_blank, self->num_rows);
|
self->num_blank, self->num_rows);
|
||||||
handoff_img (dev);
|
handoff_img (dev);
|
||||||
return;
|
return;
|
||||||
@@ -693,8 +694,6 @@ sm_read_reg_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
|||||||
fp_dbg ("read reg result = %02x", self->read_reg_result);
|
fp_dbg ("read reg result = %02x", self->read_reg_result);
|
||||||
fpi_ssm_next_state (transfer->ssm);
|
fpi_ssm_next_state (transfer->ssm);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (transfer->buffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -731,7 +730,6 @@ sm_await_intr_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
|||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
g_free (transfer->buffer);
|
|
||||||
fpi_ssm_mark_failed (transfer->ssm, error);
|
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -739,7 +737,6 @@ sm_await_intr_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
|||||||
fp_dbg ("interrupt received: %02x %02x %02x %02x",
|
fp_dbg ("interrupt received: %02x %02x %02x %02x",
|
||||||
transfer->buffer[0], transfer->buffer[1],
|
transfer->buffer[0], transfer->buffer[1],
|
||||||
transfer->buffer[2], transfer->buffer[3]);
|
transfer->buffer[2], transfer->buffer[3]);
|
||||||
g_free (transfer->buffer);
|
|
||||||
|
|
||||||
self->finger_state = FINGER_DETECTED;
|
self->finger_state = FINGER_DETECTED;
|
||||||
fpi_image_device_report_finger_status (dev, TRUE);
|
fpi_image_device_report_finger_status (dev, TRUE);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user