mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
Compare commits
118 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c2a67a954 | ||
|
|
a6c2509ca8 | ||
|
|
8254b9e99e | ||
|
|
943c64d96f | ||
|
|
f852d972a5 | ||
|
|
35d2d78e67 | ||
|
|
3d5db6a391 | ||
|
|
2ee0d16784 | ||
|
|
e6712fbcca | ||
|
|
ee928db5b2 | ||
|
|
d6ca8ff2b0 | ||
|
|
b1b20f8ab9 | ||
|
|
7e2b89791e | ||
|
|
3560a0f1e7 | ||
|
|
ed5339c4f5 | ||
|
|
2d10d864d8 | ||
|
|
c96958582f | ||
|
|
c02771d16b | ||
|
|
989d498eb9 | ||
|
|
91ee03eb7a | ||
|
|
28ba6a0de9 | ||
|
|
faade91c39 | ||
|
|
499de3e442 | ||
|
|
0ff7a07671 | ||
|
|
0d9d7dcb46 | ||
|
|
fb23f8690f | ||
|
|
6ca8441df9 | ||
|
|
8112da0358 | ||
|
|
f2ea3e784e | ||
|
|
74810a8472 | ||
|
|
91fb8d8cb4 | ||
|
|
0688288c6d | ||
|
|
c1e832e7a7 | ||
|
|
b5496fd257 | ||
|
|
de271a0e8d | ||
|
|
12b0120a3d | ||
|
|
2783ac3e60 | ||
|
|
abb0b1267c | ||
|
|
5cb91a4189 | ||
|
|
0bb132b167 | ||
|
|
ce39f27b5e | ||
|
|
7d0956513b | ||
|
|
2b7cfa751a | ||
|
|
0eee6a56dd | ||
|
|
8962e14fde | ||
|
|
e246e00ba3 | ||
|
|
fa3bdb874d | ||
|
|
2caeb8cbb3 | ||
|
|
dda3587b76 | ||
|
|
fb5854213a | ||
|
|
21ee241f0c | ||
|
|
280f916ace | ||
|
|
1b5dd0057f | ||
|
|
8a6f1932f8 | ||
|
|
0051ff6352 | ||
|
|
b6dd522459 | ||
|
|
656bf3d175 | ||
|
|
fe498c56c7 | ||
|
|
251ccef9ba | ||
|
|
3b993fabb6 | ||
|
|
0c56e0de6d | ||
|
|
893ff9c033 | ||
|
|
3c382cac7f | ||
|
|
42e4506b1b | ||
|
|
ae3baadcf9 | ||
|
|
4f29a32da8 | ||
|
|
e5fa54e8e7 | ||
|
|
d3076039d0 | ||
|
|
a748f4d30f | ||
|
|
3ee5536a13 | ||
|
|
f56aacc7ef | ||
|
|
96fa0a96eb | ||
|
|
1754bd0204 | ||
|
|
90a1abf2f8 | ||
|
|
59824d2122 | ||
|
|
31319d9c6f | ||
|
|
e27b65c930 | ||
|
|
b03f9a502a | ||
|
|
44ef20d5ac | ||
|
|
4719b30f16 | ||
|
|
7eb361087a | ||
|
|
33d50e4e30 | ||
|
|
994690cfa3 | ||
|
|
52b2d10887 | ||
|
|
81e0f4dfe5 | ||
|
|
c7cab77fc1 | ||
|
|
a63dcc96d5 | ||
|
|
fab349f356 | ||
|
|
62edf93958 | ||
|
|
8c4ff253cb | ||
|
|
3ce6a15547 | ||
|
|
174aa2c091 | ||
|
|
9efe25b91c | ||
|
|
bcce8876e2 | ||
|
|
3962372f47 | ||
|
|
f67f61c638 | ||
|
|
d5f7f4dfaa | ||
|
|
ce6961d165 | ||
|
|
30e1a68344 | ||
|
|
5b087ed848 | ||
|
|
5d0481b031 | ||
|
|
596d22a449 | ||
|
|
c85f385191 | ||
|
|
eb2aaaaa20 | ||
|
|
e3c009c5b3 | ||
|
|
a4f7293f32 | ||
|
|
8b64312f4b | ||
|
|
b7e27bfdc6 | ||
|
|
37b19674f1 | ||
|
|
a5f4ad507a | ||
|
|
1f96077e36 | ||
|
|
ed26976ac5 | ||
|
|
e4d292b595 | ||
|
|
c6b8430c72 | ||
|
|
cbf1dcca29 | ||
|
|
7f7d099ba0 | ||
|
|
b6f965c1d9 | ||
|
|
fd2875aa3e |
10
.git-blame-ignore-revs
Normal file
10
.git-blame-ignore-revs
Normal file
@@ -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
|
||||
@@ -3,6 +3,7 @@ include:
|
||||
- project: 'wayland/ci-templates'
|
||||
ref: master
|
||||
file: '/templates/fedora.yml'
|
||||
- remote: 'https://gitlab.gnome.org/GNOME/citemplates/-/raw/master/flatpak/flatpak_ci_initiative.yml'
|
||||
|
||||
variables:
|
||||
extends: .libfprint_common_variables
|
||||
@@ -108,56 +109,28 @@ test_indent:
|
||||
- git diff
|
||||
- "! git status -s | grep -q ."
|
||||
|
||||
.flatpak_script_template: &flatpak_script
|
||||
script:
|
||||
- flatpak-builder --stop-at=${FLATPAK_MODULE} app ${MANIFEST_PATH}
|
||||
# Make sure to keep this in sync with the Flatpak manifest, all arguments
|
||||
# are passed except the config-args because we build it ourselves
|
||||
- flatpak build app meson --prefix=/app --libdir=lib ${MESON_ARGS} _build
|
||||
- flatpak build app ninja -C _build install
|
||||
- flatpak build app rm -rf /app/include/ /app/lib/pkgconfig/
|
||||
- flatpak-builder --finish-only --repo=repo app ${MANIFEST_PATH}
|
||||
# Generate a Flatpak bundle
|
||||
- flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${DBUS_ID}
|
||||
|
||||
.flatpak_artifacts_template: &flatpak_artifacts
|
||||
artifacts:
|
||||
paths:
|
||||
- ${BUNDLE}
|
||||
when: always
|
||||
expire_in: 30 days
|
||||
|
||||
.flatpak_template: &flatpak
|
||||
<<: *flatpak_script
|
||||
<<: *flatpak_artifacts
|
||||
|
||||
.flatpak_master_template: &flatpak_master
|
||||
image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.32
|
||||
stage: flatpak
|
||||
variables:
|
||||
MANIFEST_PATH: "demo/org.freedesktop.libfprint.Demo.json"
|
||||
# From demo/org.freedesktop.libfprint.Demo.json
|
||||
MESON_ARGS: "-Dudev_rules=false -Dx11-examples=false -Dgtk-examples=true"
|
||||
FLATPAK_MODULE: "libfprint"
|
||||
DBUS_ID: "org.freedesktop.libfprint.Demo"
|
||||
<<: *flatpak
|
||||
|
||||
flatpak-auto master:
|
||||
<<: *flatpak_master
|
||||
when: always
|
||||
only:
|
||||
- tags
|
||||
- master
|
||||
|
||||
flatpak-manual master:
|
||||
<<: *flatpak_master
|
||||
when: manual
|
||||
except:
|
||||
refs:
|
||||
- tags
|
||||
- master
|
||||
variables:
|
||||
- $CI_PIPELINE_SOURCE == "schedule"
|
||||
flatpak:
|
||||
stage: flatpak
|
||||
extends: .flatpak
|
||||
image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.36
|
||||
variables:
|
||||
MANIFEST_PATH: "demo/org.freedesktop.libfprint.Demo.json"
|
||||
FLATPAK_MODULE: "libfprint"
|
||||
APP_ID: "org.freedesktop.libfprint.Demo"
|
||||
rules:
|
||||
- if: '$CI_PROJECT_PATH != "libfprint/libfprint"'
|
||||
when: never
|
||||
- if: '$CI_PIPELINE_SOURCE == "schedule"'
|
||||
when: never
|
||||
- if: '$CI_COMMIT_BRANCH == "master"'
|
||||
when: always
|
||||
- if: '$CI_COMMIT_TAG'
|
||||
when: always
|
||||
# For any other (commit), allow manual run.
|
||||
# This excludes MRs which would create a duplicate pipeline
|
||||
- if: '$CI_COMMIT_BRANCH'
|
||||
when: manual
|
||||
allow_failure: true
|
||||
|
||||
# CONTAINERS creation stage
|
||||
container_fedora_build:
|
||||
|
||||
78
NEWS
78
NEWS
@@ -1,6 +1,84 @@
|
||||
This file lists notable changes in each release. For the full history of all
|
||||
changes, see ChangeLog.
|
||||
|
||||
2020-12-01: v1.90.7 release
|
||||
|
||||
Highlights:
|
||||
* vfs5011: Fix possible use-after-free
|
||||
* goodixmoc: Add two new PIDs (0x63AC, 0x639C)
|
||||
* goodixmoc: Support finger status API
|
||||
* synaptics: Only identify within provided prints
|
||||
* synaptics: Reject devices with old firmware during probe (#239)
|
||||
|
||||
|
||||
2020-12-01: v1.90.6 release
|
||||
|
||||
This release is primarily a bugfix release for some older issues.
|
||||
|
||||
The major change is that fp_print_deserialize will now correctly return a
|
||||
sunken reference rather than a floating one. Most API users will have
|
||||
assumed this was true, and issues could happen at a later point.
|
||||
If any API user worked around this libfprint bug, they will now leak the
|
||||
returned print.
|
||||
|
||||
Highlights:
|
||||
* Object reference management fixes for FpPrint and identify
|
||||
* Fixed issues that caused problem on non-x86 machines (#236)
|
||||
* Fix building with older GLib versions
|
||||
* synaptics: Support PID 00e7
|
||||
* goodix: Fix issue with long USB packages
|
||||
|
||||
|
||||
2020-12-01: v1.90.5 release
|
||||
|
||||
The 1.90.4 release caused a major regression, as it included a USB hub in
|
||||
UDEV the autosupend rule list.
|
||||
|
||||
Highlights:
|
||||
* Remove USB hub from udev autosupend rules
|
||||
* synaptics: Add PID 0x00c9 which is used in some HP laptops
|
||||
|
||||
|
||||
2020-11-27: v1.90.4 release
|
||||
|
||||
This release contains a number of important bugfixes. On the feature side,
|
||||
the USB hotplug support was improved. A lot of drivers received fixes and
|
||||
improvements.
|
||||
|
||||
Highlights:
|
||||
* Work around GUsb cancellation issue
|
||||
* Redefine internal image device state machine for more robustness
|
||||
* Add public finger-status reporting to FpDevice
|
||||
* Rework device removal API to be convenient (#330)
|
||||
* Enable powersave for unsupported USB devices
|
||||
* Improvements to examples
|
||||
* synaptics: Support identify operation
|
||||
* synaptics: Fix possible crash when the interrupt transfer is resubmitted
|
||||
* synaptics: Add support for PIDs 0x00f9, 0x00fc and 0x00c2
|
||||
* elan: Add PID 0x0c4d to supported device list
|
||||
* aes3k: Fix driver and add CI test (#306)
|
||||
* uru4000: Fix reference counting of image transfer
|
||||
* vfs301: Fix driver and add CI test (#320)
|
||||
|
||||
2020-06-08: v1.90.3 release
|
||||
|
||||
This release mostly contains support for a number of new match-on-chip
|
||||
devices. Most notable is the addition of the new goodixmoc driver.
|
||||
Currently the driver has the small caveat that we have no strategy to
|
||||
garbage collect old prints yet (a simple strategy could be implemented
|
||||
in fprintd).
|
||||
|
||||
Highlights:
|
||||
* New goodixmoc driver supporting Goodix USB devices:
|
||||
27C6:5840
|
||||
27C6:6496
|
||||
27C6:60A2
|
||||
* Newly added support for Synaptics device:
|
||||
06CB:00E9
|
||||
06CB:00DF
|
||||
* Fixed an issue with Synaptics devices sometimes not working at boot
|
||||
* Fix issue with aes3k driver (#306)
|
||||
|
||||
2020-06-08: v1.90.2 release
|
||||
|
||||
This release contains a large amount of bug and regression fixes. These
|
||||
|
||||
@@ -241,6 +241,8 @@ dev_capture_start_cb (FpDevice *dev,
|
||||
if (error->domain == FP_DEVICE_RETRY ||
|
||||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
libfprint_demo_set_mode (win, RETRY_MODE);
|
||||
else if (g_error_matches (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_NOT_SUPPORTED))
|
||||
libfprint_demo_set_mode (win, NOIMAGING_MODE);
|
||||
else
|
||||
libfprint_demo_set_mode (win, ERROR_MODE);
|
||||
return;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"app-id": "org.freedesktop.libfprint.Demo",
|
||||
"runtime": "org.gnome.Platform",
|
||||
"runtime-version": "3.32",
|
||||
"runtime-version": "3.36",
|
||||
"sdk": "org.gnome.Sdk",
|
||||
"command": "gtk-libfprint-test",
|
||||
"finish-args": [
|
||||
|
||||
@@ -91,8 +91,6 @@ FP_TYPE_PRINT
|
||||
FpFinger
|
||||
FpPrint
|
||||
fp_print_new
|
||||
fp_print_new_from_data
|
||||
fp_print_to_data
|
||||
fp_print_get_driver
|
||||
fp_print_get_device_id
|
||||
fp_print_get_device_stored
|
||||
|
||||
@@ -57,7 +57,7 @@ on_device_closed (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
fp_device_close_finish (dev, res, &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);
|
||||
}
|
||||
@@ -76,20 +76,24 @@ on_enroll_completed (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
{
|
||||
enroll_data->ret_value = EXIT_SUCCESS;
|
||||
|
||||
if (!fp_device_has_storage (dev))
|
||||
if (fp_device_has_storage (dev))
|
||||
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);
|
||||
if (r < 0)
|
||||
{
|
||||
g_debug ("Device has not storage, saving locally");
|
||||
int r = print_data_save (print, enroll_data->finger);
|
||||
if (r < 0)
|
||||
{
|
||||
g_warning ("Data save failed, code %d", r);
|
||||
enroll_data->ret_value = EXIT_FAILURE;
|
||||
}
|
||||
g_warning ("Data save failed, code %d", r);
|
||||
enroll_data->ret_value = EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
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,
|
||||
@@ -112,7 +116,7 @@ on_enroll_progress (FpDevice *device,
|
||||
return;
|
||||
}
|
||||
|
||||
if (fp_device_supports_capture (device) &&
|
||||
if (print && fp_print_get_image (print) &&
|
||||
print_image_save (print, "enrolled.pgm"))
|
||||
printf ("Wrote scanned image to enrolled.pgm\n");
|
||||
|
||||
|
||||
319
examples/identify.c
Normal file
319
examples/identify.c
Normal file
@@ -0,0 +1,319 @@
|
||||
/*
|
||||
* 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);
|
||||
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);
|
||||
}
|
||||
|
||||
if (fp_print_get_enroll_date (matched_print))
|
||||
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_storage (dev))
|
||||
{
|
||||
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_supports_identify (dev))
|
||||
{
|
||||
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;
|
||||
}
|
||||
192
examples/img-capture.c
Normal file
192
examples/img-capture.c
Normal file
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
* Example fingerprint verification program, which verifies the
|
||||
* finger which has been previously enrolled to disk.
|
||||
* Copyright (C) 2007 Daniel Drake <dsd@gentoo.org>
|
||||
* Copyright (C) 2019 Marco Trevisan <marco.trevisan@canonical.com>
|
||||
* Copyright (C) 2020 Vasily Khoruzhick <anarsoul@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define FP_COMPONENT "example-capture"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <libfprint/fprint.h>
|
||||
#include <glib-unix.h>
|
||||
|
||||
#include "storage.h"
|
||||
#include "utilities.h"
|
||||
|
||||
typedef struct CaptureData
|
||||
{
|
||||
GMainLoop *loop;
|
||||
GCancellable *cancellable;
|
||||
unsigned int sigint_handler;
|
||||
int ret_value;
|
||||
const char *filename;
|
||||
} CaptureData;
|
||||
|
||||
static void
|
||||
capture_data_free (CaptureData *capture_data)
|
||||
{
|
||||
g_clear_handle_id (&capture_data->sigint_handler, g_source_remove);
|
||||
g_clear_object (&capture_data->cancellable);
|
||||
g_main_loop_unref (capture_data->loop);
|
||||
g_free (capture_data);
|
||||
}
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CaptureData, capture_data_free)
|
||||
|
||||
static void
|
||||
on_device_closed (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
{
|
||||
CaptureData *capture_data = user_data;
|
||||
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
fp_device_close_finish (dev, res, &error);
|
||||
|
||||
if (error)
|
||||
g_warning ("Failed closing device %s", error->message);
|
||||
|
||||
g_main_loop_quit (capture_data->loop);
|
||||
}
|
||||
|
||||
static void
|
||||
capture_quit (FpDevice *dev,
|
||||
CaptureData *capture_data)
|
||||
{
|
||||
if (!fp_device_is_open (dev))
|
||||
{
|
||||
g_main_loop_quit (capture_data->loop);
|
||||
return;
|
||||
}
|
||||
|
||||
fp_device_close (dev, NULL, (GAsyncReadyCallback) on_device_closed, capture_data);
|
||||
}
|
||||
|
||||
static void
|
||||
dev_capture_cb (FpDevice *dev,
|
||||
GAsyncResult *res,
|
||||
void *user_data)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
CaptureData *capture_data = user_data;
|
||||
FpImage *image = NULL;
|
||||
|
||||
g_clear_object (&capture_data->cancellable);
|
||||
|
||||
image = fp_device_capture_finish (dev, res, &error);
|
||||
if (!image)
|
||||
{
|
||||
g_warning ("Error capturing data: %s", error->message);
|
||||
capture_quit (dev, capture_data);
|
||||
return;
|
||||
}
|
||||
|
||||
save_image_to_pgm (image, capture_data->filename);
|
||||
|
||||
capture_quit (dev, capture_data);
|
||||
}
|
||||
|
||||
static void
|
||||
start_capture (FpDevice *dev, CaptureData *capture_data)
|
||||
{
|
||||
fp_device_capture (dev, TRUE, capture_data->cancellable, (GAsyncReadyCallback) dev_capture_cb, capture_data);
|
||||
}
|
||||
|
||||
static void
|
||||
on_device_opened (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
{
|
||||
CaptureData *capture_data = user_data;
|
||||
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
if (!fp_device_open_finish (dev, res, &error))
|
||||
{
|
||||
g_warning ("Failed to open device: %s", error->message);
|
||||
capture_quit (dev, capture_data);
|
||||
return;
|
||||
}
|
||||
|
||||
g_print ("Opened device. ");
|
||||
|
||||
start_capture (dev, capture_data);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
sigint_cb (void *user_data)
|
||||
{
|
||||
CaptureData *capture_data = user_data;
|
||||
|
||||
g_cancellable_cancel (capture_data->cancellable);
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, const char *argv[])
|
||||
{
|
||||
g_autoptr(FpContext) ctx = NULL;
|
||||
g_autoptr(CaptureData) capture_data = NULL;
|
||||
GPtrArray *devices;
|
||||
FpDevice *dev;
|
||||
|
||||
setenv ("G_MESSAGES_DEBUG", "all", 0);
|
||||
setenv ("LIBUSB_DEBUG", "3", 0);
|
||||
|
||||
ctx = fp_context_new ();
|
||||
|
||||
devices = fp_context_get_devices (ctx);
|
||||
if (!devices)
|
||||
{
|
||||
g_warning ("Impossible to get devices");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
dev = discover_device (devices);
|
||||
if (!dev)
|
||||
{
|
||||
g_warning ("No devices detected.");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (!fp_device_supports_capture (dev))
|
||||
{
|
||||
g_warning ("Device %s doesn't support capture",
|
||||
fp_device_get_name (dev));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
capture_data = g_new0 (CaptureData, 1);
|
||||
capture_data->ret_value = EXIT_FAILURE;
|
||||
capture_data->loop = g_main_loop_new (NULL, FALSE);
|
||||
capture_data->cancellable = g_cancellable_new ();
|
||||
capture_data->sigint_handler = g_unix_signal_add_full (G_PRIORITY_HIGH,
|
||||
SIGINT,
|
||||
sigint_cb,
|
||||
capture_data,
|
||||
NULL);
|
||||
if (argc == 2)
|
||||
capture_data->filename = argv[1];
|
||||
else
|
||||
capture_data->filename = "finger.pgm";
|
||||
fp_device_open (dev, capture_data->cancellable,
|
||||
(GAsyncReadyCallback) on_device_opened,
|
||||
capture_data);
|
||||
|
||||
g_main_loop_run (capture_data->loop);
|
||||
|
||||
return capture_data->ret_value;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ on_device_closed (FpDevice *dev,
|
||||
fp_device_close_finish (dev, res, &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);
|
||||
}
|
||||
@@ -86,7 +86,7 @@ delete_next_print (FpDevice *dev,
|
||||
g_assert_nonnull (list_data->to_delete);
|
||||
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,
|
||||
(GAsyncReadyCallback) on_print_deleted, list_data);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
|
||||
examples = [ 'enroll', 'verify', 'manage-prints' ]
|
||||
examples = [
|
||||
'enroll',
|
||||
'identify',
|
||||
'img-capture',
|
||||
'manage-prints',
|
||||
'verify',
|
||||
]
|
||||
|
||||
foreach example: examples
|
||||
executable(example,
|
||||
[ example + '.c', 'storage.c', 'utilities.c' ],
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Trivial storage driver for example programs
|
||||
*
|
||||
* 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
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -160,6 +160,52 @@ print_data_load (FpDevice *dev, FpFinger finger)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GPtrArray *
|
||||
gallery_data_load (FpDevice *dev)
|
||||
{
|
||||
g_autoptr(GVariantDict) dict = NULL;
|
||||
g_autoptr(GVariant) dict_variant = NULL;
|
||||
g_autofree char *dev_prefix = NULL;
|
||||
GPtrArray *gallery;
|
||||
const char *driver;
|
||||
const char *dev_id;
|
||||
GVariantIter iter;
|
||||
GVariant *value;
|
||||
gchar *key;
|
||||
|
||||
gallery = g_ptr_array_new_with_free_func (g_object_unref);
|
||||
dict = load_data ();
|
||||
dict_variant = g_variant_dict_end (dict);
|
||||
driver = fp_device_get_driver (dev);
|
||||
dev_id = fp_device_get_device_id (dev);
|
||||
dev_prefix = g_strdup_printf ("%s/%s/", driver, dev_id);
|
||||
|
||||
g_variant_iter_init (&iter, dict_variant);
|
||||
while (g_variant_iter_loop (&iter, "{sv}", &key, &value))
|
||||
{
|
||||
FpPrint *print;
|
||||
const guchar *stored_data;
|
||||
g_autoptr(GError) error = NULL;
|
||||
gsize stored_len;
|
||||
|
||||
if (!g_str_has_prefix (key, dev_prefix))
|
||||
continue;
|
||||
|
||||
stored_data = (const guchar *) g_variant_get_fixed_array (value, &stored_len, 1);
|
||||
print = fp_print_deserialize (stored_data, stored_len, &error);
|
||||
|
||||
if (error)
|
||||
{
|
||||
g_warning ("Error deserializing data: %s", error->message);
|
||||
continue;
|
||||
}
|
||||
|
||||
g_ptr_array_add (gallery, print);
|
||||
}
|
||||
|
||||
return gallery;
|
||||
}
|
||||
|
||||
FpPrint *
|
||||
print_create_template (FpDevice *dev, FpFinger finger)
|
||||
{
|
||||
@@ -180,7 +226,7 @@ print_create_template (FpDevice *dev, FpFinger finger)
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
gboolean
|
||||
save_image_to_pgm (FpImage *img, const char *path)
|
||||
{
|
||||
FILE *fd = fopen (path, "w");
|
||||
|
||||
@@ -24,7 +24,10 @@ int print_data_save (FpPrint *print,
|
||||
FpFinger finger);
|
||||
FpPrint * print_data_load (FpDevice *dev,
|
||||
FpFinger finger);
|
||||
GPtrArray * gallery_data_load (FpDevice *dev);
|
||||
FpPrint * print_create_template (FpDevice *dev,
|
||||
FpFinger finger);
|
||||
gboolean print_image_save (FpPrint *print,
|
||||
const char *path);
|
||||
gboolean save_image_to_pgm (FpImage *img,
|
||||
const char *path);
|
||||
|
||||
@@ -57,7 +57,7 @@ on_device_closed (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
fp_device_close_finish (dev, res, &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);
|
||||
}
|
||||
@@ -124,7 +124,7 @@ on_match_cb (FpDevice *dev, FpPrint *match, FpPrint *print,
|
||||
return;
|
||||
}
|
||||
|
||||
if (print && fp_device_supports_capture (dev) &&
|
||||
if (print && fp_print_get_image (print) &&
|
||||
print_image_save (print, "verify.pgm"))
|
||||
g_print ("Print image saved as verify.pgm\n");
|
||||
|
||||
@@ -152,6 +152,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
|
||||
on_list_completed (FpDevice *dev, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
@@ -165,15 +185,27 @@ on_list_completed (FpDevice *dev, GAsyncResult *res, gpointer user_data)
|
||||
if (!error)
|
||||
{
|
||||
FpPrint *verify_print = NULL;
|
||||
g_autoptr(FpPrint) stored_print = NULL;
|
||||
guint i;
|
||||
|
||||
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)
|
||||
{
|
||||
FpPrint *print = prints->pdata[i];
|
||||
|
||||
if (stored_print && fp_print_equal (stored_print, print))
|
||||
/* If the private print data matches, let's use the stored print
|
||||
* as it contains more metadata to show */
|
||||
print = stored_print;
|
||||
|
||||
if (fp_print_get_finger (print) == verify_data->finger &&
|
||||
g_strcmp0 (fp_print_get_username (print), g_get_user_name ()) == 0)
|
||||
{
|
||||
@@ -191,8 +223,6 @@ on_list_completed (FpDevice *dev, GAsyncResult *res, gpointer user_data)
|
||||
|
||||
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);
|
||||
return;
|
||||
}
|
||||
@@ -239,24 +269,17 @@ start_verification (FpDevice *dev, VerifyData *verify_data)
|
||||
}
|
||||
else
|
||||
{
|
||||
g_print ("Loading previously enrolled %s finger data...\n",
|
||||
finger_to_string (verify_data->finger));
|
||||
g_autoptr(FpPrint) verify_print = NULL;
|
||||
|
||||
verify_print = print_data_load (dev, verify_data->finger);
|
||||
g_autoptr(FpPrint) verify_print = get_stored_print (dev, verify_data);
|
||||
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
g_print ("Print loaded. Time to verify!\n");
|
||||
fp_device_verify (dev, verify_print, verify_data->cancellable,
|
||||
NULL, NULL, NULL,
|
||||
on_match_cb, verify_data, NULL,
|
||||
(GAsyncReadyCallback) on_verify_completed,
|
||||
verify_data);
|
||||
}
|
||||
|
||||
@@ -135,10 +135,8 @@ generic_read_ignore_data (FpiSsm *ssm, FpDevice *dev,
|
||||
size_t bytes)
|
||||
{
|
||||
FpiUsbTransfer *transfer = fpi_usb_transfer_new (dev);
|
||||
unsigned char *data;
|
||||
|
||||
data = g_malloc (bytes);
|
||||
fpi_usb_transfer_fill_bulk_full (transfer, EP_IN, data, bytes, g_free);
|
||||
fpi_usb_transfer_fill_bulk (transfer, EP_IN, bytes);
|
||||
transfer->ssm = ssm;
|
||||
transfer->short_is_error = TRUE;
|
||||
fpi_usb_transfer_submit (transfer, BULK_TIMEOUT, NULL,
|
||||
|
||||
@@ -197,12 +197,12 @@ process_strip_data (FpiSsm *ssm, FpImageDevice *dev,
|
||||
|
||||
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;
|
||||
}
|
||||
len = data[1] * 256 + data[2];
|
||||
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->delta_x = (int8_t) data[6];
|
||||
stripe->delta_y = -(int8_t) data[7];
|
||||
|
||||
@@ -106,7 +106,9 @@ static struct aes_regwrite init_reqs[] = {
|
||||
{ 0x9e, 0x53 }, /* clear challenge word bits */
|
||||
{ 0x9f, 0x6b }, /* set some challenge word bits */
|
||||
{ 0, 0 },
|
||||
};
|
||||
|
||||
static struct aes_regwrite capture_reqs[] = {
|
||||
{ 0x80, 0x00 },
|
||||
{ 0x81, 0x00 },
|
||||
{ 0, 0 },
|
||||
@@ -155,4 +157,6 @@ fpi_device_aes3500_class_init (FpiDeviceAes3500Class *klass)
|
||||
aes_class->enlarge_factor = ENLARGE_FACTOR;
|
||||
aes_class->init_reqs = 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);
|
||||
}
|
||||
|
||||
@@ -42,8 +42,10 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FpiUsbTransfer *img_trf;
|
||||
gboolean deactivating;
|
||||
/* This is used both as a flag that we are in a capture operation
|
||||
* and for cancellation.
|
||||
*/
|
||||
GCancellable *img_capture_cancel;
|
||||
} FpiDeviceAes3kPrivate;
|
||||
|
||||
#define CTRL_TIMEOUT 1000
|
||||
@@ -84,7 +86,8 @@ img_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
FpImage *img;
|
||||
int i;
|
||||
|
||||
priv->img_trf = NULL;
|
||||
/* Image capture operation is finished (error/completed) */
|
||||
g_clear_object (&priv->img_capture_cancel);
|
||||
|
||||
if (error)
|
||||
{
|
||||
@@ -92,14 +95,14 @@ img_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_CANCELLED))
|
||||
{
|
||||
/* Deactivation was completed. */
|
||||
/* Cancellation implies we are deactivating. */
|
||||
g_error_free (error);
|
||||
if (priv->deactivating)
|
||||
fpi_image_device_deactivate_complete (dev, NULL);
|
||||
fpi_image_device_deactivate_complete (dev, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
fpi_image_device_session_error (dev, error);
|
||||
return;
|
||||
}
|
||||
|
||||
fpi_image_device_report_finger_status (dev, TRUE);
|
||||
@@ -123,43 +126,69 @@ img_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
fpi_image_device_image_captured (dev, img);
|
||||
|
||||
/* 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);
|
||||
|
||||
do_capture (dev);
|
||||
/* Note: The transfer is re-started when we switch to the AWAIT_FINGER_ON state. */
|
||||
}
|
||||
|
||||
static void
|
||||
do_capture (FpImageDevice *dev)
|
||||
{
|
||||
g_autoptr(FpiUsbTransfer) img_trf = NULL;
|
||||
FpiDeviceAes3k *self = FPI_DEVICE_AES3K (dev);
|
||||
FpiDeviceAes3kPrivate *priv = fpi_device_aes3k_get_instance_private (self);
|
||||
FpiDeviceAes3kClass *cls = FPI_DEVICE_AES3K_GET_CLASS (self);
|
||||
|
||||
priv->img_trf = fpi_usb_transfer_new (FP_DEVICE (dev));
|
||||
fpi_usb_transfer_fill_bulk (priv->img_trf, EP_IN, cls->data_buflen);
|
||||
priv->img_trf->short_is_error = TRUE;
|
||||
fpi_usb_transfer_submit (priv->img_trf, 0,
|
||||
fpi_device_get_cancellable (FP_DEVICE (dev)),
|
||||
img_trf = fpi_usb_transfer_new (FP_DEVICE (dev));
|
||||
fpi_usb_transfer_fill_bulk (img_trf, EP_IN, cls->data_buflen);
|
||||
img_trf->short_is_error = TRUE;
|
||||
fpi_usb_transfer_submit (g_steal_pointer (&img_trf), 0,
|
||||
priv->img_capture_cancel,
|
||||
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
|
||||
init_reqs_cb (FpImageDevice *dev, GError *result, void *user_data)
|
||||
{
|
||||
fpi_image_device_activate_complete (dev, result);
|
||||
if (!result)
|
||||
do_capture (dev);
|
||||
}
|
||||
|
||||
static void
|
||||
aes3k_dev_activate (FpImageDevice *dev)
|
||||
{
|
||||
FpiDeviceAes3k *self = FPI_DEVICE_AES3K (dev);
|
||||
FpiDeviceAes3kPrivate *priv = fpi_device_aes3k_get_instance_private (self);
|
||||
FpiDeviceAes3kClass *cls = FPI_DEVICE_AES3K_GET_CLASS (self);
|
||||
|
||||
priv->deactivating = FALSE;
|
||||
aes_write_regv (dev, cls->init_reqs, cls->init_reqs_len, init_reqs_cb, NULL);
|
||||
}
|
||||
|
||||
@@ -169,10 +198,26 @@ aes3k_dev_deactivate (FpImageDevice *dev)
|
||||
FpiDeviceAes3k *self = FPI_DEVICE_AES3K (dev);
|
||||
FpiDeviceAes3kPrivate *priv = fpi_device_aes3k_get_instance_private (self);
|
||||
|
||||
priv->deactivating = TRUE;
|
||||
if (priv->img_trf)
|
||||
return;
|
||||
fpi_image_device_deactivate_complete (dev, NULL);
|
||||
/* If a capture is running, then deactivation finishes from the cancellation handler */
|
||||
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
|
||||
@@ -217,6 +262,7 @@ fpi_device_aes3k_class_init (FpiDeviceAes3kClass *klass)
|
||||
img_class->img_open = aes3k_dev_init;
|
||||
img_class->img_close = aes3k_dev_deinit;
|
||||
img_class->activate = aes3k_dev_activate;
|
||||
img_class->change_state = aes3k_dev_change_state;
|
||||
img_class->deactivate = aes3k_dev_deactivate;
|
||||
|
||||
/* Extremely low due to low image quality. */
|
||||
|
||||
@@ -57,4 +57,6 @@ struct _FpiDeviceAes3kClass
|
||||
gsize data_buflen; /* buffer length of usb bulk transfer */
|
||||
struct aes_regwrite *init_reqs; /* initial values sent to device */
|
||||
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 */
|
||||
{ 0x9f, 0x6b }, /* set some challenge word bits */
|
||||
{ 0, 0 },
|
||||
};
|
||||
|
||||
static struct aes_regwrite capture_reqs[] = {
|
||||
{ 0x80, 0x00 },
|
||||
{ 0x81, 0x00 },
|
||||
{ 0, 0 },
|
||||
@@ -152,4 +154,6 @@ fpi_device_aes4000_class_init (FpiDeviceAes4000Class *klass)
|
||||
aes_class->enlarge_factor = ENLARGE_FACTOR;
|
||||
aes_class->init_reqs = 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);
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ static void complete_deactivation (FpImageDevice *dev);
|
||||
#define CALIBRATE_DATA_LEN 4
|
||||
#define FINGER_DET_DATA_LEN 4
|
||||
|
||||
FP_GNUC_ACCESS (read_only, 3, 4)
|
||||
static void
|
||||
aesX660_send_cmd_timeout (FpiSsm *ssm,
|
||||
FpDevice *_dev,
|
||||
@@ -70,6 +71,7 @@ aesX660_send_cmd_timeout (FpiSsm *ssm,
|
||||
fpi_usb_transfer_submit (transfer, timeout, NULL, callback, NULL);
|
||||
}
|
||||
|
||||
FP_GNUC_ACCESS (read_only, 3, 4)
|
||||
static void
|
||||
aesX660_send_cmd (FpiSsm *ssm,
|
||||
FpDevice *dev,
|
||||
@@ -89,13 +91,12 @@ aesX660_read_response (FpiSsm *ssm,
|
||||
FpiUsbTransferCallback callback)
|
||||
{
|
||||
FpiUsbTransfer *transfer = fpi_usb_transfer_new (_dev);
|
||||
unsigned char *data;
|
||||
GCancellable *cancel = NULL;
|
||||
|
||||
if (cancellable)
|
||||
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->short_is_error = short_is_error;
|
||||
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? */
|
||||
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_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||
"Bogus calibrate "
|
||||
@@ -155,14 +156,14 @@ finger_det_read_fd_data_cb (FpiUsbTransfer *transfer,
|
||||
|
||||
if (error)
|
||||
{
|
||||
fp_dbg ("Failed to read FD data\n");
|
||||
fp_dbg ("Failed to read FD data");
|
||||
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||
return;
|
||||
}
|
||||
|
||||
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_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||
"Bogus FD response %.2x",
|
||||
@@ -177,7 +178,7 @@ finger_det_read_fd_data_cb (FpiUsbTransfer *transfer,
|
||||
}
|
||||
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]);
|
||||
fpi_ssm_jump_to_state (transfer->ssm, FINGER_DET_SEND_FD_CMD);
|
||||
}
|
||||
@@ -405,7 +406,7 @@ capture_read_stripe_data_cb (FpiUsbTransfer *transfer,
|
||||
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)
|
||||
fpi_ssm_next_state (transfer->ssm);
|
||||
@@ -440,7 +441,7 @@ capture_run_state (FpiSsm *ssm, FpDevice *_dev)
|
||||
break;
|
||||
|
||||
case CAPTURE_SET_IDLE:
|
||||
fp_dbg ("Got %lu frames\n", priv->strips_len);
|
||||
fp_dbg ("Got %lu frames", priv->strips_len);
|
||||
aesX660_send_cmd (ssm, _dev, set_idle_cmd, sizeof (set_idle_cmd),
|
||||
capture_set_idle_cmd_cb);
|
||||
break;
|
||||
@@ -513,19 +514,19 @@ activate_read_id_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
|
||||
if (error)
|
||||
{
|
||||
fp_dbg ("read_id cmd failed\n");
|
||||
fp_dbg ("read_id cmd failed");
|
||||
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||
return;
|
||||
}
|
||||
/* ID was read correctly */
|
||||
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]);
|
||||
}
|
||||
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_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||
"Bogus read ID response %.2x",
|
||||
@@ -553,7 +554,7 @@ activate_read_id_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
break;
|
||||
|
||||
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_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||
"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);
|
||||
unsigned char *data = transfer->buffer;
|
||||
|
||||
fp_dbg ("read_init_cb\n");
|
||||
fp_dbg ("read_init_cb");
|
||||
|
||||
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);
|
||||
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||
return;
|
||||
@@ -582,7 +583,7 @@ activate_read_init_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
/* ID was read correctly */
|
||||
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]);
|
||||
fpi_ssm_mark_failed (transfer->ssm,
|
||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||
@@ -614,13 +615,13 @@ activate_run_state (FpiSsm *ssm, FpDevice *_dev)
|
||||
{
|
||||
case ACTIVATE_SET_IDLE:
|
||||
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),
|
||||
fpi_ssm_usb_transfer_cb);
|
||||
break;
|
||||
|
||||
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),
|
||||
fpi_ssm_usb_transfer_cb);
|
||||
break;
|
||||
@@ -630,7 +631,7 @@ activate_run_state (FpiSsm *ssm, FpDevice *_dev)
|
||||
break;
|
||||
|
||||
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_cmd_idx);
|
||||
aesX660_send_cmd (ssm, _dev,
|
||||
@@ -640,7 +641,7 @@ activate_run_state (FpiSsm *ssm, FpDevice *_dev)
|
||||
break;
|
||||
|
||||
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);
|
||||
break;
|
||||
|
||||
|
||||
@@ -73,22 +73,19 @@ struct _FpiDeviceElan
|
||||
/* end commands */
|
||||
|
||||
/* state */
|
||||
gboolean deactivating;
|
||||
FpiImageDeviceState dev_state;
|
||||
FpiImageDeviceState dev_state_next;
|
||||
unsigned char *last_read;
|
||||
unsigned char calib_atts_left;
|
||||
unsigned char calib_status;
|
||||
unsigned short *background;
|
||||
unsigned char frame_width;
|
||||
unsigned char frame_height;
|
||||
unsigned char raw_frame_height;
|
||||
int num_frames;
|
||||
GSList *frames;
|
||||
gboolean active;
|
||||
gboolean deactivating;
|
||||
unsigned char *last_read;
|
||||
unsigned char calib_atts_left;
|
||||
unsigned char calib_status;
|
||||
unsigned short *background;
|
||||
unsigned char frame_width;
|
||||
unsigned char frame_height;
|
||||
unsigned char raw_frame_height;
|
||||
int num_frames;
|
||||
GSList *frames;
|
||||
/* 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);
|
||||
|
||||
static int
|
||||
@@ -487,7 +484,7 @@ stop_capture_complete (FpiSsm *ssm, FpDevice *_dev, GError *error)
|
||||
|
||||
|
||||
/* The device is inactive at this point. */
|
||||
self->dev_state = FPI_IMAGE_DEVICE_STATE_INACTIVE;
|
||||
self->active = FALSE;
|
||||
|
||||
if (self->deactivating)
|
||||
{
|
||||
@@ -505,16 +502,14 @@ stop_capture_complete (FpiSsm *ssm, FpDevice *_dev, GError *error)
|
||||
}
|
||||
|
||||
static void
|
||||
elan_stop_capture (FpDevice *dev)
|
||||
elan_stop_capture (FpiDeviceElan *self)
|
||||
{
|
||||
FpiDeviceElan *self = FPI_DEVICE_ELAN (dev);
|
||||
|
||||
G_DEBUG_HERE ();
|
||||
|
||||
elan_dev_reset_state (self);
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -545,8 +540,6 @@ capture_run_state (FpiSsm *ssm, FpDevice *dev)
|
||||
break;
|
||||
|
||||
case CAPTURE_READ_DATA:
|
||||
self->dev_state = FPI_IMAGE_DEVICE_STATE_CAPTURE;
|
||||
|
||||
/* 0x55 - finger present
|
||||
* 0xff - device not calibrated (probably) */
|
||||
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);
|
||||
}
|
||||
|
||||
/* 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
|
||||
elan_capture (FpDevice *dev)
|
||||
elan_capture (FpiDeviceElan *self)
|
||||
{
|
||||
FpiDeviceElan *self = FPI_DEVICE_ELAN (dev);
|
||||
|
||||
G_DEBUG_HERE ();
|
||||
|
||||
elan_dev_reset_state (self);
|
||||
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);
|
||||
}
|
||||
@@ -777,33 +773,31 @@ calibrate_run_state (FpiSsm *ssm, FpDevice *dev)
|
||||
static void
|
||||
calibrate_complete (FpiSsm *ssm, FpDevice *dev, GError *error)
|
||||
{
|
||||
FpiDeviceElan *self = FPI_DEVICE_ELAN (dev);
|
||||
|
||||
G_DEBUG_HERE ();
|
||||
|
||||
if (error)
|
||||
{
|
||||
self->dev_state = FPI_IMAGE_DEVICE_STATE_INACTIVE;
|
||||
fpi_image_device_session_error (FP_IMAGE_DEVICE (dev), error);
|
||||
elan_stop_capture (FPI_DEVICE_ELAN (dev));
|
||||
}
|
||||
else
|
||||
{
|
||||
elan_capture (dev);
|
||||
elan_capture (FPI_DEVICE_ELAN (dev));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
elan_calibrate (FpDevice *dev)
|
||||
elan_calibrate (FpiDeviceElan *self)
|
||||
{
|
||||
FpiDeviceElan *self = FPI_DEVICE_ELAN (dev);
|
||||
|
||||
G_DEBUG_HERE ();
|
||||
|
||||
elan_dev_reset_state (self);
|
||||
|
||||
g_return_if_fail (!self->active);
|
||||
self->active = TRUE;
|
||||
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);
|
||||
|
||||
fpi_ssm_start (ssm, calibrate_complete);
|
||||
@@ -958,98 +952,19 @@ dev_activate (FpImageDevice *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
|
||||
dev_change_state (FpImageDevice *dev, FpiImageDeviceState state)
|
||||
{
|
||||
FpiDeviceElan *self = FPI_DEVICE_ELAN (dev);
|
||||
GSource *timeout;
|
||||
|
||||
G_DEBUG_HERE ();
|
||||
|
||||
/* Inactive and await finger off are equivalent for the elan driver. */
|
||||
if (state == FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF)
|
||||
state = FPI_IMAGE_DEVICE_STATE_INACTIVE;
|
||||
|
||||
if (self->dev_state_next == state)
|
||||
{
|
||||
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 ();
|
||||
}
|
||||
/* Note: We always calibrate even if that may not be needed always.
|
||||
* Doing this for each capture appears to make it at least less likely for
|
||||
* devices to end up in a bad state.
|
||||
*/
|
||||
if (state == FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON)
|
||||
elan_calibrate (self);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1059,19 +974,14 @@ dev_deactivate (FpImageDevice *dev)
|
||||
|
||||
G_DEBUG_HERE ();
|
||||
|
||||
if (self->dev_state == FPI_IMAGE_DEVICE_STATE_INACTIVE)
|
||||
{
|
||||
/* The device is inactive already, complete the operation immediately. */
|
||||
fpi_image_device_deactivate_complete (dev, NULL);
|
||||
}
|
||||
if (!self->active)
|
||||
/* The device is inactive already, complete the operation immediately. */
|
||||
fpi_image_device_deactivate_complete (dev, NULL);
|
||||
else
|
||||
{
|
||||
/* The device is not yet inactive, flag that we are deactivating (and
|
||||
* need to signal back deactivation) and then ensure we will change
|
||||
* to the inactive state eventually. */
|
||||
self->deactivating = TRUE;
|
||||
dev_change_state (dev, FPI_IMAGE_DEVICE_STATE_INACTIVE);
|
||||
}
|
||||
/* The device is not yet inactive, flag that we are deactivating (and
|
||||
* need to signal back deactivation).
|
||||
* Note that any running capture will be cancelled already if needed. */
|
||||
self->deactivating = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -70,6 +70,9 @@
|
||||
#define ELAN_CMD_TIMEOUT 10000
|
||||
#define ELAN_FINGER_TIMEOUT 200
|
||||
|
||||
G_DECLARE_FINAL_TYPE (FpiDeviceElan, fpi_device_elan, FPI, DEVICE_ELAN,
|
||||
FpImageDevice);
|
||||
|
||||
struct elan_cmd
|
||||
{
|
||||
unsigned char cmd[ELAN_CMD_LEN];
|
||||
@@ -211,6 +214,7 @@ static const FpIdEntry elan_id_table[] = {
|
||||
{.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 = 0x0c42, .driver_data = ELAN_0C42},
|
||||
{.vid = ELAN_VEND_ID, .pid = 0x0c4d, .driver_data = ELAN_ALL_DEV},
|
||||
{.vid = 0, .pid = 0, .driver_data = 0},
|
||||
};
|
||||
|
||||
@@ -218,8 +222,8 @@ static void elan_cmd_done (FpiSsm *ssm);
|
||||
static void elan_cmd_read (FpiSsm *ssm,
|
||||
FpDevice *dev);
|
||||
|
||||
static void elan_calibrate (FpDevice *dev);
|
||||
static void elan_capture (FpDevice *dev);
|
||||
static void elan_calibrate (FpiDeviceElan *self);
|
||||
static void elan_capture (FpiDeviceElan *self);
|
||||
|
||||
static void dev_change_state (FpImageDevice *dev,
|
||||
FpiImageDeviceState state);
|
||||
|
||||
1478
libfprint/drivers/goodixmoc/goodix.c
Normal file
1478
libfprint/drivers/goodixmoc/goodix.c
Normal file
File diff suppressed because it is too large
Load Diff
58
libfprint/drivers/goodixmoc/goodix.h
Normal file
58
libfprint/drivers/goodixmoc/goodix.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Goodix Moc driver for libfprint
|
||||
* Copyright (C) 2019 Shenzhen Goodix Technology Co., Ltd.
|
||||
*
|
||||
* 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 (FpiDeviceGoodixMoc, fpi_device_goodixmoc, FPI, DEVICE_GOODIXMOC, FpDevice)
|
||||
|
||||
typedef enum {
|
||||
FP_CMD_SEND = 0,
|
||||
FP_CMD_GET_ACK,
|
||||
FP_CMD_GET_DATA,
|
||||
FP_CMD_NUM_STATES,
|
||||
} FpCmdState;
|
||||
|
||||
|
||||
typedef enum {
|
||||
FP_INIT_VERSION = 0,
|
||||
FP_INIT_CONFIG,
|
||||
FP_INIT_NUM_STATES,
|
||||
} FpInitState;
|
||||
|
||||
|
||||
typedef enum {
|
||||
FP_ENROLL_ENUM = 0,
|
||||
FP_ENROLL_IDENTIFY,
|
||||
FP_ENROLL_CREATE,
|
||||
FP_ENROLL_CAPTURE,
|
||||
FP_ENROLL_UPDATE,
|
||||
FP_ENROLL_WAIT_FINGER_UP,
|
||||
FP_ENROLL_CHECK_DUPLICATE,
|
||||
FP_ENROLL_COMMIT,
|
||||
FP_ENROLL_NUM_STATES,
|
||||
} FpEnrollState;
|
||||
|
||||
typedef enum {
|
||||
FP_VERIFY_CAPTURE = 0,
|
||||
FP_VERIFY_IDENTIFY,
|
||||
FP_VERIFY_NUM_STATES,
|
||||
} FpVerifyState;
|
||||
428
libfprint/drivers/goodixmoc/goodix_proto.c
Normal file
428
libfprint/drivers/goodixmoc/goodix_proto.c
Normal file
@@ -0,0 +1,428 @@
|
||||
/*
|
||||
* Goodix Moc driver for libfprint
|
||||
* Copyright (C) 2019 Shenzhen Goodix Technology Co., Ltd.
|
||||
*
|
||||
* 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 <glib.h>
|
||||
#include "goodix_proto.h"
|
||||
|
||||
/*
|
||||
* Crc functions
|
||||
*/
|
||||
|
||||
#define WIDTH (8 * sizeof (uint32_t))
|
||||
#define FINAL_XOR_VALUE 0xFFFFFFFF
|
||||
#define REFLECT_DATA(X) ((uint8_t) reflect ((X), 8))
|
||||
#define REFLECT_REMAINDER(X) ((unsigned int) reflect ((X), WIDTH))
|
||||
|
||||
|
||||
uint8_t
|
||||
gx_proto_crc8_calc (uint8_t *lubp_date, uint32_t lui_len)
|
||||
{
|
||||
const uint8_t *data = lubp_date;
|
||||
unsigned int crc = 0;
|
||||
int i, j;
|
||||
|
||||
for (j = lui_len; j; j--, data++)
|
||||
{
|
||||
crc ^= (*data << 8);
|
||||
for (i = 8; i; i--)
|
||||
{
|
||||
if (crc & 0x8000)
|
||||
crc ^= (0x1070 << 3);
|
||||
crc <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
crc >>= 8;
|
||||
crc = ~crc;
|
||||
return (uint8_t) crc;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t crc;
|
||||
} gf_crc32_context;
|
||||
|
||||
static uint32_t s_crc_table[256] =
|
||||
{ 0x0, 0x4c11db7, 0x9823b6e, 0xd4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
|
||||
0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
|
||||
0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
|
||||
0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd,
|
||||
0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5,
|
||||
0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
|
||||
0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,
|
||||
0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d,
|
||||
0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
|
||||
0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x18aeb13, 0x54bf6a4, 0x808d07d, 0xcc9cdca,
|
||||
0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02,
|
||||
0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
|
||||
0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692,
|
||||
0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a,
|
||||
0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
|
||||
0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a,
|
||||
0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,
|
||||
0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
|
||||
0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b,
|
||||
0x315d626, 0x7d4cb91, 0xa97ed48, 0xe56f0ff, 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623,
|
||||
0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
|
||||
0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
|
||||
0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b,
|
||||
0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
|
||||
0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c,
|
||||
0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24,
|
||||
0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, 0x29f3d35, 0x65e2082, 0xb1d065b, 0xfdc1bec,
|
||||
0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654,
|
||||
0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c,
|
||||
0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
|
||||
0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c,
|
||||
0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4};
|
||||
|
||||
static uint32_t
|
||||
reflect (uint32_t data, uint8_t n_bits)
|
||||
{
|
||||
unsigned long reflection = 0x00000000;
|
||||
uint8_t bit;
|
||||
|
||||
/*
|
||||
* Reflect the data about the center bit.
|
||||
*/
|
||||
for (bit = 0; bit < n_bits; ++bit)
|
||||
{
|
||||
/*
|
||||
* If the LSB bit is set, set the reflection of it.
|
||||
*/
|
||||
if (data & 0x01)
|
||||
reflection |= (1 << ((n_bits - 1) - bit));
|
||||
|
||||
data = (data >> 1);
|
||||
}
|
||||
|
||||
return reflection;
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
crc32_init (gf_crc32_context *ctx)
|
||||
{
|
||||
ctx->crc = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
static void
|
||||
crc32_update (gf_crc32_context *ctx, const uint8_t *message, uint32_t n_bytes)
|
||||
{
|
||||
uint8_t data;
|
||||
uint32_t byte;
|
||||
|
||||
/*
|
||||
* Divide the message by the polynomial, a byte at a time.
|
||||
*/
|
||||
for (byte = 0; byte < n_bytes; ++byte)
|
||||
{
|
||||
data = REFLECT_DATA (message[byte]) ^ (ctx->crc >> (WIDTH - 8));
|
||||
ctx->crc = s_crc_table[data] ^ (ctx->crc << 8);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
crc32_final (gf_crc32_context *ctx, uint8_t *md)
|
||||
{
|
||||
ctx->crc = (REFLECT_REMAINDER (ctx->crc) ^ FINAL_XOR_VALUE);
|
||||
memcpy (md, &ctx->crc, 4);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
gx_proto_crc32_calc (uint8_t *pchMsg, uint32_t wDataLen, uint8_t *pchMsgDst)
|
||||
{
|
||||
gf_crc32_context context = { 0 };
|
||||
|
||||
if (!pchMsg)
|
||||
return 0;
|
||||
|
||||
crc32_init (&context);
|
||||
|
||||
crc32_update (&context, pchMsg, wDataLen);
|
||||
|
||||
crc32_final (&context, pchMsgDst);
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
/*
|
||||
* protocol
|
||||
*
|
||||
*/
|
||||
|
||||
static uint8_t dump_seq = 0;
|
||||
|
||||
static void
|
||||
init_pack_header (
|
||||
ppack_header pheader,
|
||||
uint16_t len,
|
||||
uint16_t cmd,
|
||||
uint8_t packagenum
|
||||
)
|
||||
{
|
||||
g_assert (pheader);
|
||||
|
||||
memset (pheader, 0, sizeof (*pheader));
|
||||
pheader->cmd0 = HIBYTE (cmd);
|
||||
pheader->cmd1 = LOBYTE (cmd);
|
||||
pheader->packagenum = packagenum;
|
||||
pheader->reserved = dump_seq++;
|
||||
pheader->len = len + PACKAGE_CRC_SIZE;
|
||||
pheader->crc8 = gx_proto_crc8_calc ((uint8_t *) pheader, 6);
|
||||
pheader->rev_crc8 = ~pheader->crc8;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
gx_proto_build_package (uint8_t *ppackage,
|
||||
uint32_t *package_len,
|
||||
uint16_t cmd,
|
||||
const uint8_t *payload,
|
||||
uint32_t payload_size)
|
||||
{
|
||||
pack_header header;
|
||||
|
||||
if (!ppackage || !package_len)
|
||||
return -1;
|
||||
|
||||
if(*package_len < (payload_size + PACKAGE_HEADER_SIZE + PACKAGE_CRC_SIZE))
|
||||
return -1;
|
||||
|
||||
init_pack_header (&header, payload_size, cmd, 0);
|
||||
|
||||
memcpy (ppackage, &header, PACKAGE_HEADER_SIZE);
|
||||
memcpy (ppackage + PACKAGE_HEADER_SIZE, payload, payload_size);
|
||||
|
||||
gx_proto_crc32_calc (ppackage, PACKAGE_HEADER_SIZE + payload_size, ppackage + PACKAGE_HEADER_SIZE + payload_size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
gx_proto_parse_header (
|
||||
uint8_t *buffer,
|
||||
uint32_t buffer_len,
|
||||
pack_header *pheader)
|
||||
{
|
||||
if (!buffer || !pheader)
|
||||
return -1;
|
||||
if (buffer_len < PACKAGE_HEADER_SIZE)
|
||||
return -1;
|
||||
|
||||
memcpy (pheader, buffer, sizeof (pack_header));
|
||||
|
||||
pheader->len = GUINT16_FROM_LE ( *(uint16_t *) (buffer + 4));
|
||||
pheader->len -= PACKAGE_CRC_SIZE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
gx_proto_parse_fingerid (
|
||||
uint8_t * fid_buffer,
|
||||
uint16_t fid_buffer_size,
|
||||
ptemplate_format_t template
|
||||
)
|
||||
{
|
||||
uint8_t * buffer = NULL;
|
||||
uint16_t Offset = 0;
|
||||
|
||||
if (!template || !fid_buffer)
|
||||
return -1;
|
||||
|
||||
if (fid_buffer_size < 70)
|
||||
return -1;
|
||||
|
||||
buffer = fid_buffer;
|
||||
Offset = 0;
|
||||
|
||||
if (buffer[Offset++] != 67)
|
||||
return -1;
|
||||
|
||||
template->type = buffer[Offset++];
|
||||
template->finger_index = buffer[Offset++];
|
||||
Offset++;
|
||||
|
||||
memcpy (template->accountid, &buffer[Offset], 32);
|
||||
Offset += 32;
|
||||
|
||||
memcpy (template->tid, &buffer[Offset], 32);
|
||||
Offset += 32; // Offset == 68
|
||||
|
||||
template->payload.size = buffer[Offset++];
|
||||
memset (template->payload.data, 0, 56);
|
||||
memcpy (template->payload.data, &buffer[Offset], template->payload.size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
gx_proto_parse_body (uint16_t cmd, uint8_t *buffer, uint32_t buffer_len, pgxfp_cmd_response_t presp)
|
||||
{
|
||||
uint32_t offset = 0;
|
||||
uint8_t *fingerlist = NULL;
|
||||
|
||||
if (!buffer || !presp)
|
||||
return -1;
|
||||
if (buffer_len < 1)
|
||||
return -1;
|
||||
presp->result = buffer[0];
|
||||
switch (HIBYTE (cmd))
|
||||
{
|
||||
case RESPONSE_PACKAGE_CMD:
|
||||
{
|
||||
presp->parse_msg.ack_cmd = buffer[1];
|
||||
}
|
||||
break;
|
||||
|
||||
case MOC_CMD0_UPDATE_CONFIG:
|
||||
{
|
||||
presp->finger_config.status = buffer[0];
|
||||
presp->finger_config.max_stored_prints = buffer[2];
|
||||
}
|
||||
break;
|
||||
|
||||
case MOC_CMD0_COMMITENROLLMENT:
|
||||
case MOC_CMD0_DELETETEMPLATE:
|
||||
break;
|
||||
|
||||
case MOC_CMD0_GET_VERSION:
|
||||
memcpy (&presp->version_info, buffer + 1, sizeof (gxfp_version_info_t));
|
||||
break;
|
||||
|
||||
case MOC_CMD0_CAPTURE_DATA:
|
||||
if (LOBYTE (cmd) == MOC_CMD1_DEFAULT)
|
||||
{
|
||||
presp->capture_data_resp.img_quality = buffer[1];
|
||||
presp->capture_data_resp.img_coverage = buffer[2];
|
||||
}
|
||||
break;
|
||||
|
||||
case MOC_CMD0_ENROLL_INIT:
|
||||
if (presp->result == GX_SUCCESS)
|
||||
memcpy (&presp->enroll_init.tid, &buffer[1], TEMPLATE_ID_SIZE);
|
||||
break;
|
||||
|
||||
case MOC_CMD0_ENROLL:
|
||||
presp->enroll_update.rollback = (buffer[0] < 0x80) ? false : true;
|
||||
presp->enroll_update.img_overlay = buffer[1];
|
||||
presp->enroll_update.img_preoverlay = buffer[2];
|
||||
break;
|
||||
|
||||
case MOC_CMD0_CHECK4DUPLICATE:
|
||||
presp->check_duplicate_resp.duplicate = (presp->result == 0) ? false : true;
|
||||
if (presp->check_duplicate_resp.duplicate)
|
||||
{
|
||||
uint16_t tid_size = GUINT16_FROM_LE (*(buffer + 1));
|
||||
memcpy (&presp->check_duplicate_resp.template, buffer + 3, tid_size);
|
||||
}
|
||||
break;
|
||||
|
||||
case MOC_CMD0_GETFINGERLIST:
|
||||
if (presp->result != GX_SUCCESS)
|
||||
break;
|
||||
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;
|
||||
for(uint8_t num = 0; num < presp->finger_list_resp.finger_num; num++)
|
||||
{
|
||||
uint16_t fingerid_length = GUINT16_FROM_LE (*(fingerlist + offset));
|
||||
offset += 2;
|
||||
if (gx_proto_parse_fingerid (fingerlist + offset,
|
||||
fingerid_length,
|
||||
&presp->finger_list_resp.finger_list[num]) != 0)
|
||||
{
|
||||
g_error ("parse fingerlist error");
|
||||
presp->finger_list_resp.finger_num = 0;
|
||||
presp->result = GX_FAILED;
|
||||
break;
|
||||
}
|
||||
offset += fingerid_length;
|
||||
}
|
||||
break;
|
||||
|
||||
case MOC_CMD0_IDENTIFY:
|
||||
{
|
||||
uint32_t score = 0;
|
||||
uint8_t study = 0;
|
||||
uint16_t fingerid_size = 0;
|
||||
presp->verify.match = (buffer[0] == 0) ? true : false;
|
||||
if (presp->verify.match)
|
||||
{
|
||||
offset += 1;
|
||||
presp->verify.rejectdetail = GUINT16_FROM_LE (*(buffer + offset));
|
||||
offset += 2;
|
||||
score = GUINT32_FROM_LE (*(buffer + offset));
|
||||
offset += 4;
|
||||
study = GUINT16_FROM_LE (*(buffer + offset));
|
||||
offset += 1;
|
||||
fingerid_size = GUINT16_FROM_LE (*(buffer + offset));
|
||||
offset += 2;
|
||||
if (gx_proto_parse_fingerid (buffer + offset, fingerid_size, &presp->verify.template) != 0)
|
||||
{
|
||||
presp->result = GX_FAILED;
|
||||
break;
|
||||
}
|
||||
g_debug ("match, score: %d, study: %d", score, study);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MOC_CMD0_FINGER_MODE:
|
||||
presp->finger_status.status = buffer[0];
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint8_t sensor_config[26] = {
|
||||
0x00, 0x00, 0x64, 0x50, 0x0f, 0x41, 0x08, 0x0a, 0x18, 0x00, 0x00, 0x23, 0x00,
|
||||
0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x05, 0x05
|
||||
};
|
||||
|
||||
int
|
||||
gx_proto_init_sensor_config (pgxfp_sensor_cfg_t pconfig)
|
||||
{
|
||||
uint32_t crc32_calc = 0;
|
||||
|
||||
if (!pconfig)
|
||||
return -1;
|
||||
memset (pconfig, 0, sizeof (*pconfig));
|
||||
|
||||
//NOTICE: Do not change any value!
|
||||
memcpy (&pconfig->config, sensor_config, G_N_ELEMENTS (sensor_config));
|
||||
pconfig->reserved[0] = 1;
|
||||
|
||||
gx_proto_crc32_calc ((uint8_t *) pconfig, sizeof (*pconfig) - PACKAGE_CRC_SIZE, (uint8_t *) &crc32_calc);
|
||||
|
||||
memcpy (pconfig->crc_value, &crc32_calc, PACKAGE_CRC_SIZE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
238
libfprint/drivers/goodixmoc/goodix_proto.h
Normal file
238
libfprint/drivers/goodixmoc/goodix_proto.h
Normal file
@@ -0,0 +1,238 @@
|
||||
/*
|
||||
* Goodix Moc driver for libfprint
|
||||
* Copyright (C) 2019 Shenzhen Goodix Technology Co., Ltd.
|
||||
*
|
||||
* 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 <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#define PACKAGE_CRC_SIZE (4)
|
||||
#define PACKAGE_HEADER_SIZE (8)
|
||||
|
||||
#define FP_MAX_FINGERNUM (20)
|
||||
|
||||
#define TEMPLATE_ID_SIZE (32)
|
||||
|
||||
#define GX_VERSION_LEN (8)
|
||||
|
||||
/* Type covert */
|
||||
#define MAKE_CMD_EX(cmd0, cmd1) ((uint16_t) (((cmd0) << 8) | (cmd1)))
|
||||
#define LOBYTE(value) ((uint8_t) (value))
|
||||
#define HIBYTE(value) ((uint8_t) (((uint16_t) (value) >> 8) & 0xFF))
|
||||
|
||||
|
||||
/* Error code */
|
||||
#define GX_SUCCESS 0x00
|
||||
#define GX_FAILED 0x80
|
||||
#define GX_ERROR_FINGER_ID_NOEXIST 0x9C
|
||||
#define GX_ERROR_TEMPLATE_INCOMPLETE 0xB8
|
||||
#define GX_ERROR_WAIT_FINGER_UP_TIMEOUT 0xC7
|
||||
#define GX_ERROR_NO_AVAILABLE_SPACE 0x8F
|
||||
|
||||
/* Command Type Define */
|
||||
#define RESPONSE_PACKAGE_CMD 0xAA
|
||||
|
||||
#define MOC_CMD0_ENROLL 0xA0
|
||||
#define MOC_CMD0_ENROLL_INIT 0xA1
|
||||
#define MOC_CMD0_CAPTURE_DATA 0xA2
|
||||
#define MOC_CMD0_CHECK4DUPLICATE 0xA3
|
||||
#define MOC_CMD0_COMMITENROLLMENT 0xA4
|
||||
|
||||
#define MOC_CMD0_IDENTIFY 0xA5
|
||||
#define MOC_CMD0_GETFINGERLIST 0xA6
|
||||
#define MOC_CMD0_DELETETEMPLATE 0xA7
|
||||
|
||||
#define MOC_CMD1_DEFAULT 0x00
|
||||
#define MOC_CMD1_UNTIL_DOWN 0x00
|
||||
#define MOC_CMD1_WHEN_DOWN 0x01
|
||||
|
||||
#define MOC_CMD1_DELETE_TEMPLATE 0x04
|
||||
#define MOC_CMD1_DELETE_ALL 0x01
|
||||
|
||||
#define MOC_CMD0_GET_VERSION 0xD0
|
||||
|
||||
#define MOC_CMD0_UPDATE_CONFIG 0xC0
|
||||
#define MOC_CMD1_NWRITE_CFG_TO_FLASH 0x00
|
||||
#define MOC_CMD1_WRITE_CFG_TO_FLASH 0x01
|
||||
|
||||
#define MOC_CMD0_FINGER_MODE 0xB0
|
||||
#define MOC_CMD1_GET_FINGER_MODE 0x00
|
||||
#define MOC_CMD1_SET_FINGER_DOWN 0x01
|
||||
#define MOC_CMD1_SET_FINGER_UP 0x02
|
||||
/* */
|
||||
|
||||
typedef struct _gxfp_version_info
|
||||
{
|
||||
uint8_t format[2];
|
||||
uint8_t fwtype[GX_VERSION_LEN];
|
||||
uint8_t fwversion[GX_VERSION_LEN];
|
||||
uint8_t customer[GX_VERSION_LEN];
|
||||
uint8_t mcu[GX_VERSION_LEN];
|
||||
uint8_t sensor[GX_VERSION_LEN];
|
||||
uint8_t algversion[GX_VERSION_LEN];
|
||||
uint8_t interface[GX_VERSION_LEN];
|
||||
uint8_t protocol[GX_VERSION_LEN];
|
||||
uint8_t flashVersion[GX_VERSION_LEN];
|
||||
uint8_t reserved[62];
|
||||
} gxfp_version_info_t, *pgxfp_version_info_t;
|
||||
|
||||
|
||||
typedef struct _gxfp_parse_msg
|
||||
{
|
||||
uint8_t ack_cmd;
|
||||
bool has_no_config;
|
||||
} gxfp_parse_msg_t, *pgxfp_parse_msg_t;
|
||||
|
||||
|
||||
typedef struct _gxfp_enroll_init
|
||||
{
|
||||
uint8_t tid[TEMPLATE_ID_SIZE];
|
||||
} gxfp_enroll_init_t, *pgxfp_enroll_init_t;
|
||||
|
||||
#pragma pack(push, 1)
|
||||
typedef struct _template_format
|
||||
{
|
||||
uint8_t type;
|
||||
uint8_t finger_index;
|
||||
uint8_t accountid[32];
|
||||
uint8_t tid[32];
|
||||
struct
|
||||
{
|
||||
uint32_t size;
|
||||
uint8_t data[56];
|
||||
} payload;
|
||||
uint8_t reserve[2];
|
||||
} template_format_t, *ptemplate_format_t;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
|
||||
typedef struct _gxfp_verify
|
||||
{
|
||||
bool match;
|
||||
uint32_t rejectdetail;
|
||||
template_format_t template;
|
||||
} gxfp_verify_t, *pgxfp_verify_t;
|
||||
|
||||
|
||||
typedef struct _gxfp_capturedata
|
||||
{
|
||||
uint8_t img_quality;
|
||||
uint8_t img_coverage;
|
||||
} gxfp_capturedata_t, *pgxfp_capturedata_t;
|
||||
|
||||
typedef struct _gxfp_check_duplicate
|
||||
{
|
||||
bool duplicate;
|
||||
template_format_t template;
|
||||
} gxfp_check_duplicate_t, *pgxfp_check_duplicate_t;
|
||||
|
||||
|
||||
typedef struct _gxfp_enroll_update
|
||||
{
|
||||
bool rollback;
|
||||
uint8_t img_overlay;
|
||||
uint8_t img_preoverlay;
|
||||
} gxfp_enroll_update_t, *Pgxfp_enroll_update_t;
|
||||
|
||||
typedef struct _gxfp_enum_fingerlist
|
||||
{
|
||||
uint8_t finger_num;
|
||||
template_format_t finger_list[FP_MAX_FINGERNUM];
|
||||
} gxfp_enum_fingerlist_t, *pgxfp_enum_fingerlist_t;
|
||||
|
||||
typedef struct _gxfp_enroll_commit
|
||||
{
|
||||
uint8_t result;
|
||||
} gxfp_enroll_commit_t, *pgxfp_enroll_commit_t;
|
||||
|
||||
typedef struct _fp_finger_status
|
||||
{
|
||||
uint8_t status;
|
||||
} 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_cmd_response
|
||||
{
|
||||
uint8_t result;
|
||||
union
|
||||
{
|
||||
gxfp_parse_msg_t parse_msg;
|
||||
gxfp_verify_t verify;
|
||||
gxfp_enroll_init_t enroll_init;
|
||||
gxfp_capturedata_t capture_data_resp;
|
||||
gxfp_check_duplicate_t check_duplicate_resp;
|
||||
gxfp_enroll_commit_t enroll_commit;
|
||||
gxfp_enroll_update_t enroll_update;
|
||||
gxfp_enum_fingerlist_t finger_list_resp;
|
||||
gxfp_version_info_t version_info;
|
||||
fp_finger_status_t finger_status;
|
||||
fp_finger_config_t finger_config;
|
||||
};
|
||||
} gxfp_cmd_response_t, *pgxfp_cmd_response_t;
|
||||
|
||||
|
||||
typedef struct _pack_header
|
||||
{
|
||||
uint8_t cmd0;
|
||||
uint8_t cmd1;
|
||||
uint8_t packagenum;
|
||||
uint8_t reserved;
|
||||
uint16_t len;
|
||||
uint8_t crc8;
|
||||
uint8_t rev_crc8;
|
||||
} pack_header, *ppack_header;
|
||||
|
||||
|
||||
typedef struct _gxfp_sensor_cfg
|
||||
{
|
||||
uint8_t config[26];
|
||||
uint8_t reserved[98];
|
||||
uint8_t crc_value[4];
|
||||
} gxfp_sensor_cfg_t, *pgxfp_sensor_cfg_t;
|
||||
/* */
|
||||
|
||||
int gx_proto_build_package (uint8_t *ppackage,
|
||||
uint32_t *package_len,
|
||||
uint16_t cmd,
|
||||
const uint8_t *payload,
|
||||
uint32_t payload_size);
|
||||
|
||||
int gx_proto_parse_header (uint8_t *buffer,
|
||||
uint32_t buffer_len,
|
||||
pack_header *pheader);
|
||||
|
||||
int gx_proto_parse_body (uint16_t cmd,
|
||||
uint8_t *buffer,
|
||||
uint32_t buffer_len,
|
||||
pgxfp_cmd_response_t presponse);
|
||||
|
||||
int gx_proto_init_sensor_config (pgxfp_sensor_cfg_t pconfig);
|
||||
|
||||
uint8_t gx_proto_crc8_calc (uint8_t *lubp_date,
|
||||
uint32_t lui_len);
|
||||
|
||||
uint8_t gx_proto_crc32_calc (uint8_t *pchMsg,
|
||||
uint32_t wDataLen,
|
||||
uint8_t *pchMsgDst);
|
||||
@@ -27,9 +27,18 @@
|
||||
|
||||
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[] = {
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0xBD, },
|
||||
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0xE9, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0xDF, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0xF9, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0xFC, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0xC2, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0xC9, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0xE7, },
|
||||
{ .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */
|
||||
};
|
||||
|
||||
@@ -78,10 +87,17 @@ cmd_receive_cb (FpiUsbTransfer *transfer,
|
||||
if (msg_resp.payload[0] == 0x01)
|
||||
{
|
||||
self->finger_on_sensor = TRUE;
|
||||
fpi_device_report_finger_status_changes (device,
|
||||
FP_FINGER_STATUS_PRESENT,
|
||||
FP_FINGER_STATUS_NONE);
|
||||
}
|
||||
else
|
||||
{
|
||||
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)
|
||||
{
|
||||
fpi_ssm_mark_completed (transfer->ssm);
|
||||
@@ -108,7 +124,7 @@ cmd_receive_cb (FpiUsbTransfer *transfer,
|
||||
{
|
||||
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,
|
||||
g_error_new_literal (G_IO_ERROR,
|
||||
G_IO_ERROR_CANCELLED,
|
||||
@@ -193,12 +209,19 @@ cmd_interrupt_cb (FpiUsbTransfer *transfer,
|
||||
fpi_ssm_mark_failed (transfer->ssm, error);
|
||||
return;
|
||||
}
|
||||
g_clear_pointer (&error, g_error_free);
|
||||
|
||||
if (transfer->buffer[0] & USB_ASYNC_MESSAGE_PENDING || error)
|
||||
fpi_ssm_next_state (transfer->ssm);
|
||||
if (transfer->buffer[0] & USB_ASYNC_MESSAGE_PENDING)
|
||||
{
|
||||
fpi_ssm_next_state (transfer->ssm);
|
||||
}
|
||||
else
|
||||
fpi_usb_transfer_submit (transfer, 1000, NULL, cmd_interrupt_cb, NULL);
|
||||
{
|
||||
fpi_usb_transfer_submit (fpi_usb_transfer_ref (transfer),
|
||||
0,
|
||||
NULL,
|
||||
cmd_interrupt_cb,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -431,6 +454,37 @@ parse_print_data (GVariant *data,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static FpPrint *
|
||||
create_print (FpiDeviceSynaptics *self,
|
||||
guint8 *user_id,
|
||||
guint8 finger_id)
|
||||
{
|
||||
FpPrint *print;
|
||||
g_autofree gchar *user_id_safe;
|
||||
GVariant *data = NULL;
|
||||
GVariant *uid = NULL;
|
||||
|
||||
user_id_safe = g_strndup ((char *) user_id, BMKT_MAX_USER_ID_LEN);
|
||||
|
||||
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);
|
||||
|
||||
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", user_id_safe, NULL);
|
||||
|
||||
fpi_print_fill_from_user_id (print, user_id_safe);
|
||||
|
||||
return print;
|
||||
}
|
||||
|
||||
static void
|
||||
list_msg_cb (FpiDeviceSynaptics *self,
|
||||
bmkt_response_t *resp,
|
||||
@@ -483,10 +537,7 @@ list_msg_cb (FpiDeviceSynaptics *self,
|
||||
|
||||
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;
|
||||
@@ -499,23 +550,9 @@ list_msg_cb (FpiDeviceSynaptics *self,
|
||||
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);
|
||||
print = create_print (self,
|
||||
get_enroll_templates_resp->templates[n].user_id,
|
||||
get_enroll_templates_resp->templates[n].finger_id);
|
||||
|
||||
g_ptr_array_add (self->list_result, g_object_ref_sink (print));
|
||||
}
|
||||
@@ -585,6 +622,9 @@ verify_msg_cb (FpiDeviceSynaptics *self,
|
||||
switch (resp->response_id)
|
||||
{
|
||||
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!");
|
||||
break;
|
||||
|
||||
@@ -626,7 +666,7 @@ verify_msg_cb (FpiDeviceSynaptics *self,
|
||||
fp_info ("Verify was successful! for user: %s finger: %d score: %f",
|
||||
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_complete (device, NULL);
|
||||
verify_complete_after_finger_removal (self);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -658,6 +698,212 @@ verify (FpDevice *device)
|
||||
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)
|
||||
{
|
||||
FpDevice *device = FP_DEVICE (self);
|
||||
|
||||
if (self->finger_on_sensor)
|
||||
{
|
||||
fp_dbg ("delaying identify report until after finger removal!");
|
||||
self->cmd_complete_on_removal = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
fpi_device_identify_complete (device, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
identify_msg_cb (FpiDeviceSynaptics *self,
|
||||
bmkt_response_t *resp,
|
||||
GError *error)
|
||||
{
|
||||
FpDevice *device = FP_DEVICE (self);
|
||||
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
else if (resp->result == BMKT_FP_DATABASE_NO_RECORD_EXISTS)
|
||||
{
|
||||
fp_info ("Print is not in database");
|
||||
fpi_device_identify_complete (device,
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
identify (FpDevice *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
|
||||
enroll_msg_cb (FpiDeviceSynaptics *self,
|
||||
bmkt_response_t *resp,
|
||||
@@ -679,6 +925,9 @@ enroll_msg_cb (FpiDeviceSynaptics *self,
|
||||
case BMKT_RSP_ENROLL_READY:
|
||||
{
|
||||
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!");
|
||||
break;
|
||||
}
|
||||
@@ -884,6 +1133,44 @@ delete_print (FpDevice *device)
|
||||
synaptics_sensor_cmd (self, 0, BMKT_CMD_DEL_USER_FP, payload, user_id_len + 1, delete_msg_cb);
|
||||
}
|
||||
|
||||
static void
|
||||
prob_msg_cb (FpiDeviceSynaptics *self,
|
||||
bmkt_response_t *resp,
|
||||
GError *error)
|
||||
{
|
||||
GUsbDevice *usb_dev = NULL;
|
||||
g_autofree gchar *serial = NULL;
|
||||
|
||||
usb_dev = fpi_device_get_usb_device (FP_DEVICE (self));
|
||||
|
||||
if (error)
|
||||
{
|
||||
g_usb_device_close (usb_dev, NULL);
|
||||
fpi_device_probe_complete (FP_DEVICE (self), NULL, NULL,
|
||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL, "unsupported firmware version"));
|
||||
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),
|
||||
&error);
|
||||
|
||||
if (resp->result == BMKT_SUCCESS)
|
||||
{
|
||||
g_usb_device_close (usb_dev, NULL);
|
||||
fpi_device_probe_complete (FP_DEVICE (self), serial, NULL, error);
|
||||
}
|
||||
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
|
||||
dev_probe (FpDevice *device)
|
||||
{
|
||||
@@ -897,6 +1184,7 @@ dev_probe (FpDevice *device)
|
||||
const guint8 *data;
|
||||
gboolean read_ok = TRUE;
|
||||
g_autofree gchar *serial = NULL;
|
||||
gboolean retry = TRUE;
|
||||
|
||||
G_DEBUG_HERE ();
|
||||
|
||||
@@ -914,35 +1202,43 @@ dev_probe (FpDevice *device)
|
||||
if (!g_usb_device_claim_interface (usb_dev, 0, 0, &error))
|
||||
goto err_close;
|
||||
|
||||
/* TODO: Do not do this synchronous. */
|
||||
transfer = fpi_usb_transfer_new (device);
|
||||
fpi_usb_transfer_fill_bulk (transfer, USB_EP_REQUEST, SENSOR_FW_CMD_HEADER_LEN);
|
||||
transfer->short_is_error = TRUE;
|
||||
transfer->buffer[0] = SENSOR_CMD_GET_VERSION;
|
||||
if (!fpi_usb_transfer_submit_sync (transfer, 1000, &error))
|
||||
goto err_close;
|
||||
|
||||
g_clear_pointer (&transfer, fpi_usb_transfer_unref);
|
||||
transfer = fpi_usb_transfer_new (device);
|
||||
fpi_usb_transfer_fill_bulk (transfer, USB_EP_REPLY, 40);
|
||||
if (!fpi_usb_transfer_submit_sync (transfer, 1000, &error))
|
||||
goto err_close;
|
||||
|
||||
fpi_byte_reader_init (&reader, transfer->buffer, transfer->actual_length);
|
||||
|
||||
if (!fpi_byte_reader_get_uint16_le (&reader, &status))
|
||||
while(1)
|
||||
{
|
||||
g_warning ("Transfer in response to version query was too short");
|
||||
error = fpi_device_error_new (FP_DEVICE_ERROR_PROTO);
|
||||
goto err_close;
|
||||
}
|
||||
if (status != 0)
|
||||
{
|
||||
g_warning ("Device responded with error: %d", status);
|
||||
error = fpi_device_error_new (FP_DEVICE_ERROR_PROTO);
|
||||
goto err_close;
|
||||
}
|
||||
/* TODO: Do not do this synchronous. */
|
||||
transfer = fpi_usb_transfer_new (device);
|
||||
fpi_usb_transfer_fill_bulk (transfer, USB_EP_REQUEST, SENSOR_FW_CMD_HEADER_LEN);
|
||||
transfer->short_is_error = TRUE;
|
||||
transfer->buffer[0] = SENSOR_CMD_GET_VERSION;
|
||||
if (!fpi_usb_transfer_submit_sync (transfer, 1000, &error))
|
||||
goto err_close;
|
||||
|
||||
g_clear_pointer (&transfer, fpi_usb_transfer_unref);
|
||||
transfer = fpi_usb_transfer_new (device);
|
||||
fpi_usb_transfer_fill_bulk (transfer, USB_EP_REPLY, 40);
|
||||
if (!fpi_usb_transfer_submit_sync (transfer, 1000, &error))
|
||||
goto err_close;
|
||||
|
||||
fpi_byte_reader_init (&reader, transfer->buffer, transfer->actual_length);
|
||||
|
||||
if (!fpi_byte_reader_get_uint16_le (&reader, &status))
|
||||
{
|
||||
g_warning ("Transfer in response to version query was too short");
|
||||
error = fpi_device_error_new (FP_DEVICE_ERROR_PROTO);
|
||||
goto err_close;
|
||||
}
|
||||
if (status != 0)
|
||||
{
|
||||
g_warning ("Device responded with error: %d retry: %d", status, retry);
|
||||
if(retry)
|
||||
{
|
||||
retry = FALSE;
|
||||
continue;
|
||||
}
|
||||
error = fpi_device_error_new (FP_DEVICE_ERROR_PROTO);
|
||||
goto err_close;
|
||||
}
|
||||
break;
|
||||
}
|
||||
read_ok &= fpi_byte_reader_get_uint32_le (&reader, &self->mis_version.build_time);
|
||||
read_ok &= fpi_byte_reader_get_uint32_le (&reader, &self->mis_version.build_num);
|
||||
read_ok &= fpi_byte_reader_get_uint8 (&reader, &self->mis_version.version_major);
|
||||
@@ -975,40 +1271,7 @@ dev_probe (FpDevice *device)
|
||||
fp_dbg ("Target: %d", self->mis_version.target);
|
||||
fp_dbg ("Product: %d", self->mis_version.product);
|
||||
|
||||
|
||||
/* 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);
|
||||
synaptics_sensor_cmd (self, 0, BMKT_CMD_FPS_INIT, NULL, 0, prob_msg_cb);
|
||||
|
||||
return;
|
||||
|
||||
@@ -1142,6 +1405,7 @@ fpi_device_synaptics_class_init (FpiDeviceSynapticsClass *klass)
|
||||
dev_class->close = dev_exit;
|
||||
dev_class->probe = dev_probe;
|
||||
dev_class->verify = verify;
|
||||
dev_class->identify = identify;
|
||||
dev_class->enroll = enroll;
|
||||
dev_class->delete = delete_print;
|
||||
dev_class->cancel = cancel;
|
||||
|
||||
@@ -110,6 +110,7 @@ struct _FpiDeviceSynaptics
|
||||
FpiSsm *cmd_ssm;
|
||||
FpiUsbTransfer *cmd_pending_transfer;
|
||||
gboolean cmd_complete_on_removal;
|
||||
guint8 id_idx;
|
||||
|
||||
bmkt_sensor_version_t mis_version;
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ finger_present (unsigned char *img, size_t len, int sum_threshold)
|
||||
if (img[i] < 160)
|
||||
sum++;
|
||||
|
||||
fp_dbg ("finger_present: sum is %d\n", sum);
|
||||
fp_dbg ("finger_present: sum is %d", sum);
|
||||
return sum < sum_threshold ? 0 : 1;
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ finger_det_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
|
||||
if (error)
|
||||
{
|
||||
fp_dbg ("data transfer status %s\n", error->message);
|
||||
fp_dbg ("data transfer status %s", error->message);
|
||||
fpi_image_device_session_error (dev, error);
|
||||
return;
|
||||
}
|
||||
@@ -212,7 +212,7 @@ finger_det_cmd_cb (FpiUsbTransfer *t, FpDevice *device,
|
||||
|
||||
if (error)
|
||||
{
|
||||
fp_dbg ("req transfer status %s\n", error->message);
|
||||
fp_dbg ("req transfer status %s", error->message);
|
||||
fpi_image_device_session_error (dev, error);
|
||||
return;
|
||||
}
|
||||
@@ -411,7 +411,7 @@ dev_init (FpImageDevice *dev)
|
||||
break;
|
||||
|
||||
default:
|
||||
fp_err ("Device variant %lu is not known\n", driver_data);
|
||||
fp_err ("Device variant %lu is not known", driver_data);
|
||||
g_assert_not_reached ();
|
||||
fpi_image_device_open_complete (dev, fpi_device_error_new (FP_DEVICE_ERROR_GENERAL));
|
||||
return;
|
||||
|
||||
@@ -78,6 +78,7 @@ upektc_img_cmd_update_crc (unsigned char *cmd_buf, size_t size)
|
||||
cmd_buf[size - 1] = (crc & 0xff00) >> 8;
|
||||
}
|
||||
|
||||
FP_GNUC_ACCESS (read_only, 3, 4)
|
||||
static void
|
||||
upektc_img_submit_req (FpiSsm *ssm,
|
||||
FpImageDevice *dev,
|
||||
@@ -193,7 +194,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
|
||||
if (self->deactivating)
|
||||
{
|
||||
fp_dbg ("Deactivate requested\n");
|
||||
fp_dbg ("Deactivate requested");
|
||||
fpi_ssm_mark_completed (transfer->ssm);
|
||||
return;
|
||||
}
|
||||
@@ -208,7 +209,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
|
||||
if (fpi_ssm_get_cur_state (transfer->ssm) == CAPTURE_READ_DATA_TERM)
|
||||
{
|
||||
fp_dbg ("Terminating SSM\n");
|
||||
fp_dbg ("Terminating SSM");
|
||||
fpi_ssm_mark_completed (transfer->ssm);
|
||||
return;
|
||||
}
|
||||
@@ -219,7 +220,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
response_size += 9; /* 7 bytes for header, 2 for CRC */
|
||||
if (response_size > transfer->actual_length)
|
||||
{
|
||||
fp_dbg ("response_size is %lu, actual_length is %d\n",
|
||||
fp_dbg ("response_size is %lu, actual_length is %d",
|
||||
response_size, (gint) transfer->actual_length);
|
||||
fp_dbg ("Waiting for rest of transfer");
|
||||
BUG_ON (self->response_rest);
|
||||
@@ -237,7 +238,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
{
|
||||
/* No finger */
|
||||
case 0x28:
|
||||
fp_dbg ("18th byte is %.2x\n", data[18]);
|
||||
fp_dbg ("18th byte is %.2x", data[18]);
|
||||
switch (data[18])
|
||||
{
|
||||
case 0x0c:
|
||||
@@ -254,7 +255,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
|
||||
case 0x1e:
|
||||
/* short scan */
|
||||
fp_err ("short scan, aborting\n");
|
||||
fp_err ("short scan, aborting");
|
||||
fpi_image_device_retry_scan (dev,
|
||||
FP_DEVICE_RETRY_TOO_SHORT);
|
||||
fpi_image_device_report_finger_status (dev,
|
||||
@@ -265,7 +266,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
|
||||
case 0x1d:
|
||||
/* too much horisontal movement */
|
||||
fp_err ("too much horisontal movement, aborting\n");
|
||||
fp_err ("too much horisontal movement, aborting");
|
||||
fpi_image_device_retry_scan (dev,
|
||||
FP_DEVICE_RETRY_CENTER_FINGER);
|
||||
fpi_image_device_report_finger_status (dev,
|
||||
@@ -276,7 +277,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
|
||||
default:
|
||||
/* some error happened, cancel scan */
|
||||
fp_err ("something bad happened, stop scan\n");
|
||||
fp_err ("something bad happened, stop scan");
|
||||
fpi_image_device_retry_scan (dev,
|
||||
FP_DEVICE_RETRY);
|
||||
fpi_image_device_report_finger_status (dev,
|
||||
@@ -307,7 +308,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
upektc_img_process_image_frame (self->image_bits + self->image_size,
|
||||
data);
|
||||
BUG_ON (self->image_size != IMAGE_SIZE);
|
||||
fp_dbg ("Image size is %lu\n",
|
||||
fp_dbg ("Image size is %lu",
|
||||
self->image_size);
|
||||
img = fp_image_new (IMAGE_WIDTH, IMAGE_HEIGHT);
|
||||
img->flags |= FPI_IMAGE_PARTIAL;
|
||||
@@ -320,7 +321,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
break;
|
||||
|
||||
default:
|
||||
fp_err ("Unknown response!\n");
|
||||
fp_err ("Unknown response!");
|
||||
fpi_ssm_mark_failed (transfer->ssm, fpi_device_error_new (FP_DEVICE_ERROR_GENERAL));
|
||||
break;
|
||||
}
|
||||
@@ -331,7 +332,7 @@ capture_read_data_cb (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
break;
|
||||
|
||||
default:
|
||||
fp_err ("Not handled response!\n");
|
||||
fp_err ("Not handled response!");
|
||||
fpi_ssm_mark_failed (transfer->ssm, fpi_device_error_new (FP_DEVICE_ERROR_GENERAL));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,15 +527,6 @@ initsm_read_msg_response_cb (FpiSsm *ssm,
|
||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||
"Unexpected response subcommand"));
|
||||
}
|
||||
else if (seq != upekdev->seq)
|
||||
{
|
||||
fp_err ("expected response to cmd seq=%02x, got response to %02x "
|
||||
"in state %d", upekdev->seq, seq,
|
||||
fpi_ssm_get_cur_state (ssm));
|
||||
fpi_ssm_mark_failed (ssm,
|
||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||
"Unexpected sequence number in response"));
|
||||
}
|
||||
else
|
||||
{
|
||||
fpi_ssm_next_state (ssm);
|
||||
|
||||
@@ -412,18 +412,6 @@ dev_change_state (FpImageDevice *dev, FpiImageDeviceState state)
|
||||
{
|
||||
FpiDeviceUru4000 *self = FPI_DEVICE_URU4000 (dev);
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case FPI_IMAGE_DEVICE_STATE_INACTIVE:
|
||||
case FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON:
|
||||
case FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF:
|
||||
case FPI_IMAGE_DEVICE_STATE_CAPTURE:
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
self->activate_state = state;
|
||||
if (self->img_transfer != NULL)
|
||||
return;
|
||||
@@ -663,7 +651,11 @@ imaging_run_state (FpiSsm *ssm, FpDevice *_dev)
|
||||
case IMAGING_CAPTURE:
|
||||
self->img_lines_done = 0;
|
||||
self->img_block = 0;
|
||||
fpi_usb_transfer_submit (self->img_transfer, 0, NULL, image_transfer_cb, NULL);
|
||||
fpi_usb_transfer_submit (fpi_usb_transfer_ref (self->img_transfer),
|
||||
0,
|
||||
NULL,
|
||||
image_transfer_cb,
|
||||
NULL);
|
||||
|
||||
break;
|
||||
|
||||
@@ -723,7 +715,7 @@ imaging_run_state (FpiSsm *ssm, FpDevice *_dev)
|
||||
num_lines);
|
||||
if (flags & BLOCKF_CHANGE_KEY)
|
||||
{
|
||||
fp_dbg ("changing encryption keys.\n");
|
||||
fp_dbg ("changing encryption keys.");
|
||||
img->block_info[self->img_block].flags &= ~BLOCKF_CHANGE_KEY;
|
||||
img->key_number++;
|
||||
self->img_enc_seed = rand ();
|
||||
@@ -799,8 +791,7 @@ imaging_complete (FpiSsm *ssm, FpDevice *dev, GError *error)
|
||||
if (error)
|
||||
fpi_image_device_session_error (FP_IMAGE_DEVICE (dev), error);
|
||||
|
||||
/* Freed by callback or cancellation */
|
||||
self->img_transfer = NULL;
|
||||
g_clear_pointer (&self->img_transfer, fpi_usb_transfer_unref);
|
||||
|
||||
g_free (self->img_data);
|
||||
self->img_data = NULL;
|
||||
@@ -1182,7 +1173,10 @@ deactivate_write_reg_cb (FpiUsbTransfer *transfer, FpDevice *dev,
|
||||
static void
|
||||
dev_deactivate (FpImageDevice *dev)
|
||||
{
|
||||
dev_change_state (dev, FPI_IMAGE_DEVICE_STATE_INACTIVE);
|
||||
/* This is started/handled by execute_state_change in order to delay the
|
||||
* action until after the image transfer has completed.
|
||||
* We just need to override the function so that the complete handler is
|
||||
* not called automatically. */
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1193,7 +1187,7 @@ execute_state_change (FpImageDevice *dev)
|
||||
|
||||
switch (self->activate_state)
|
||||
{
|
||||
case FPI_IMAGE_DEVICE_STATE_INACTIVE:
|
||||
case FPI_IMAGE_DEVICE_STATE_DEACTIVATING:
|
||||
fp_dbg ("deactivating");
|
||||
self->irq_cb = NULL;
|
||||
self->irq_cb_data = NULL;
|
||||
@@ -1248,6 +1242,12 @@ execute_state_change (FpImageDevice *dev)
|
||||
write_reg (dev, REG_MODE, MODE_AWAIT_FINGER_OFF,
|
||||
change_state_write_reg_cb, NULL);
|
||||
break;
|
||||
|
||||
/* Ignored states */
|
||||
case FPI_IMAGE_DEVICE_STATE_IDLE:
|
||||
case FPI_IMAGE_DEVICE_STATE_ACTIVATING:
|
||||
case FPI_IMAGE_DEVICE_STATE_INACTIVE:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ async_write_callback (FpiUsbTransfer *transfer, FpDevice *device,
|
||||
}
|
||||
|
||||
/* Send data to EP1, the only out endpoint */
|
||||
FP_GNUC_ACCESS (read_only, 3, 4)
|
||||
static void
|
||||
async_write (FpiSsm *ssm,
|
||||
FpDevice *dev,
|
||||
|
||||
@@ -147,18 +147,6 @@ m_loop_state (FpiSsm *ssm, FpDevice *_dev)
|
||||
}
|
||||
}
|
||||
|
||||
/* Complete loop sequential state machine */
|
||||
static void
|
||||
m_loop_complete (FpiSsm *ssm, FpDevice *_dev, GError *error)
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
g_warning ("State machine completed with an error: %s", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
/* Free sequential state machine */
|
||||
}
|
||||
|
||||
/* Exec init sequential state machine */
|
||||
static void
|
||||
m_init_state (FpiSsm *ssm, FpDevice *_dev)
|
||||
@@ -176,19 +164,7 @@ m_init_state (FpiSsm *ssm, FpDevice *_dev)
|
||||
static void
|
||||
m_init_complete (FpiSsm *ssm, FpDevice *dev, GError *error)
|
||||
{
|
||||
FpiSsm *ssm_loop;
|
||||
|
||||
fpi_image_device_activate_complete (FP_IMAGE_DEVICE (dev), error);
|
||||
if (!error)
|
||||
{
|
||||
/* Notify activate complete */
|
||||
|
||||
/* Start loop ssm */
|
||||
ssm_loop = fpi_ssm_new (dev, m_loop_state, M_LOOP_NUM_STATES);
|
||||
fpi_ssm_start (ssm_loop, m_loop_complete);
|
||||
}
|
||||
|
||||
/* Free sequential state machine */
|
||||
}
|
||||
|
||||
/* Activate device */
|
||||
@@ -213,6 +189,19 @@ dev_deactivate (FpImageDevice *dev)
|
||||
fpi_image_device_deactivate_complete (dev, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
dev_change_state (FpImageDevice *dev, FpiImageDeviceState state)
|
||||
{
|
||||
FpiSsm *ssm_loop;
|
||||
|
||||
if (state != FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON)
|
||||
return;
|
||||
|
||||
/* Start a capture operation. */
|
||||
ssm_loop = fpi_ssm_new (FP_DEVICE (dev), m_loop_state, M_LOOP_NUM_STATES);
|
||||
fpi_ssm_start (ssm_loop, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
dev_open (FpImageDevice *dev)
|
||||
{
|
||||
@@ -273,6 +262,7 @@ fpi_device_vfs301_class_init (FpDeviceVfs301Class *klass)
|
||||
img_class->img_close = dev_close;
|
||||
img_class->activate = dev_activate;
|
||||
img_class->deactivate = dev_deactivate;
|
||||
img_class->change_state = dev_change_state;
|
||||
|
||||
img_class->bz3_threshold = 24;
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ usb_recv (FpDeviceVfs301 *dev, guint8 endpoint, int max_bytes, FpiUsbTransfer **
|
||||
*out = g_steal_pointer (&transfer);
|
||||
}
|
||||
|
||||
FP_GNUC_ACCESS (read_only, 2, 3)
|
||||
static void
|
||||
usb_send (FpDeviceVfs301 *dev, const guint8 *data, gssize length, GError **error)
|
||||
{
|
||||
@@ -212,11 +213,9 @@ vfs301_proto_generate (int type, int subtype, gssize *len)
|
||||
*len = 1;
|
||||
return data;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x0B:
|
||||
return vfs301_proto_generate_0B (subtype, len);
|
||||
break;
|
||||
|
||||
case 0x02D0:
|
||||
{
|
||||
@@ -232,22 +231,18 @@ vfs301_proto_generate (int type, int subtype, gssize *len)
|
||||
g_assert ((int) subtype <= G_N_ELEMENTS (dataLs));
|
||||
return translate_str (dataLs[subtype - 1], len);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x0220:
|
||||
switch (subtype)
|
||||
{
|
||||
case 1:
|
||||
return translate_str (vfs301_0220_01, len);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
return translate_str (vfs301_0220_02, len);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
return translate_str (vfs301_0220_03, len);
|
||||
break;
|
||||
|
||||
case 0xFA00:
|
||||
case 0x2C01:
|
||||
@@ -270,7 +265,6 @@ vfs301_proto_generate (int type, int subtype, gssize *len)
|
||||
field[3] = field[1];
|
||||
|
||||
return data;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
@@ -508,30 +502,30 @@ vfs301_proto_process_event_cb (FpiUsbTransfer *transfer,
|
||||
FpDevice *device,
|
||||
gpointer user_data, GError *error)
|
||||
{
|
||||
FpDeviceVfs301 *dev = user_data;
|
||||
FpDeviceVfs301 *self = FPI_DEVICE_VFS301 (device);
|
||||
|
||||
if (error)
|
||||
{
|
||||
g_warning ("Error receiving data: %s", error->message);
|
||||
g_error_free (error);
|
||||
dev->recv_progress = VFS301_FAILURE;
|
||||
self->recv_progress = VFS301_FAILURE;
|
||||
return;
|
||||
}
|
||||
else if (transfer->actual_length < transfer->length)
|
||||
{
|
||||
/* TODO: process the data anyway? */
|
||||
dev->recv_progress = VFS301_ENDED;
|
||||
self->recv_progress = VFS301_ENDED;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
FpiUsbTransfer *new;
|
||||
if (!vfs301_proto_process_data (dev,
|
||||
if (!vfs301_proto_process_data (self,
|
||||
transfer->length == VFS301_FP_RECV_LEN_1,
|
||||
transfer->buffer,
|
||||
transfer->actual_length))
|
||||
{
|
||||
dev->recv_progress = VFS301_ENDED;
|
||||
self->recv_progress = VFS301_ENDED;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -815,13 +815,11 @@ dev_close (FpImageDevice *dev)
|
||||
GError *error = NULL;
|
||||
FpDeviceVfs5011 *self = FPI_DEVICE_VFS5011 (dev);
|
||||
|
||||
;
|
||||
|
||||
g_usb_device_release_interface (fpi_device_get_usb_device (FP_DEVICE (dev)),
|
||||
0, 0, &error);
|
||||
|
||||
g_free (self->capture_buffer);
|
||||
g_slist_free_full (self->rows, g_free);
|
||||
g_slist_free_full (g_steal_pointer (&self->rows), g_free);
|
||||
|
||||
fpi_image_device_close_complete (dev, error);
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ struct _FpDeviceVirtualImage
|
||||
|
||||
GSocketListener *listener;
|
||||
GSocketConnection *connection;
|
||||
GCancellable *listen_cancellable;
|
||||
GCancellable *cancellable;
|
||||
|
||||
gint socket_fd;
|
||||
@@ -72,14 +73,21 @@ recv_image_img_recv_cb (GObject *source_object,
|
||||
|
||||
success = g_input_stream_read_all_finish (G_INPUT_STREAM (source_object), res, &bytes, &error);
|
||||
|
||||
if (!success || bytes == 0)
|
||||
/* Can't use self if the operation was cancelled. */
|
||||
if (!success && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
return;
|
||||
|
||||
self = FPI_DEVICE_VIRTUAL_IMAGE (user_data);
|
||||
device = FP_IMAGE_DEVICE (self);
|
||||
|
||||
/* Consider success if we received the right amount of data, otherwise
|
||||
* an error must have happened. */
|
||||
if (bytes < self->recv_img->width * self->recv_img->height)
|
||||
{
|
||||
if (!success)
|
||||
{
|
||||
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
return;
|
||||
g_warning ("Error receiving header for image data: %s", error->message);
|
||||
}
|
||||
g_warning ("Error receiving image data: %s", error->message);
|
||||
else
|
||||
g_warning ("Error receiving image data: end of stream before all data was read");
|
||||
|
||||
self = FPI_DEVICE_VIRTUAL_IMAGE (user_data);
|
||||
g_io_stream_close (G_IO_STREAM (self->connection), NULL, NULL);
|
||||
@@ -87,9 +95,6 @@ recv_image_img_recv_cb (GObject *source_object,
|
||||
return;
|
||||
}
|
||||
|
||||
self = FPI_DEVICE_VIRTUAL_IMAGE (user_data);
|
||||
device = FP_IMAGE_DEVICE (self);
|
||||
|
||||
if (self->automatic_finger)
|
||||
fpi_image_device_report_finger_status (device, TRUE);
|
||||
fpi_image_device_image_captured (device, g_steal_pointer (&self->recv_img));
|
||||
@@ -112,7 +117,7 @@ recv_image_hdr_recv_cb (GObject *source_object,
|
||||
|
||||
success = g_input_stream_read_all_finish (G_INPUT_STREAM (source_object), res, &bytes, &error);
|
||||
|
||||
if (!success || bytes == 0)
|
||||
if (!success || bytes != sizeof (self->recv_img_hdr))
|
||||
{
|
||||
if (!success)
|
||||
{
|
||||
@@ -121,6 +126,10 @@ recv_image_hdr_recv_cb (GObject *source_object,
|
||||
return;
|
||||
g_warning ("Error receiving header for image data: %s", error->message);
|
||||
}
|
||||
else if (bytes != 0)
|
||||
{
|
||||
g_warning ("Received incomplete header before end of stream.");
|
||||
}
|
||||
|
||||
self = FPI_DEVICE_VIRTUAL_IMAGE (user_data);
|
||||
g_io_stream_close (G_IO_STREAM (self->connection), NULL, NULL);
|
||||
@@ -162,6 +171,11 @@ recv_image_hdr_recv_cb (GObject *source_object,
|
||||
!!self->recv_img_hdr[1]);
|
||||
break;
|
||||
|
||||
case -5:
|
||||
/* -5 causes the device to disappear (no further data) */
|
||||
fpi_device_remove (FP_DEVICE (self));
|
||||
break;
|
||||
|
||||
default:
|
||||
/* disconnect client, it didn't play fair */
|
||||
g_io_stream_close (G_IO_STREAM (self->connection), NULL, NULL);
|
||||
@@ -185,15 +199,25 @@ recv_image_hdr_recv_cb (GObject *source_object,
|
||||
}
|
||||
|
||||
static void
|
||||
recv_image (FpDeviceVirtualImage *dev, GInputStream *stream)
|
||||
recv_image (FpDeviceVirtualImage *self, GInputStream *stream)
|
||||
{
|
||||
g_input_stream_read_all_async (stream,
|
||||
dev->recv_img_hdr,
|
||||
sizeof (dev->recv_img_hdr),
|
||||
G_PRIORITY_DEFAULT,
|
||||
dev->cancellable,
|
||||
recv_image_hdr_recv_cb,
|
||||
dev);
|
||||
FpiImageDeviceState state;
|
||||
|
||||
g_object_get (self, "fpi-image-device-state", &state, NULL);
|
||||
|
||||
g_debug ("Starting image receive (if active), state is: %i", state);
|
||||
|
||||
/* Only register if the state is active. */
|
||||
if (state >= FPI_IMAGE_DEVICE_STATE_IDLE)
|
||||
{
|
||||
g_input_stream_read_all_async (stream,
|
||||
self->recv_img_hdr,
|
||||
sizeof (self->recv_img_hdr),
|
||||
G_PRIORITY_DEFAULT,
|
||||
self->cancellable,
|
||||
recv_image_hdr_recv_cb,
|
||||
self);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -217,11 +241,25 @@ new_connection_cb (GObject *source_object, GAsyncResult *res, gpointer user_data
|
||||
start_listen (dev);
|
||||
}
|
||||
|
||||
/* Always further connections (but we disconnect them immediately
|
||||
/* Always accept further connections (but we disconnect them immediately
|
||||
* if we already have a connection). */
|
||||
start_listen (dev);
|
||||
|
||||
if (dev->connection)
|
||||
{
|
||||
/* We may not have noticed that the stream was closed,
|
||||
* if the device is deactivated.
|
||||
* Cancel any ongoing operation on the old connection. */
|
||||
g_cancellable_cancel (dev->cancellable);
|
||||
g_clear_object (&dev->cancellable);
|
||||
dev->cancellable = g_cancellable_new ();
|
||||
|
||||
g_clear_object (&dev->connection);
|
||||
}
|
||||
|
||||
if (dev->connection)
|
||||
{
|
||||
g_warning ("Rejecting new connection");
|
||||
g_io_stream_close (G_IO_STREAM (connection), NULL, NULL);
|
||||
g_object_unref (connection);
|
||||
return;
|
||||
@@ -231,16 +269,15 @@ new_connection_cb (GObject *source_object, GAsyncResult *res, gpointer user_data
|
||||
dev->automatic_finger = TRUE;
|
||||
stream = g_io_stream_get_input_stream (G_IO_STREAM (connection));
|
||||
|
||||
recv_image (dev, stream);
|
||||
|
||||
fp_dbg ("Got a new connection!");
|
||||
recv_image (dev, stream);
|
||||
}
|
||||
|
||||
static void
|
||||
start_listen (FpDeviceVirtualImage *dev)
|
||||
{
|
||||
g_socket_listener_accept_async (dev->listener,
|
||||
dev->cancellable,
|
||||
dev->listen_cancellable,
|
||||
new_connection_cb,
|
||||
dev);
|
||||
}
|
||||
@@ -285,10 +322,12 @@ dev_init (FpImageDevice *dev)
|
||||
|
||||
self->listener = g_steal_pointer (&listener);
|
||||
self->cancellable = g_cancellable_new ();
|
||||
self->listen_cancellable = g_cancellable_new ();
|
||||
|
||||
start_listen (self);
|
||||
|
||||
fpi_image_device_open_complete (dev, NULL);
|
||||
/* Delay result to open up the possibility of testing race conditions. */
|
||||
fpi_device_add_timeout (FP_DEVICE (dev), 100, (FpTimeoutFunc) fpi_image_device_open_complete, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -299,16 +338,70 @@ dev_deinit (FpImageDevice *dev)
|
||||
G_DEBUG_HERE ();
|
||||
|
||||
g_cancellable_cancel (self->cancellable);
|
||||
g_cancellable_cancel (self->listen_cancellable);
|
||||
g_clear_object (&self->cancellable);
|
||||
g_clear_object (&self->listen_cancellable);
|
||||
g_clear_object (&self->listener);
|
||||
g_clear_object (&self->connection);
|
||||
|
||||
fpi_image_device_close_complete (dev, NULL);
|
||||
/* Delay result to open up the possibility of testing race conditions. */
|
||||
fpi_device_add_timeout (FP_DEVICE (dev), 100, (FpTimeoutFunc) fpi_image_device_close_complete, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
dev_activate (FpImageDevice *dev)
|
||||
{
|
||||
FpDeviceVirtualImage *self = FPI_DEVICE_VIRTUAL_IMAGE (dev);
|
||||
|
||||
fpi_image_device_activate_complete (dev, NULL);
|
||||
|
||||
if (self->connection)
|
||||
recv_image (self, g_io_stream_get_input_stream (G_IO_STREAM (self->connection)));
|
||||
}
|
||||
|
||||
static void
|
||||
dev_deactivate (FpImageDevice *dev)
|
||||
{
|
||||
FpDeviceVirtualImage *self = FPI_DEVICE_VIRTUAL_IMAGE (dev);
|
||||
|
||||
g_cancellable_cancel (self->cancellable);
|
||||
g_clear_object (&self->cancellable);
|
||||
self->cancellable = g_cancellable_new ();
|
||||
|
||||
/* XXX: Need to wait for the operation to be cancelled. */
|
||||
fpi_device_add_timeout (FP_DEVICE (dev), 10, (FpTimeoutFunc) fpi_image_device_deactivate_complete, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
dev_notify_removed_cb (FpDevice *dev)
|
||||
{
|
||||
FpiImageDeviceState state;
|
||||
gboolean removed;
|
||||
|
||||
g_object_get (dev,
|
||||
"fpi-image-device-state", &state,
|
||||
"removed", &removed,
|
||||
NULL);
|
||||
|
||||
if (!removed || state == FPI_IMAGE_DEVICE_STATE_INACTIVE)
|
||||
return;
|
||||
|
||||
/* This error will be converted to an FP_DEVICE_ERROR_REMOVED by the
|
||||
* surrounding layers. */
|
||||
fpi_image_device_session_error (FP_IMAGE_DEVICE (dev),
|
||||
fpi_device_error_new (FP_DEVICE_ERROR_PROTO));
|
||||
}
|
||||
|
||||
static void
|
||||
fpi_device_virtual_image_init (FpDeviceVirtualImage *self)
|
||||
{
|
||||
/* NOTE: This is not nice, but we can generally rely on the underlying
|
||||
* system to throw errors on the transport layer.
|
||||
*/
|
||||
g_signal_connect (self,
|
||||
"notify::removed",
|
||||
G_CALLBACK (dev_notify_removed_cb),
|
||||
NULL);
|
||||
}
|
||||
|
||||
static const FpIdEntry driver_ids[] = {
|
||||
@@ -329,4 +422,7 @@ fpi_device_virtual_image_class_init (FpDeviceVirtualImageClass *klass)
|
||||
|
||||
img_class->img_open = dev_init;
|
||||
img_class->img_close = dev_deinit;
|
||||
|
||||
img_class->activate = dev_activate;
|
||||
img_class->deactivate = dev_deactivate;
|
||||
}
|
||||
|
||||
@@ -86,6 +86,60 @@ is_driver_allowed (const gchar *driver)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FpContext *context;
|
||||
FpDevice *device;
|
||||
} RemoveDeviceData;
|
||||
|
||||
static gboolean
|
||||
remove_device_idle_cb (RemoveDeviceData *data)
|
||||
{
|
||||
FpContextPrivate *priv = fp_context_get_instance_private (data->context);
|
||||
guint idx = 0;
|
||||
|
||||
g_return_val_if_fail (g_ptr_array_find (priv->devices, data->device, &idx), G_SOURCE_REMOVE);
|
||||
|
||||
g_signal_emit (data->context, signals[DEVICE_REMOVED_SIGNAL], 0, data->device);
|
||||
g_ptr_array_remove_index_fast (priv->devices, idx);
|
||||
|
||||
g_free (data);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
remove_device (FpContext *context, FpDevice *device)
|
||||
{
|
||||
RemoveDeviceData *data;
|
||||
|
||||
data = g_new (RemoveDeviceData, 1);
|
||||
data->context = context;
|
||||
data->device = device;
|
||||
|
||||
g_idle_add ((GSourceFunc) remove_device_idle_cb, data);
|
||||
}
|
||||
|
||||
static void
|
||||
device_remove_on_notify_open_cb (FpContext *context, GParamSpec *pspec, FpDevice *device)
|
||||
{
|
||||
remove_device (context, device);
|
||||
}
|
||||
|
||||
static void
|
||||
device_removed_cb (FpContext *context, FpDevice *device)
|
||||
{
|
||||
gboolean open = FALSE;
|
||||
|
||||
g_object_get (device, "open", &open, NULL);
|
||||
|
||||
/* Wait for device close if the device is currently still open. */
|
||||
if (open)
|
||||
g_signal_connect_swapped (device, "notify::open", (GCallback) device_remove_on_notify_open_cb, context);
|
||||
else
|
||||
remove_device (context, device);
|
||||
}
|
||||
|
||||
static void
|
||||
async_device_init_done_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
@@ -110,6 +164,9 @@ async_device_init_done_cb (GObject *source_object, GAsyncResult *res, gpointer u
|
||||
}
|
||||
|
||||
g_ptr_array_add (priv->devices, device);
|
||||
|
||||
g_signal_connect_swapped (device, "removed", (GCallback) device_removed_cb, context);
|
||||
|
||||
g_signal_emit (context, signals[DEVICE_ADDED_SIGNAL], 0, device);
|
||||
}
|
||||
|
||||
@@ -189,12 +246,7 @@ usb_device_removed_cb (FpContext *self, GUsbDevice *device, GUsbContext *usb_ctx
|
||||
continue;
|
||||
|
||||
if (fpi_device_get_usb_device (dev) == device)
|
||||
{
|
||||
g_signal_emit (self, signals[DEVICE_REMOVED_SIGNAL], 0, dev);
|
||||
g_ptr_array_remove_index_fast (priv->devices, i);
|
||||
|
||||
return;
|
||||
}
|
||||
fpi_device_remove (dev);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,7 +262,8 @@ fp_context_finalize (GObject *object)
|
||||
g_clear_object (&priv->cancellable);
|
||||
g_clear_pointer (&priv->drivers, g_array_unref);
|
||||
|
||||
g_object_run_dispose (G_OBJECT (priv->usb_ctx));
|
||||
if (priv->usb_ctx)
|
||||
g_object_run_dispose (G_OBJECT (priv->usb_ctx));
|
||||
g_clear_object (&priv->usb_ctx);
|
||||
|
||||
G_OBJECT_CLASS (fp_context_parent_class)->finalize (object);
|
||||
@@ -247,6 +300,10 @@ fp_context_class_init (FpContextClass *klass)
|
||||
* @device: A #FpDevice
|
||||
*
|
||||
* This signal is emitted when a fingerprint reader is removed.
|
||||
*
|
||||
* It is guaranteed that the device has been closed before this signal
|
||||
* is emitted. See the #FpDevice removed signal documentation for more
|
||||
* information.
|
||||
**/
|
||||
signals[DEVICE_REMOVED_SIGNAL] = g_signal_new ("device-removed",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
@@ -289,7 +346,7 @@ fp_context_init (FpContext *self)
|
||||
priv->usb_ctx = g_usb_context_new (&error);
|
||||
if (!priv->usb_ctx)
|
||||
{
|
||||
fp_warn ("Could not initialise USB Subsystem: %s", error->message);
|
||||
g_message ("Could not initialise USB Subsystem: %s", error->message);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -342,7 +399,8 @@ fp_context_enumerate (FpContext *context)
|
||||
priv->enumerated = TRUE;
|
||||
|
||||
/* USB devices are handled from callbacks */
|
||||
g_usb_context_enumerate (priv->usb_ctx);
|
||||
if (priv->usb_ctx)
|
||||
g_usb_context_enumerate (priv->usb_ctx);
|
||||
|
||||
/* Handle Virtual devices based on environment variables */
|
||||
for (i = 0; i < priv->drivers->len; i++)
|
||||
|
||||
@@ -29,6 +29,7 @@ typedef struct
|
||||
GUsbDevice *usb_device;
|
||||
const gchar *virtual_env;
|
||||
|
||||
gboolean is_removed;
|
||||
gboolean is_open;
|
||||
|
||||
gchar *device_id;
|
||||
@@ -49,7 +50,8 @@ typedef struct
|
||||
GSource *current_task_idle_return_source;
|
||||
|
||||
/* State for tasks */
|
||||
gboolean wait_for_finger;
|
||||
gboolean wait_for_finger;
|
||||
FpFingerStatusFlags finger_status;
|
||||
} FpDevicePrivate;
|
||||
|
||||
|
||||
|
||||
@@ -44,8 +44,10 @@ enum {
|
||||
PROP_DEVICE_ID,
|
||||
PROP_NAME,
|
||||
PROP_OPEN,
|
||||
PROP_REMOVED,
|
||||
PROP_NR_ENROLL_STAGES,
|
||||
PROP_SCAN_TYPE,
|
||||
PROP_FINGER_STATUS,
|
||||
PROP_FPI_ENVIRON,
|
||||
PROP_FPI_USB_DEVICE,
|
||||
PROP_FPI_DRIVER_DATA,
|
||||
@@ -54,6 +56,13 @@ enum {
|
||||
|
||||
static GParamSpec *properties[N_PROPS];
|
||||
|
||||
enum {
|
||||
REMOVED_SIGNAL,
|
||||
N_SIGNALS
|
||||
};
|
||||
|
||||
static guint signals[N_SIGNALS] = { 0, };
|
||||
|
||||
/**
|
||||
* fp_device_retry_quark:
|
||||
*
|
||||
@@ -84,6 +93,8 @@ fp_device_cancel_in_idle_cb (gpointer user_data)
|
||||
|
||||
cls->cancel (self);
|
||||
|
||||
fpi_device_report_finger_status (self, FP_FINGER_STATUS_NONE);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
@@ -181,6 +192,10 @@ fp_device_get_property (GObject *object,
|
||||
g_value_set_enum (value, priv->scan_type);
|
||||
break;
|
||||
|
||||
case PROP_FINGER_STATUS:
|
||||
g_value_set_flags (value, priv->finger_status);
|
||||
break;
|
||||
|
||||
case PROP_DRIVER:
|
||||
g_value_set_static_string (value, FP_DEVICE_GET_CLASS (priv)->id);
|
||||
break;
|
||||
@@ -197,6 +212,10 @@ fp_device_get_property (GObject *object,
|
||||
g_value_set_boolean (value, priv->is_open);
|
||||
break;
|
||||
|
||||
case PROP_REMOVED:
|
||||
g_value_set_boolean (value, priv->is_removed);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
@@ -310,6 +329,13 @@ fp_device_class_init (FpDeviceClass *klass)
|
||||
FP_TYPE_SCAN_TYPE, FP_SCAN_TYPE_SWIPE,
|
||||
G_PARAM_STATIC_STRINGS | G_PARAM_READABLE);
|
||||
|
||||
properties[PROP_FINGER_STATUS] =
|
||||
g_param_spec_flags ("finger-status",
|
||||
"FingerStatus",
|
||||
"The status of the finger",
|
||||
FP_TYPE_FINGER_STATUS_FLAGS, FP_FINGER_STATUS_NONE,
|
||||
G_PARAM_STATIC_STRINGS | G_PARAM_READABLE);
|
||||
|
||||
properties[PROP_DRIVER] =
|
||||
g_param_spec_string ("driver",
|
||||
"Driver",
|
||||
@@ -337,6 +363,41 @@ fp_device_class_init (FpDeviceClass *klass)
|
||||
"Whether the device is open or not", FALSE,
|
||||
G_PARAM_STATIC_STRINGS | G_PARAM_READABLE);
|
||||
|
||||
properties[PROP_REMOVED] =
|
||||
g_param_spec_boolean ("removed",
|
||||
"Removed",
|
||||
"Whether the device has been removed from the system", FALSE,
|
||||
G_PARAM_STATIC_STRINGS | G_PARAM_READABLE);
|
||||
|
||||
/**
|
||||
* FpDevice::removed:
|
||||
* @device: the #FpDevice instance that emitted the signal
|
||||
*
|
||||
* This signal is emitted after the device has been removed and no operation
|
||||
* is pending anymore.
|
||||
*
|
||||
* The API user is still required to close a removed device. The above
|
||||
* guarantee means that the call to close the device can be made immediately
|
||||
* from the signal handler.
|
||||
*
|
||||
* The close operation will return FP_DEVICE_ERROR_REMOVED, but the device
|
||||
* will still be considered closed afterwards.
|
||||
*
|
||||
* The device will only be removed from the #FpContext after it has been
|
||||
* closed by the API user.
|
||||
**/
|
||||
signals[REMOVED_SIGNAL] = g_signal_new ("removed",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE,
|
||||
0);
|
||||
|
||||
/* Private properties */
|
||||
|
||||
/**
|
||||
* FpDevice::fpi-environ: (skip)
|
||||
*
|
||||
@@ -469,6 +530,26 @@ fp_device_get_scan_type (FpDevice *device)
|
||||
return priv->scan_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* fp_device_get_finger_status:
|
||||
* @device: A #FpDevice
|
||||
*
|
||||
* Retrieves the finger status flags for the device.
|
||||
* This can be used by the UI to present the relevant feedback, although it
|
||||
* is not guaranteed to be a relevant value when not performing any action.
|
||||
*
|
||||
* Returns: The current #FpFingerStatusFlags
|
||||
*/
|
||||
FpFingerStatusFlags
|
||||
fp_device_get_finger_status (FpDevice *device)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
|
||||
g_return_val_if_fail (FP_IS_DEVICE (device), FP_FINGER_STATUS_NONE);
|
||||
|
||||
return priv->finger_status;
|
||||
}
|
||||
|
||||
/**
|
||||
* fp_device_get_nr_enroll_stages:
|
||||
* @device: A #FpDevice
|
||||
@@ -603,6 +684,7 @@ fp_device_open (FpDevice *device,
|
||||
priv->current_action = FPI_DEVICE_ACTION_OPEN;
|
||||
priv->current_task = g_steal_pointer (&task);
|
||||
maybe_cancel_on_cancelled (device, cancellable);
|
||||
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
|
||||
|
||||
FP_DEVICE_GET_CLASS (device)->open (device);
|
||||
}
|
||||
@@ -710,7 +792,7 @@ fp_device_close_finish (FpDevice *device,
|
||||
* in. The driver may make use of this metadata, when e.g. storing the print on
|
||||
* device memory. It is undefined whether this print is filled in by the driver
|
||||
* and returned, or whether the driver will return a newly created print after
|
||||
* enrollment successed.
|
||||
* enrollment succeeded.
|
||||
*/
|
||||
void
|
||||
fp_device_enroll (FpDevice *device,
|
||||
@@ -936,6 +1018,7 @@ fp_device_identify (FpDevice *device,
|
||||
g_autoptr(GTask) task = NULL;
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
FpMatchData *data;
|
||||
int i;
|
||||
|
||||
task = g_task_new (device, cancellable, callback, user_data);
|
||||
if (g_task_return_error_if_cancelled (task))
|
||||
@@ -960,7 +1043,13 @@ fp_device_identify (FpDevice *device,
|
||||
maybe_cancel_on_cancelled (device, cancellable);
|
||||
|
||||
data = g_new0 (FpMatchData, 1);
|
||||
data->gallery = g_ptr_array_ref (prints);
|
||||
/* We cannot store the gallery directly, because the ptr array may not own
|
||||
* a reference to each print. Also, the caller could in principle modify the
|
||||
* GPtrArray afterwards.
|
||||
*/
|
||||
data->gallery = g_ptr_array_new_full (prints->len, g_object_unref);
|
||||
for (i = 0; i < prints->len; i++)
|
||||
g_ptr_array_add (data->gallery, g_object_ref (g_ptr_array_index (prints, i)));
|
||||
data->match_cb = match_cb;
|
||||
data->match_data = match_data;
|
||||
data->match_destroy = match_destroy;
|
||||
|
||||
@@ -90,6 +90,8 @@ typedef enum {
|
||||
* @FP_DEVICE_ERROR_DATA_INVALID: The passed data is invalid
|
||||
* @FP_DEVICE_ERROR_DATA_NOT_FOUND: Requested print was not found on device
|
||||
* @FP_DEVICE_ERROR_DATA_FULL: No space on device available for operation
|
||||
* @FP_DEVICE_ERROR_DATA_DUPLICATE: Enrolling template duplicates storaged templates
|
||||
* @FP_DEVICE_ERROR_REMOVED: The device has been removed.
|
||||
*
|
||||
* Error codes for device operations. More specific errors from other domains
|
||||
* such as #G_IO_ERROR or #G_USB_DEVICE_ERROR may also be reported.
|
||||
@@ -104,6 +106,9 @@ typedef enum {
|
||||
FP_DEVICE_ERROR_DATA_INVALID,
|
||||
FP_DEVICE_ERROR_DATA_NOT_FOUND,
|
||||
FP_DEVICE_ERROR_DATA_FULL,
|
||||
FP_DEVICE_ERROR_DATA_DUPLICATE,
|
||||
/* Leave some room to add more DATA related errors */
|
||||
FP_DEVICE_ERROR_REMOVED = 0x100,
|
||||
} FpDeviceError;
|
||||
|
||||
GQuark fp_device_retry_quark (void);
|
||||
@@ -168,6 +173,7 @@ const gchar *fp_device_get_device_id (FpDevice *device);
|
||||
const gchar *fp_device_get_name (FpDevice *device);
|
||||
gboolean fp_device_is_open (FpDevice *device);
|
||||
FpScanType fp_device_get_scan_type (FpDevice *device);
|
||||
FpFingerStatusFlags fp_device_get_finger_status (FpDevice *device);
|
||||
gint fp_device_get_nr_enroll_stages (FpDevice *device);
|
||||
|
||||
gboolean fp_device_supports_identify (FpDevice *device);
|
||||
|
||||
@@ -27,17 +27,19 @@ typedef struct
|
||||
{
|
||||
FpiImageDeviceState state;
|
||||
gboolean active;
|
||||
gboolean cancelling;
|
||||
|
||||
gboolean enroll_await_on_pending;
|
||||
gboolean finger_present;
|
||||
|
||||
gint enroll_stage;
|
||||
|
||||
guint pending_activation_timeout_id;
|
||||
gboolean pending_activation_timeout_waiting_finger_off;
|
||||
gboolean minutiae_scan_active;
|
||||
GError *action_error;
|
||||
FpImage *capture_image;
|
||||
|
||||
gint bz3_threshold;
|
||||
} FpImageDevicePrivate;
|
||||
|
||||
|
||||
void fpi_image_device_activate (FpImageDevice *image_device);
|
||||
void fpi_image_device_deactivate (FpImageDevice *image_device);
|
||||
void fpi_image_device_deactivate (FpImageDevice *image_device,
|
||||
gboolean cancelling);
|
||||
|
||||
@@ -56,44 +56,6 @@ static guint signals[LAST_SIGNAL] = { 0 };
|
||||
* - sanitize_image seems a bit odd, in particular the sizing stuff.
|
||||
**/
|
||||
|
||||
/* Static helper functions */
|
||||
|
||||
static gboolean
|
||||
pending_activation_timeout (gpointer user_data)
|
||||
{
|
||||
FpImageDevice *self = FP_IMAGE_DEVICE (user_data);
|
||||
FpDevice *device = FP_DEVICE (self);
|
||||
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
|
||||
FpiDeviceAction action = fpi_device_get_current_action (device);
|
||||
GError *error;
|
||||
|
||||
priv->pending_activation_timeout_id = 0;
|
||||
|
||||
if (priv->pending_activation_timeout_waiting_finger_off)
|
||||
error = fpi_device_retry_new_msg (FP_DEVICE_RETRY_REMOVE_FINGER,
|
||||
"Remove finger before requesting another scan operation");
|
||||
else
|
||||
error = fpi_device_retry_new (FP_DEVICE_RETRY_GENERAL);
|
||||
|
||||
if (action == FPI_DEVICE_ACTION_VERIFY)
|
||||
{
|
||||
fpi_device_verify_report (device, FPI_MATCH_ERROR, NULL, error);
|
||||
fpi_device_verify_complete (device, NULL);
|
||||
}
|
||||
else if (action == FPI_DEVICE_ACTION_IDENTIFY)
|
||||
{
|
||||
fpi_device_identify_report (device, NULL, NULL, error);
|
||||
fpi_device_identify_complete (device, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Can this happen for enroll? */
|
||||
fpi_device_action_error (device, error);
|
||||
}
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
/* Callbacks/vfuncs */
|
||||
static void
|
||||
fp_image_device_open (FpDevice *device)
|
||||
@@ -112,26 +74,14 @@ fp_image_device_close (FpDevice *device)
|
||||
FpImageDeviceClass *cls = FP_IMAGE_DEVICE_GET_CLASS (self);
|
||||
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
|
||||
|
||||
/* In the close case we may need to wait/force deactivation first.
|
||||
* Three possible cases:
|
||||
* 1. We are inactive
|
||||
* -> immediately close
|
||||
* 2. We are waiting for finger off
|
||||
* -> immediately deactivate
|
||||
* 3. We are deactivating
|
||||
* -> handled by deactivate_complete */
|
||||
|
||||
if (!priv->active)
|
||||
cls->img_close (self);
|
||||
else if (priv->state != FPI_IMAGE_DEVICE_STATE_INACTIVE)
|
||||
fpi_image_device_deactivate (self);
|
||||
g_assert (priv->active == FALSE);
|
||||
cls->img_close (self);
|
||||
}
|
||||
|
||||
static void
|
||||
fp_image_device_cancel_action (FpDevice *device)
|
||||
{
|
||||
FpImageDevice *self = FP_IMAGE_DEVICE (device);
|
||||
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
|
||||
FpiDeviceAction action;
|
||||
|
||||
action = fpi_device_get_current_action (device);
|
||||
@@ -142,17 +92,7 @@ fp_image_device_cancel_action (FpDevice *device)
|
||||
action == FPI_DEVICE_ACTION_VERIFY ||
|
||||
action == FPI_DEVICE_ACTION_IDENTIFY ||
|
||||
action == FPI_DEVICE_ACTION_CAPTURE)
|
||||
{
|
||||
priv->cancelling = TRUE;
|
||||
fpi_image_device_deactivate (self);
|
||||
priv->cancelling = FALSE;
|
||||
|
||||
/* XXX: Some nicer way of doing this would be good. */
|
||||
fpi_device_action_error (FP_DEVICE (self),
|
||||
g_error_new (G_IO_ERROR,
|
||||
G_IO_ERROR_CANCELLED,
|
||||
"Device operation was cancelled"));
|
||||
}
|
||||
fpi_image_device_deactivate (self, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -188,27 +128,9 @@ fp_image_device_start_capture_action (FpDevice *device)
|
||||
}
|
||||
|
||||
priv->enroll_stage = 0;
|
||||
priv->enroll_await_on_pending = FALSE;
|
||||
|
||||
/* The device might still be deactivating from a previous call.
|
||||
* In that situation, try to wait for a bit before reporting back an
|
||||
* error (which will usually say that the user should remove the
|
||||
* finger).
|
||||
*/
|
||||
if (priv->state != FPI_IMAGE_DEVICE_STATE_INACTIVE || priv->active)
|
||||
{
|
||||
g_debug ("Got a new request while the device was still active");
|
||||
g_assert (priv->pending_activation_timeout_id == 0);
|
||||
priv->pending_activation_timeout_id =
|
||||
g_timeout_add (100, pending_activation_timeout, device);
|
||||
|
||||
if (priv->state == FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF)
|
||||
priv->pending_activation_timeout_waiting_finger_off = TRUE;
|
||||
else
|
||||
priv->pending_activation_timeout_waiting_finger_off = FALSE;
|
||||
|
||||
return;
|
||||
}
|
||||
/* The internal state machine guarantees both of these. */
|
||||
g_assert (!priv->finger_present);
|
||||
g_assert (!priv->minutiae_scan_active);
|
||||
|
||||
/* And activate the device; we rely on fpi_image_device_activate_complete()
|
||||
* to be called when done (or immediately). */
|
||||
@@ -225,7 +147,6 @@ fp_image_device_finalize (GObject *object)
|
||||
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
|
||||
|
||||
g_assert (priv->active == FALSE);
|
||||
g_clear_handle_id (&priv->pending_activation_timeout_id, g_source_remove);
|
||||
|
||||
G_OBJECT_CLASS (fp_image_device_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <fp-device.h>
|
||||
#include "fp-device.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
@@ -281,7 +281,7 @@ fp_image_detect_minutiae_thread_func (GTask *task,
|
||||
gint map_w, map_h;
|
||||
gint bw, bh, bd;
|
||||
gint r;
|
||||
g_autofree LFSPARMS *lfsparms;
|
||||
g_autofree LFSPARMS *lfsparms = NULL;
|
||||
|
||||
/* Normalize the image first */
|
||||
if (data->flags & FPI_IMAGE_H_FLIPPED)
|
||||
|
||||
@@ -667,36 +667,25 @@ fp_print_serialize (FpPrint *print,
|
||||
for (i = 0; i < print->prints->len; i++)
|
||||
{
|
||||
struct xyt_struct *xyt = g_ptr_array_index (print->prints, i);
|
||||
gint j;
|
||||
gint32 *col = g_new (gint32, xyt->nrows);
|
||||
|
||||
g_variant_builder_open (&nested, G_VARIANT_TYPE ("(aiaiai)"));
|
||||
|
||||
for (j = 0; j < xyt->nrows; j++)
|
||||
col[j] = GINT32_TO_LE (xyt->xcol[j]);
|
||||
g_variant_builder_add_value (&nested,
|
||||
g_variant_new_fixed_array (G_VARIANT_TYPE_INT32,
|
||||
col,
|
||||
xyt->xcol,
|
||||
xyt->nrows,
|
||||
sizeof (col[0])));
|
||||
|
||||
for (j = 0; j < xyt->nrows; j++)
|
||||
col[j] = GINT32_TO_LE (xyt->ycol[j]);
|
||||
sizeof (xyt->xcol[0])));
|
||||
g_variant_builder_add_value (&nested,
|
||||
g_variant_new_fixed_array (G_VARIANT_TYPE_INT32,
|
||||
col,
|
||||
xyt->ycol,
|
||||
xyt->nrows,
|
||||
sizeof (col[0])));
|
||||
|
||||
for (j = 0; j < xyt->nrows; j++)
|
||||
col[j] = GINT32_TO_LE (xyt->thetacol[j]);
|
||||
sizeof (xyt->ycol[0])));
|
||||
g_variant_builder_add_value (&nested,
|
||||
g_variant_new_fixed_array (G_VARIANT_TYPE_INT32,
|
||||
col,
|
||||
xyt->thetacol,
|
||||
xyt->nrows,
|
||||
sizeof (col[0])));
|
||||
sizeof (xyt->thetacol[0])));
|
||||
g_variant_builder_close (&nested);
|
||||
g_free (col);
|
||||
}
|
||||
|
||||
g_variant_builder_close (&nested);
|
||||
@@ -819,6 +808,7 @@ fp_print_deserialize (const guchar *data,
|
||||
"device-id", device_id,
|
||||
"device-stored", device_stored,
|
||||
NULL);
|
||||
g_object_ref_sink (result);
|
||||
fpi_print_set_type (result, FPI_PRINT_NBIS);
|
||||
for (i = 0; i < g_variant_n_children (prints); i++)
|
||||
{
|
||||
@@ -868,6 +858,7 @@ fp_print_deserialize (const guchar *data,
|
||||
"device-stored", device_stored,
|
||||
"fpi-data", fp_data,
|
||||
NULL);
|
||||
g_object_ref_sink (result);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -886,8 +877,7 @@ fp_print_deserialize (const guchar *data,
|
||||
return g_steal_pointer (&result);
|
||||
|
||||
invalid_format:
|
||||
*error = g_error_new_literal (G_IO_ERROR,
|
||||
G_IO_ERROR_INVALID_DATA,
|
||||
"Data could not be parsed");
|
||||
return FALSE;
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_DATA,
|
||||
"Data could not be parsed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -66,12 +66,19 @@ typedef enum {
|
||||
FP_FINGER_LAST = FP_FINGER_RIGHT_LITTLE,
|
||||
} FpFinger;
|
||||
|
||||
FpPrint *fp_print_new (FpDevice *device);
|
||||
/**
|
||||
* FpFingerStatusFlags:
|
||||
* @FP_FINGER_STATUS_NONE: Sensor has not the finger on it, nor requires it
|
||||
* @FP_FINGER_STATUS_NEEDED: Sensor waits for the finger
|
||||
* @FP_FINGER_STATUS_PRESENT: Sensor has the finger on it
|
||||
*/
|
||||
typedef enum {
|
||||
FP_FINGER_STATUS_NONE = 0,
|
||||
FP_FINGER_STATUS_NEEDED = 1 << 0,
|
||||
FP_FINGER_STATUS_PRESENT = 1 << 1,
|
||||
} FpFingerStatusFlags;
|
||||
|
||||
FpPrint *fp_print_new_from_data (guchar *data,
|
||||
gsize length);
|
||||
gboolean fp_print_to_data (guchar **data,
|
||||
gsize length);
|
||||
FpPrint *fp_print_new (FpDevice *device);
|
||||
|
||||
const gchar *fp_print_get_driver (FpPrint *print);
|
||||
const gchar *fp_print_get_device_id (FpPrint *print);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#if !GLIB_CHECK_VERSION (2, 57, 0)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GTypeClass, g_type_class_unref);
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GEnumClass, g_type_class_unref);
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GFlagsClass, g_type_class_unref);
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GParamSpec, g_param_spec_unref);
|
||||
#else
|
||||
/* Re-define G_SOURCE_FUNC as we are technically not allowed to use it with
|
||||
@@ -37,3 +38,9 @@ typedef struct _FpDeviceClass FpDeviceClass;
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FpDeviceClass, g_type_class_unref);
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GDate, g_date_free);
|
||||
#endif
|
||||
|
||||
#if __GNUC__ > 10 || (__GNUC__ == 10 && __GNUC_MINOR__ >= 1)
|
||||
#define FP_GNUC_ACCESS(m, p, s) __attribute__((access (m, p, s)))
|
||||
#else
|
||||
#define FP_GNUC_ACCESS(m, p, s)
|
||||
#endif
|
||||
|
||||
@@ -135,6 +135,14 @@ fpi_device_error_new (FpDeviceError error)
|
||||
msg = "Print was not found on the devices storage.";
|
||||
break;
|
||||
|
||||
case FP_DEVICE_ERROR_DATA_DUPLICATE:
|
||||
msg = "This finger has already enrolled, please try a different finger";
|
||||
break;
|
||||
|
||||
case FP_DEVICE_ERROR_REMOVED:
|
||||
msg = "This device has been removed from the system.";
|
||||
break;
|
||||
|
||||
default:
|
||||
g_warning ("Unsupported error, returning general error instead!");
|
||||
error = FP_DEVICE_ERROR_GENERAL;
|
||||
@@ -391,7 +399,7 @@ fpi_device_action_is_cancelled (FpDevice *device)
|
||||
|
||||
cancellable = g_task_get_cancellable (priv->current_task);
|
||||
|
||||
return cancellable ? g_cancellable_is_cancelled (cancellable) : FALSE;
|
||||
return g_cancellable_is_cancelled (cancellable);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -572,6 +580,49 @@ fpi_device_get_cancellable (FpDevice *device)
|
||||
return g_task_get_cancellable (priv->current_task);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_removed_on_task_completed (FpDevice *device)
|
||||
{
|
||||
g_signal_emit_by_name (device, "removed");
|
||||
}
|
||||
|
||||
/**
|
||||
* fpi_device_remove:
|
||||
* @device: The #FpDevice
|
||||
*
|
||||
* Called to signal to the #FpDevice that it has been unplugged (physically
|
||||
* removed from the system).
|
||||
*
|
||||
* For USB devices, this API is called automatically by #FpContext.
|
||||
*/
|
||||
void
|
||||
fpi_device_remove (FpDevice *device)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
|
||||
g_return_if_fail (FP_IS_DEVICE (device));
|
||||
g_return_if_fail (!priv->is_removed);
|
||||
|
||||
priv->is_removed = TRUE;
|
||||
|
||||
g_object_notify (G_OBJECT (device), "removed");
|
||||
|
||||
/* If there is a pending action, we wait for it to fail, otherwise we
|
||||
* immediately emit the "removed" signal. */
|
||||
if (priv->current_task)
|
||||
{
|
||||
g_signal_connect_object (priv->current_task,
|
||||
"notify::completed",
|
||||
(GCallback) emit_removed_on_task_completed,
|
||||
device,
|
||||
G_CONNECT_SWAPPED);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_signal_emit_by_name (device, "removed");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* fpi_device_action_error:
|
||||
* @device: The #FpDevice
|
||||
@@ -593,7 +644,11 @@ fpi_device_action_error (FpDevice *device,
|
||||
|
||||
if (error != NULL)
|
||||
{
|
||||
g_debug ("Device reported generic error during action; action was: %i", priv->current_action);
|
||||
g_autofree char *action_str = NULL;
|
||||
|
||||
action_str = g_enum_to_string (FPI_TYPE_DEVICE_ACTION, priv->current_action);
|
||||
g_debug ("Device reported generic error (%s) during action; action was: %s",
|
||||
error->message, action_str);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -682,15 +737,34 @@ fp_device_task_return_in_idle_cb (gpointer user_data)
|
||||
{
|
||||
FpDeviceTaskReturnData *data = user_data;
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (data->device);
|
||||
g_autofree char *action_str = NULL;
|
||||
FpiDeviceAction action;
|
||||
|
||||
g_autoptr(GTask) task = NULL;
|
||||
|
||||
g_debug ("Completing action %d in idle!", priv->current_action);
|
||||
|
||||
action_str = g_enum_to_string (FPI_TYPE_DEVICE_ACTION, priv->current_action);
|
||||
g_debug ("Completing action %s in idle!", action_str);
|
||||
|
||||
task = g_steal_pointer (&priv->current_task);
|
||||
action = priv->current_action;
|
||||
priv->current_action = FPI_DEVICE_ACTION_NONE;
|
||||
priv->current_task_idle_return_source = NULL;
|
||||
|
||||
/* Return FP_DEVICE_ERROR_REMOVED if the device is removed,
|
||||
* with the exception of a successful open, which is an odd corner case. */
|
||||
if (priv->is_removed &&
|
||||
((action != FPI_DEVICE_ACTION_OPEN) ||
|
||||
(action == FPI_DEVICE_ACTION_OPEN && data->type == FP_DEVICE_TASK_RETURN_ERROR)))
|
||||
{
|
||||
g_task_return_error (task, fpi_device_error_new (FP_DEVICE_ERROR_REMOVED));
|
||||
|
||||
/* NOTE: The removed signal will be emitted from the GTask
|
||||
* notify::completed if that is necessary. */
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
switch (data->type)
|
||||
{
|
||||
case FP_DEVICE_TASK_RETURN_INT:
|
||||
@@ -702,16 +776,17 @@ fp_device_task_return_in_idle_cb (gpointer user_data)
|
||||
break;
|
||||
|
||||
case FP_DEVICE_TASK_RETURN_OBJECT:
|
||||
g_task_return_pointer (task, data->result, g_object_unref);
|
||||
g_task_return_pointer (task, g_steal_pointer (&data->result),
|
||||
g_object_unref);
|
||||
break;
|
||||
|
||||
case FP_DEVICE_TASK_RETURN_PTR_ARRAY:
|
||||
g_task_return_pointer (task, data->result,
|
||||
g_task_return_pointer (task, g_steal_pointer (&data->result),
|
||||
(GDestroyNotify) g_ptr_array_unref);
|
||||
break;
|
||||
|
||||
case FP_DEVICE_TASK_RETURN_ERROR:
|
||||
g_task_return_error (task, data->result);
|
||||
g_task_return_error (task, g_steal_pointer (&data->result));
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -724,6 +799,30 @@ fp_device_task_return_in_idle_cb (gpointer user_data)
|
||||
static void
|
||||
fpi_device_task_return_data_free (FpDeviceTaskReturnData *data)
|
||||
{
|
||||
if (data->result)
|
||||
{
|
||||
switch (data->type)
|
||||
{
|
||||
case FP_DEVICE_TASK_RETURN_INT:
|
||||
case FP_DEVICE_TASK_RETURN_BOOL:
|
||||
break;
|
||||
|
||||
case FP_DEVICE_TASK_RETURN_OBJECT:
|
||||
g_clear_object ((GObject **) &data->result);
|
||||
break;
|
||||
|
||||
case FP_DEVICE_TASK_RETURN_PTR_ARRAY:
|
||||
g_clear_pointer ((GPtrArray **) &data->result, g_ptr_array_unref);
|
||||
break;
|
||||
|
||||
case FP_DEVICE_TASK_RETURN_ERROR:
|
||||
g_clear_error ((GError **) &data->result);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
g_object_unref (data->device);
|
||||
g_free (data);
|
||||
}
|
||||
@@ -776,6 +875,7 @@ fpi_device_probe_complete (FpDevice *device,
|
||||
g_debug ("Device reported probe completion");
|
||||
|
||||
clear_device_cancel_action (device);
|
||||
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
|
||||
|
||||
if (!error)
|
||||
{
|
||||
@@ -818,6 +918,7 @@ fpi_device_open_complete (FpDevice *device, GError *error)
|
||||
g_debug ("Device reported open completion");
|
||||
|
||||
clear_device_cancel_action (device);
|
||||
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
|
||||
|
||||
if (!error)
|
||||
{
|
||||
@@ -851,6 +952,7 @@ fpi_device_close_complete (FpDevice *device, GError *error)
|
||||
g_debug ("Device reported close completion");
|
||||
|
||||
clear_device_cancel_action (device);
|
||||
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
|
||||
|
||||
switch (priv->type)
|
||||
{
|
||||
@@ -874,17 +976,17 @@ fpi_device_close_complete (FpDevice *device, GError *error)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Always consider the device closed. Drivers should try hard to close the
|
||||
* device. Generally, e.g. cancellations should be ignored.
|
||||
*/
|
||||
priv->is_open = FALSE;
|
||||
g_object_notify (G_OBJECT (device), "open");
|
||||
|
||||
if (!error)
|
||||
{
|
||||
priv->is_open = FALSE;
|
||||
g_object_notify (G_OBJECT (device), "open");
|
||||
fpi_device_return_task_in_idle (device, FP_DEVICE_TASK_RETURN_BOOL,
|
||||
GUINT_TO_POINTER (TRUE));
|
||||
}
|
||||
fpi_device_return_task_in_idle (device, FP_DEVICE_TASK_RETURN_BOOL,
|
||||
GUINT_TO_POINTER (TRUE));
|
||||
else
|
||||
{
|
||||
fpi_device_return_task_in_idle (device, FP_DEVICE_TASK_RETURN_ERROR, error);
|
||||
}
|
||||
fpi_device_return_task_in_idle (device, FP_DEVICE_TASK_RETURN_ERROR, error);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -907,12 +1009,14 @@ fpi_device_enroll_complete (FpDevice *device, FpPrint *print, GError *error)
|
||||
g_debug ("Device reported enroll completion");
|
||||
|
||||
clear_device_cancel_action (device);
|
||||
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
|
||||
|
||||
if (!error)
|
||||
{
|
||||
if (FP_IS_PRINT (print))
|
||||
{
|
||||
FpiPrintType print_type;
|
||||
g_autofree char *finger_str = NULL;
|
||||
|
||||
g_object_get (print, "fpi-type", &print_type, NULL);
|
||||
if (print_type == FPI_PRINT_UNDEFINED)
|
||||
@@ -926,6 +1030,9 @@ fpi_device_enroll_complete (FpDevice *device, FpPrint *print, GError *error)
|
||||
return;
|
||||
}
|
||||
|
||||
finger_str = g_enum_to_string (FP_TYPE_FINGER, fp_print_get_finger (print));
|
||||
g_debug ("Print for finger %s enrolled", finger_str);
|
||||
|
||||
fpi_device_return_task_in_idle (device, FP_DEVICE_TASK_RETURN_OBJECT, print);
|
||||
}
|
||||
else
|
||||
@@ -974,6 +1081,7 @@ fpi_device_verify_complete (FpDevice *device,
|
||||
data = g_task_get_task_data (priv->current_task);
|
||||
|
||||
clear_device_cancel_action (device);
|
||||
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
|
||||
|
||||
if (!error)
|
||||
{
|
||||
@@ -1033,6 +1141,7 @@ fpi_device_identify_complete (FpDevice *device,
|
||||
data = g_task_get_task_data (priv->current_task);
|
||||
|
||||
clear_device_cancel_action (device);
|
||||
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
|
||||
|
||||
if (!error)
|
||||
{
|
||||
@@ -1048,7 +1157,7 @@ fpi_device_identify_complete (FpDevice *device,
|
||||
}
|
||||
else
|
||||
{
|
||||
fpi_device_return_task_in_idle (device, FP_DEVICE_TASK_RETURN_INT, GINT_TO_POINTER (TRUE));
|
||||
fpi_device_return_task_in_idle (device, FP_DEVICE_TASK_RETURN_BOOL, GUINT_TO_POINTER (TRUE));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1089,6 +1198,7 @@ fpi_device_capture_complete (FpDevice *device,
|
||||
g_debug ("Device reported capture completion");
|
||||
|
||||
clear_device_cancel_action (device);
|
||||
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
|
||||
|
||||
if (!error)
|
||||
{
|
||||
@@ -1134,6 +1244,7 @@ fpi_device_delete_complete (FpDevice *device,
|
||||
g_debug ("Device reported deletion completion");
|
||||
|
||||
clear_device_cancel_action (device);
|
||||
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
|
||||
|
||||
if (!error)
|
||||
fpi_device_return_task_in_idle (device, FP_DEVICE_TASK_RETURN_BOOL,
|
||||
@@ -1168,6 +1279,7 @@ fpi_device_list_complete (FpDevice *device,
|
||||
g_debug ("Device reported listing completion");
|
||||
|
||||
clear_device_cancel_action (device);
|
||||
fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE);
|
||||
|
||||
if (prints && error)
|
||||
{
|
||||
@@ -1383,3 +1495,59 @@ fpi_device_identify_report (FpDevice *device,
|
||||
if (call_cb && data->match_cb)
|
||||
data->match_cb (device, data->match, data->print, data->match_data, data->error);
|
||||
}
|
||||
|
||||
/**
|
||||
* fpi_device_report_finger_status:
|
||||
* @device: The #FpDevice
|
||||
* @finger_status: The current #FpFingerStatusFlags to report
|
||||
*
|
||||
* Report the finger status for the @device.
|
||||
* This can be used by UI to give a feedback
|
||||
*
|
||||
* Returns: %TRUE if changed
|
||||
*/
|
||||
gboolean
|
||||
fpi_device_report_finger_status (FpDevice *device,
|
||||
FpFingerStatusFlags finger_status)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
g_autofree char *status_string = NULL;
|
||||
|
||||
if (priv->finger_status == finger_status)
|
||||
return FALSE;
|
||||
|
||||
status_string = g_flags_to_string (FP_TYPE_FINGER_STATUS_FLAGS, finger_status);
|
||||
fp_dbg ("Device reported finger status change: %s", status_string);
|
||||
|
||||
priv->finger_status = finger_status;
|
||||
g_object_notify (G_OBJECT (device), "finger-status");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* fpi_device_report_finger_status_changes:
|
||||
* @device: The #FpDevice
|
||||
* @added_status: The #FpFingerStatusFlags to add
|
||||
* @added_status: The #FpFingerStatusFlags to remove
|
||||
*
|
||||
* Report the finger status for the @device adding the @added_status flags
|
||||
* and removing the @removed_status flags.
|
||||
*
|
||||
* This can be used by UI to give a feedback
|
||||
*
|
||||
* Returns: %TRUE if changed
|
||||
*/
|
||||
gboolean
|
||||
fpi_device_report_finger_status_changes (FpDevice *device,
|
||||
FpFingerStatusFlags added_status,
|
||||
FpFingerStatusFlags removed_status)
|
||||
{
|
||||
FpDevicePrivate *priv = fp_device_get_instance_private (device);
|
||||
FpFingerStatusFlags finger_status = priv->finger_status;
|
||||
|
||||
finger_status |= added_status;
|
||||
finger_status &= ~removed_status;
|
||||
|
||||
return fpi_device_report_finger_status (device, finger_status);
|
||||
}
|
||||
|
||||
@@ -202,6 +202,7 @@ void fpi_device_get_delete_data (FpDevice *device,
|
||||
FpPrint **print);
|
||||
GCancellable *fpi_device_get_cancellable (FpDevice *device);
|
||||
|
||||
void fpi_device_remove (FpDevice *device);
|
||||
|
||||
GSource * fpi_device_add_timeout (FpDevice *device,
|
||||
gint interval,
|
||||
@@ -255,4 +256,10 @@ void fpi_device_identify_report (FpDevice *device,
|
||||
FpPrint *print,
|
||||
GError *error);
|
||||
|
||||
gboolean fpi_device_report_finger_status (FpDevice *device,
|
||||
FpFingerStatusFlags finger_status);
|
||||
gboolean fpi_device_report_finger_status_changes (FpDevice *device,
|
||||
FpFingerStatusFlags added_status,
|
||||
FpFingerStatusFlags removed_status);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
@@ -41,6 +41,9 @@ fp_image_device_get_instance_private (FpImageDevice *self)
|
||||
g_type_class_get_instance_private_offset (img_class));
|
||||
}
|
||||
|
||||
static void fp_image_device_change_state (FpImageDevice *self,
|
||||
FpiImageDeviceState state);
|
||||
|
||||
/* Private shared functions */
|
||||
|
||||
void
|
||||
@@ -51,62 +54,105 @@ fpi_image_device_activate (FpImageDevice *self)
|
||||
|
||||
g_assert (!priv->active);
|
||||
|
||||
/* We don't have a neutral ACTIVE state, but we always will
|
||||
* go into WAIT_FINGER_ON afterwards. */
|
||||
priv->state = FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON;
|
||||
g_object_notify (G_OBJECT (self), "fpi-image-device-state");
|
||||
|
||||
/* We might have been waiting for deactivation to finish before
|
||||
* starting the next operation. */
|
||||
g_clear_handle_id (&priv->pending_activation_timeout_id, g_source_remove);
|
||||
|
||||
fp_dbg ("Activating image device\n");
|
||||
fp_dbg ("Activating image device");
|
||||
fp_image_device_change_state (self, FPI_IMAGE_DEVICE_STATE_ACTIVATING);
|
||||
cls->activate (self);
|
||||
}
|
||||
|
||||
void
|
||||
fpi_image_device_deactivate (FpImageDevice *self)
|
||||
fpi_image_device_deactivate (FpImageDevice *self, gboolean cancelling)
|
||||
{
|
||||
FpDevice *device = FP_DEVICE (self);
|
||||
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
|
||||
FpImageDeviceClass *cls = FP_IMAGE_DEVICE_GET_CLASS (device);
|
||||
|
||||
if (!priv->active)
|
||||
if (!priv->active || priv->state == FPI_IMAGE_DEVICE_STATE_DEACTIVATING)
|
||||
{
|
||||
/* XXX: We currently deactivate both from minutiae scan result
|
||||
* and finger off report. */
|
||||
fp_dbg ("Already deactivated, ignoring request.");
|
||||
return;
|
||||
}
|
||||
if (!priv->cancelling && priv->state == FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON)
|
||||
g_warning ("Deactivating image device while waiting for finger, this should not happen.");
|
||||
if (!cancelling && priv->state != FPI_IMAGE_DEVICE_STATE_IDLE)
|
||||
g_warning ("Deactivating image device while it is not idle, this should not happen.");
|
||||
|
||||
priv->state = FPI_IMAGE_DEVICE_STATE_INACTIVE;
|
||||
g_object_notify (G_OBJECT (self), "fpi-image-device-state");
|
||||
|
||||
fp_dbg ("Deactivating image device\n");
|
||||
fp_dbg ("Deactivating image device");
|
||||
fp_image_device_change_state (self, FPI_IMAGE_DEVICE_STATE_DEACTIVATING);
|
||||
cls->deactivate (self);
|
||||
}
|
||||
|
||||
/* Static helper functions */
|
||||
|
||||
/* This should not be called directly to activate/deactivate the device! */
|
||||
static void
|
||||
fp_image_device_change_state (FpImageDevice *self, FpiImageDeviceState state)
|
||||
{
|
||||
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
|
||||
g_autofree char *prev_state_str = NULL;
|
||||
g_autofree char *state_str = NULL;
|
||||
gboolean transition_is_valid = FALSE;
|
||||
gint i;
|
||||
|
||||
/* Cannot change to inactive using this function. */
|
||||
g_assert (state != FPI_IMAGE_DEVICE_STATE_INACTIVE);
|
||||
struct
|
||||
{
|
||||
FpiImageDeviceState from;
|
||||
FpiImageDeviceState to;
|
||||
} valid_transitions[] = {
|
||||
{ FPI_IMAGE_DEVICE_STATE_INACTIVE, FPI_IMAGE_DEVICE_STATE_ACTIVATING },
|
||||
|
||||
/* We might have been waiting for the finger to go OFF to start the
|
||||
* next operation. */
|
||||
g_clear_handle_id (&priv->pending_activation_timeout_id, g_source_remove);
|
||||
{ FPI_IMAGE_DEVICE_STATE_ACTIVATING, FPI_IMAGE_DEVICE_STATE_IDLE },
|
||||
{ FPI_IMAGE_DEVICE_STATE_ACTIVATING, FPI_IMAGE_DEVICE_STATE_INACTIVE },
|
||||
|
||||
fp_dbg ("Image device internal state change from %d to %d\n", priv->state, state);
|
||||
{ FPI_IMAGE_DEVICE_STATE_IDLE, FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON },
|
||||
{ FPI_IMAGE_DEVICE_STATE_IDLE, FPI_IMAGE_DEVICE_STATE_CAPTURE }, /* raw mode -- currently not supported */
|
||||
{ FPI_IMAGE_DEVICE_STATE_IDLE, FPI_IMAGE_DEVICE_STATE_DEACTIVATING },
|
||||
|
||||
{ FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON, FPI_IMAGE_DEVICE_STATE_CAPTURE },
|
||||
{ FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON, FPI_IMAGE_DEVICE_STATE_DEACTIVATING }, /* cancellation */
|
||||
|
||||
{ FPI_IMAGE_DEVICE_STATE_CAPTURE, FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF },
|
||||
{ FPI_IMAGE_DEVICE_STATE_CAPTURE, FPI_IMAGE_DEVICE_STATE_IDLE }, /* raw mode -- currently not supported */
|
||||
{ FPI_IMAGE_DEVICE_STATE_CAPTURE, FPI_IMAGE_DEVICE_STATE_DEACTIVATING }, /* cancellation */
|
||||
|
||||
{ FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF, FPI_IMAGE_DEVICE_STATE_IDLE },
|
||||
{ FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF, FPI_IMAGE_DEVICE_STATE_DEACTIVATING }, /* cancellation */
|
||||
|
||||
{ FPI_IMAGE_DEVICE_STATE_DEACTIVATING, FPI_IMAGE_DEVICE_STATE_INACTIVE },
|
||||
};
|
||||
|
||||
prev_state_str = g_enum_to_string (FPI_TYPE_IMAGE_DEVICE_STATE, priv->state);
|
||||
state_str = g_enum_to_string (FPI_TYPE_IMAGE_DEVICE_STATE, state);
|
||||
fp_dbg ("Image device internal state change from %s to %s",
|
||||
prev_state_str, state_str);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (valid_transitions); i++)
|
||||
{
|
||||
if (valid_transitions[i].from == priv->state && valid_transitions[i].to == state)
|
||||
{
|
||||
transition_is_valid = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!transition_is_valid)
|
||||
g_warning ("Internal state machine issue: transition from %s to %s should not happen!",
|
||||
prev_state_str, state_str);
|
||||
|
||||
priv->state = state;
|
||||
g_object_notify (G_OBJECT (self), "fpi-image-device-state");
|
||||
g_signal_emit_by_name (self, "fpi-image-device-state-changed", priv->state);
|
||||
|
||||
if (state == FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON)
|
||||
{
|
||||
fpi_device_report_finger_status_changes (FP_DEVICE (self),
|
||||
FP_FINGER_STATUS_NEEDED,
|
||||
FP_FINGER_STATUS_NONE);
|
||||
}
|
||||
else if (state == FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF)
|
||||
{
|
||||
fpi_device_report_finger_status_changes (FP_DEVICE (self),
|
||||
FP_FINGER_STATUS_NONE,
|
||||
FP_FINGER_STATUS_NEEDED);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -114,14 +160,75 @@ fp_image_device_enroll_maybe_await_finger_on (FpImageDevice *self)
|
||||
{
|
||||
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
|
||||
|
||||
if (priv->enroll_await_on_pending)
|
||||
/* We wait for both the minutiae scan to complete and the finger to
|
||||
* be removed before we switch to AWAIT_FINGER_ON. */
|
||||
if (priv->minutiae_scan_active || priv->finger_present)
|
||||
return;
|
||||
|
||||
fp_image_device_change_state (self, FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON);
|
||||
}
|
||||
|
||||
static void
|
||||
fp_image_device_maybe_complete_action (FpImageDevice *self, GError *error)
|
||||
{
|
||||
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
|
||||
FpDevice *device = FP_DEVICE (self);
|
||||
FpiDeviceAction action;
|
||||
|
||||
if (error)
|
||||
{
|
||||
priv->enroll_await_on_pending = FALSE;
|
||||
fp_image_device_change_state (self, FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON);
|
||||
/* Keep the first error we encountered, but not if it is of type retry */
|
||||
if (priv->action_error && !(priv->action_error->domain == FP_DEVICE_RETRY))
|
||||
{
|
||||
g_warning ("Will complete with first error, new error was: %s", error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_clear_error (&priv->action_error);
|
||||
priv->action_error = error;
|
||||
}
|
||||
}
|
||||
|
||||
/* Do not complete if the device is still active or a minutiae scan is pending. */
|
||||
if (priv->active || priv->minutiae_scan_active)
|
||||
return;
|
||||
|
||||
if (!priv->action_error)
|
||||
g_cancellable_set_error_if_cancelled (fpi_device_get_cancellable (device), &priv->action_error);
|
||||
|
||||
if (priv->action_error)
|
||||
{
|
||||
fpi_device_action_error (device, g_steal_pointer (&priv->action_error));
|
||||
g_clear_object (&priv->capture_image);
|
||||
return;
|
||||
}
|
||||
|
||||
/* We are done, report the result. */
|
||||
action = fpi_device_get_current_action (FP_DEVICE (self));
|
||||
|
||||
if (action == FPI_DEVICE_ACTION_ENROLL)
|
||||
{
|
||||
FpPrint *enroll_print;
|
||||
fpi_device_get_enroll_data (device, &enroll_print);
|
||||
|
||||
fpi_device_enroll_complete (device, g_object_ref (enroll_print), NULL);
|
||||
}
|
||||
else if (action == FPI_DEVICE_ACTION_VERIFY)
|
||||
{
|
||||
fpi_device_verify_complete (device, NULL);
|
||||
}
|
||||
else if (action == FPI_DEVICE_ACTION_IDENTIFY)
|
||||
{
|
||||
fpi_device_identify_complete (device, NULL);
|
||||
}
|
||||
else if (action == FPI_DEVICE_ACTION_CAPTURE)
|
||||
{
|
||||
fpi_device_capture_complete (device, g_steal_pointer (&priv->capture_image), NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
priv->enroll_await_on_pending = TRUE;
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,14 +244,16 @@ fpi_image_device_minutiae_detected (GObject *source_object, GAsyncResult *res, g
|
||||
FpiDeviceAction action;
|
||||
|
||||
/* Note: We rely on the device to not disappear during an operation. */
|
||||
priv = fp_image_device_get_instance_private (FP_IMAGE_DEVICE (device));
|
||||
priv->minutiae_scan_active = FALSE;
|
||||
|
||||
if (!fp_image_detect_minutiae_finish (image, res, &error))
|
||||
{
|
||||
/* Cancel operation . */
|
||||
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
{
|
||||
fpi_device_action_error (device, g_steal_pointer (&error));
|
||||
fpi_image_device_deactivate (self);
|
||||
fp_image_device_maybe_complete_action (self, g_steal_pointer (&error));
|
||||
fpi_image_device_deactivate (self, TRUE);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -155,13 +264,12 @@ fpi_image_device_minutiae_detected (GObject *source_object, GAsyncResult *res, g
|
||||
error = fpi_device_retry_new_msg (FP_DEVICE_RETRY_GENERAL, "Minutiae detection failed, please retry");
|
||||
}
|
||||
|
||||
priv = fp_image_device_get_instance_private (FP_IMAGE_DEVICE (device));
|
||||
action = fpi_device_get_current_action (device);
|
||||
|
||||
if (action == FPI_DEVICE_ACTION_CAPTURE)
|
||||
{
|
||||
fpi_device_capture_complete (device, g_steal_pointer (&image), error);
|
||||
fpi_image_device_deactivate (self);
|
||||
priv->capture_image = g_steal_pointer (&image);
|
||||
fp_image_device_maybe_complete_action (self, g_steal_pointer (&error));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -175,8 +283,9 @@ fpi_image_device_minutiae_detected (GObject *source_object, GAsyncResult *res, g
|
||||
|
||||
if (error->domain != FP_DEVICE_RETRY)
|
||||
{
|
||||
fpi_device_action_error (device, error);
|
||||
fpi_image_device_deactivate (self);
|
||||
fp_image_device_maybe_complete_action (self, g_steal_pointer (&error));
|
||||
/* We might not yet be deactivating, if we are enrolling. */
|
||||
fpi_image_device_deactivate (self, TRUE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -199,8 +308,8 @@ fpi_image_device_minutiae_detected (GObject *source_object, GAsyncResult *res, g
|
||||
/* Start another scan or deactivate. */
|
||||
if (priv->enroll_stage == IMG_ENROLL_STAGES)
|
||||
{
|
||||
fpi_device_enroll_complete (device, g_object_ref (enroll_print), NULL);
|
||||
fpi_image_device_deactivate (self);
|
||||
fp_image_device_maybe_complete_action (self, g_steal_pointer (&error));
|
||||
fpi_image_device_deactivate (self, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -220,8 +329,8 @@ fpi_image_device_minutiae_detected (GObject *source_object, GAsyncResult *res, g
|
||||
|
||||
if (!error || error->domain == FP_DEVICE_RETRY)
|
||||
fpi_device_verify_report (device, result, g_steal_pointer (&print), g_steal_pointer (&error));
|
||||
fpi_device_verify_complete (device, error);
|
||||
fpi_image_device_deactivate (self);
|
||||
|
||||
fp_image_device_maybe_complete_action (self, g_steal_pointer (&error));
|
||||
}
|
||||
else if (action == FPI_DEVICE_ACTION_IDENTIFY)
|
||||
{
|
||||
@@ -243,8 +352,8 @@ fpi_image_device_minutiae_detected (GObject *source_object, GAsyncResult *res, g
|
||||
|
||||
if (!error || error->domain == FP_DEVICE_RETRY)
|
||||
fpi_device_identify_report (device, result, g_steal_pointer (&print), g_steal_pointer (&error));
|
||||
fpi_device_identify_complete (device, error);
|
||||
fpi_image_device_deactivate (self);
|
||||
|
||||
fp_image_device_maybe_complete_action (self, g_steal_pointer (&error));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -299,6 +408,19 @@ fpi_image_device_report_finger_status (FpImageDevice *self,
|
||||
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
|
||||
FpiDeviceAction action;
|
||||
|
||||
if (present)
|
||||
{
|
||||
fpi_device_report_finger_status_changes (device,
|
||||
FP_FINGER_STATUS_PRESENT,
|
||||
FP_FINGER_STATUS_NONE);
|
||||
}
|
||||
else
|
||||
{
|
||||
fpi_device_report_finger_status_changes (device,
|
||||
FP_FINGER_STATUS_NONE,
|
||||
FP_FINGER_STATUS_PRESENT);
|
||||
}
|
||||
|
||||
if (priv->state == FPI_IMAGE_DEVICE_STATE_INACTIVE)
|
||||
{
|
||||
/* Do we really want to always ignore such reports? We could
|
||||
@@ -317,27 +439,23 @@ fpi_image_device_report_finger_status (FpImageDevice *self,
|
||||
|
||||
g_debug ("Image device reported finger status: %s", present ? "on" : "off");
|
||||
|
||||
priv->finger_present = present;
|
||||
|
||||
if (present && priv->state == FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON)
|
||||
{
|
||||
fp_image_device_change_state (self, FPI_IMAGE_DEVICE_STATE_CAPTURE);
|
||||
}
|
||||
else if (!present && priv->state == FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF)
|
||||
{
|
||||
/* We need to deactivate or continue to await finger */
|
||||
|
||||
/* There are three possible situations:
|
||||
* 1. We are deactivating the device and the action is still in progress
|
||||
* (minutiae detection).
|
||||
* 2. We are still deactivating the device after an action completed
|
||||
* 3. We were waiting for finger removal to start the new action
|
||||
* Either way, we always end up deactivating except for the enroll case.
|
||||
/* If we are in the non-enroll case, we always deactivate.
|
||||
*
|
||||
* The enroll case is special as AWAIT_FINGER_ON should only happen after
|
||||
* minutiae detection to prevent deactivation (without cancellation)
|
||||
* from the AWAIT_FINGER_ON state.
|
||||
* In the enroll case, the decision can only be made after minutiae
|
||||
* detection has finished.
|
||||
*/
|
||||
fp_image_device_change_state (self, FPI_IMAGE_DEVICE_STATE_IDLE);
|
||||
|
||||
if (action != FPI_DEVICE_ACTION_ENROLL)
|
||||
fpi_image_device_deactivate (self);
|
||||
fpi_image_device_deactivate (self, FALSE);
|
||||
else
|
||||
fp_image_device_enroll_maybe_await_finger_on (self);
|
||||
}
|
||||
@@ -372,16 +490,19 @@ fpi_image_device_image_captured (FpImageDevice *self, FpImage *image)
|
||||
action == FPI_DEVICE_ACTION_IDENTIFY ||
|
||||
action == FPI_DEVICE_ACTION_CAPTURE);
|
||||
|
||||
fp_image_device_change_state (self, FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF);
|
||||
|
||||
g_debug ("Image device captured an image");
|
||||
|
||||
priv->minutiae_scan_active = TRUE;
|
||||
|
||||
/* XXX: We also detect minutiae in capture mode, we solely do this
|
||||
* to normalize the image which will happen as a by-product. */
|
||||
fp_image_detect_minutiae (image,
|
||||
fpi_device_get_cancellable (FP_DEVICE (self)),
|
||||
fpi_image_device_minutiae_detected,
|
||||
self);
|
||||
|
||||
/* XXX: This is wrong if we add support for raw capture mode. */
|
||||
fp_image_device_change_state (self, FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -417,36 +538,27 @@ fpi_image_device_retry_scan (FpImageDevice *self, FpDeviceRetry retry)
|
||||
g_debug ("Reporting retry during enroll");
|
||||
fpi_device_enroll_progress (FP_DEVICE (self), priv->enroll_stage, NULL, error);
|
||||
|
||||
/* Wait for finger removal and re-touch.
|
||||
* TODO: Do we need to check that the finger is already off? */
|
||||
priv->enroll_await_on_pending = TRUE;
|
||||
fp_image_device_change_state (self, FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF);
|
||||
}
|
||||
else if (action == FPI_DEVICE_ACTION_VERIFY)
|
||||
{
|
||||
fpi_device_verify_report (FP_DEVICE (self), FPI_MATCH_ERROR, NULL, error);
|
||||
priv->cancelling = TRUE;
|
||||
fpi_image_device_deactivate (self);
|
||||
priv->cancelling = FALSE;
|
||||
fpi_device_verify_complete (FP_DEVICE (self), NULL);
|
||||
fp_image_device_maybe_complete_action (self, NULL);
|
||||
fpi_image_device_deactivate (self, TRUE);
|
||||
|
||||
}
|
||||
else if (action == FPI_DEVICE_ACTION_IDENTIFY)
|
||||
{
|
||||
fpi_device_identify_report (FP_DEVICE (self), NULL, NULL, error);
|
||||
priv->cancelling = TRUE;
|
||||
fpi_image_device_deactivate (self);
|
||||
priv->cancelling = FALSE;
|
||||
fpi_device_identify_complete (FP_DEVICE (self), NULL);
|
||||
fp_image_device_maybe_complete_action (self, NULL);
|
||||
fpi_image_device_deactivate (self, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We abort the operation and let the surrounding code retry in the
|
||||
* non-enroll case (this is identical to a session error). */
|
||||
g_debug ("Abort current operation due to retry (non-enroll case)");
|
||||
priv->cancelling = TRUE;
|
||||
fpi_image_device_deactivate (self);
|
||||
priv->cancelling = FALSE;
|
||||
fpi_device_action_error (FP_DEVICE (self), error);
|
||||
/* The capture case where there is no early reporting. */
|
||||
g_debug ("Abort current operation due to retry (no early-reporting)");
|
||||
fp_image_device_maybe_complete_action (self, error);
|
||||
fpi_image_device_deactivate (self, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -505,10 +617,8 @@ fpi_image_device_session_error (FpImageDevice *self, GError *error)
|
||||
if (error->domain == FP_DEVICE_RETRY)
|
||||
g_warning ("Driver should report retries using fpi_image_device_retry_scan!");
|
||||
|
||||
priv->cancelling = TRUE;
|
||||
fpi_image_device_deactivate (self);
|
||||
priv->cancelling = FALSE;
|
||||
fpi_device_action_error (FP_DEVICE (self), error);
|
||||
fp_image_device_maybe_complete_action (self, error);
|
||||
fpi_image_device_deactivate (self, TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -527,6 +637,7 @@ fpi_image_device_activate_complete (FpImageDevice *self, GError *error)
|
||||
action = fpi_device_get_current_action (FP_DEVICE (self));
|
||||
|
||||
g_return_if_fail (priv->active == FALSE);
|
||||
g_return_if_fail (priv->state == FPI_IMAGE_DEVICE_STATE_ACTIVATING);
|
||||
g_return_if_fail (action == FPI_DEVICE_ACTION_ENROLL ||
|
||||
action == FPI_DEVICE_ACTION_VERIFY ||
|
||||
action == FPI_DEVICE_ACTION_IDENTIFY ||
|
||||
@@ -545,6 +656,7 @@ fpi_image_device_activate_complete (FpImageDevice *self, GError *error)
|
||||
|
||||
/* We always want to capture at this point, move to AWAIT_FINGER
|
||||
* state. */
|
||||
fp_image_device_change_state (self, FPI_IMAGE_DEVICE_STATE_IDLE);
|
||||
fp_image_device_change_state (self, FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON);
|
||||
}
|
||||
|
||||
@@ -559,36 +671,20 @@ void
|
||||
fpi_image_device_deactivate_complete (FpImageDevice *self, GError *error)
|
||||
{
|
||||
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
|
||||
FpImageDeviceClass *cls = FP_IMAGE_DEVICE_GET_CLASS (self);
|
||||
FpiDeviceAction action;
|
||||
|
||||
g_return_if_fail (priv->active == TRUE);
|
||||
g_return_if_fail (priv->state == FPI_IMAGE_DEVICE_STATE_INACTIVE);
|
||||
g_return_if_fail (priv->state == FPI_IMAGE_DEVICE_STATE_DEACTIVATING);
|
||||
|
||||
g_debug ("Image device deactivation completed");
|
||||
|
||||
priv->active = FALSE;
|
||||
|
||||
/* Deactivation completed. As we deactivate in the background
|
||||
* there may already be a new task pending. Check whether we
|
||||
* need to do anything. */
|
||||
action = fpi_device_get_current_action (FP_DEVICE (self));
|
||||
/* Assume finger was removed. */
|
||||
priv->finger_present = FALSE;
|
||||
|
||||
/* Special case, if we should be closing, but didn't due to a running
|
||||
* deactivation, then do so now. */
|
||||
if (action == FPI_DEVICE_ACTION_CLOSE)
|
||||
{
|
||||
cls->img_close (self);
|
||||
return;
|
||||
}
|
||||
fp_image_device_change_state (self, FPI_IMAGE_DEVICE_STATE_INACTIVE);
|
||||
|
||||
/* We might be waiting to be able to activate again. */
|
||||
if (priv->pending_activation_timeout_id)
|
||||
{
|
||||
g_clear_handle_id (&priv->pending_activation_timeout_id, g_source_remove);
|
||||
priv->pending_activation_timeout_id =
|
||||
g_idle_add ((GSourceFunc) fpi_image_device_activate, self);
|
||||
}
|
||||
fp_image_device_maybe_complete_action (self, error);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -614,6 +710,8 @@ fpi_image_device_open_complete (FpImageDevice *self, GError *error)
|
||||
priv->state = FPI_IMAGE_DEVICE_STATE_INACTIVE;
|
||||
g_object_notify (G_OBJECT (self), "fpi-image-device-state");
|
||||
|
||||
fpi_device_report_finger_status (FP_DEVICE (self), FP_FINGER_STATUS_NONE);
|
||||
|
||||
fpi_device_open_complete (FP_DEVICE (self), error);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
/**
|
||||
* FpiImageDeviceState:
|
||||
* @FPI_IMAGE_DEVICE_STATE_INACTIVE: inactive
|
||||
* @FPI_IMAGE_DEVICE_STATE_ACTIVATING: State during activate callback
|
||||
* @FPI_IMAGE_DEVICE_STATE_IDLE: Activated but idle
|
||||
* @FPI_IMAGE_DEVICE_STATE_DEACTIVATING: State during deactivate callback
|
||||
* @FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON: waiting for the finger to be pressed or swiped
|
||||
* @FPI_IMAGE_DEVICE_STATE_CAPTURE: capturing an image
|
||||
* @FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF: waiting for the finger to be removed
|
||||
@@ -35,9 +38,33 @@
|
||||
* The driver needs to call fpi_image_device_report_finger_status() to move
|
||||
* between the different states. Note that the capture state might be entered
|
||||
* unconditionally if the device supports raw capturing.
|
||||
*
|
||||
* A usual run would look like:
|
||||
* - inactive -> activating: activate vfunc is called
|
||||
* - activating -> idle: fpi_image_device_activate_complete()
|
||||
* - idle -> await-finger-on
|
||||
* - await-finger-on -> capture: fpi_image_device_report_finger_status()
|
||||
* - capture -> await-finger-off: fpi_image_device_image_captured()
|
||||
* - await-finger-off -> idle: fpi_image_device_report_finger_status()
|
||||
* - idle -> deactivating: deactivate vfunc is called
|
||||
* - deactivating -> inactive: fpi_image_device_deactivate_complete()
|
||||
*
|
||||
* Raw mode is currently not supported (not waiting for finger), but in that
|
||||
* case the following transitions are valid:
|
||||
* - idle -> capture
|
||||
* - capture -> idle
|
||||
*
|
||||
* Also valid are these transitions in case of errors or cancellations:
|
||||
* - activating -> inactive: fpi_image_device_activate_complete()
|
||||
* - await-finger-on -> deactivating: deactivate vfunc is called
|
||||
* - capture -> deactivating: deactivate vfunc is called
|
||||
* - await-finger-off -> deactivating: deactivate vfunc is called
|
||||
*/
|
||||
typedef enum {
|
||||
FPI_IMAGE_DEVICE_STATE_INACTIVE,
|
||||
FPI_IMAGE_DEVICE_STATE_ACTIVATING,
|
||||
FPI_IMAGE_DEVICE_STATE_DEACTIVATING,
|
||||
FPI_IMAGE_DEVICE_STATE_IDLE,
|
||||
FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_ON,
|
||||
FPI_IMAGE_DEVICE_STATE_CAPTURE,
|
||||
FPI_IMAGE_DEVICE_STATE_AWAIT_FINGER_OFF,
|
||||
@@ -58,11 +85,6 @@ typedef enum {
|
||||
* finger or image capture). Implementing this is optional, it can e.g. be
|
||||
* used to flash an LED when waiting for a finger.
|
||||
*
|
||||
* These are the main entry points for image based drivers. For all but the
|
||||
* change_state vfunc, implementations *must* eventually call the corresponding
|
||||
* function to finish the operation. It is also acceptable to call the generic
|
||||
*
|
||||
*
|
||||
* These are the main entry points for drivers to implement. Drivers may not
|
||||
* implement all of these entry points if they do not support the operation
|
||||
* (or a default implementation is sufficient).
|
||||
@@ -72,9 +94,8 @@ typedef enum {
|
||||
* fpi_device_action_error() function but doing so is not recommended in most
|
||||
* usecases.
|
||||
*
|
||||
* Drivers *must* also handle cancellation properly for any long running
|
||||
* operation (i.e. any operation that requires capturing). It is entirely fine
|
||||
* to ignore cancellation requests for short operations (e.g. open/close).
|
||||
* Image drivers must expect a @deactivate call to happen at any point during
|
||||
* image capture.
|
||||
*
|
||||
* This API is solely intended for drivers. It is purely internal and neither
|
||||
* API nor ABI stable.
|
||||
|
||||
@@ -240,7 +240,7 @@ fpi_print_bz3_match (FpPrint *template, FpPrint *print, gint bz3_threshold, GErr
|
||||
gint score;
|
||||
gstruct = g_ptr_array_index (template->prints, i);
|
||||
score = bozorth_to_gallery (probe_len, pstruct, gstruct);
|
||||
fp_dbg ("score %d", score);
|
||||
fp_dbg ("score %d/%d", score, bz3_threshold);
|
||||
|
||||
if (score >= bz3_threshold)
|
||||
return FPI_MATCH_SUCCESS;
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
* upon success (or fails).
|
||||
*
|
||||
* Your completion callback should examine the return value of
|
||||
* fpi_ssm_get_error() in ordater to determine whether the #FpiSsm completed or
|
||||
* fpi_ssm_get_error() in order to determine whether the #FpiSsm completed or
|
||||
* failed. An error code of zero indicates successful completion.
|
||||
*/
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@ fpi_usb_transfer_new (FpDevice * device)
|
||||
|
||||
self = g_slice_new0 (FpiUsbTransfer);
|
||||
self->ref_count = 1;
|
||||
self->type = FP_TRANSFER_NONE;
|
||||
|
||||
self->device = device;
|
||||
|
||||
@@ -353,6 +354,24 @@ transfer_finish_cb (GObject *source_object, GAsyncResult *res, gpointer user_dat
|
||||
fpi_usb_transfer_unref (transfer);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
transfer_cancel_cb (FpiUsbTransfer *transfer)
|
||||
{
|
||||
GError *error;
|
||||
FpiUsbTransferCallback callback;
|
||||
|
||||
error = g_error_new_literal (G_IO_ERROR,
|
||||
G_IO_ERROR_CANCELLED,
|
||||
"Transfer was cancelled before being started");
|
||||
callback = transfer->callback;
|
||||
transfer->callback = NULL;
|
||||
transfer->actual_length = -1;
|
||||
callback (transfer, transfer->device, transfer->user_data, error);
|
||||
|
||||
fpi_usb_transfer_unref (transfer);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
/**
|
||||
* fpi_usb_transfer_submit:
|
||||
@@ -386,6 +405,18 @@ fpi_usb_transfer_submit (FpiUsbTransfer *transfer,
|
||||
|
||||
log_transfer (transfer, TRUE, NULL);
|
||||
|
||||
/* Work around libgusb cancellation issue, see
|
||||
* https://github.com/hughsie/libgusb/pull/42
|
||||
* should be fixed with libgusb 0.3.7.
|
||||
* Note that this is not race free, we rely on libfprint and API users
|
||||
* not cancelling from a different thread here.
|
||||
*/
|
||||
if (cancellable && g_cancellable_is_cancelled (cancellable))
|
||||
{
|
||||
g_idle_add ((GSourceFunc) transfer_cancel_cb, transfer);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (transfer->type)
|
||||
{
|
||||
case FP_TRANSFER_BULK:
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <gusb.h>
|
||||
#include "fpi-compat.h"
|
||||
#include "fpi-device.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
@@ -47,10 +48,10 @@ typedef void (*FpiUsbTransferCallback)(FpiUsbTransfer *transfer,
|
||||
* Type of the transfer.
|
||||
*/
|
||||
typedef enum {
|
||||
FP_TRANSFER_NONE = 0,
|
||||
FP_TRANSFER_BULK,
|
||||
FP_TRANSFER_CONTROL,
|
||||
FP_TRANSFER_INTERRUPT,
|
||||
FP_TRANSFER_NONE = -1,
|
||||
FP_TRANSFER_CONTROL = 0,
|
||||
FP_TRANSFER_BULK = 2,
|
||||
FP_TRANSFER_INTERRUPT = 3,
|
||||
} FpiTransferType;
|
||||
|
||||
/**
|
||||
@@ -115,6 +116,7 @@ void fpi_usb_transfer_fill_bulk (FpiUsbTransfer *transfer,
|
||||
guint8 endpoint,
|
||||
gsize length);
|
||||
|
||||
FP_GNUC_ACCESS (read_only, 3, 4)
|
||||
void fpi_usb_transfer_fill_bulk_full (FpiUsbTransfer *transfer,
|
||||
guint8 endpoint,
|
||||
guint8 *buffer,
|
||||
@@ -134,6 +136,7 @@ void fpi_usb_transfer_fill_interrupt (FpiUsbTransfer *transfer,
|
||||
guint8 endpoint,
|
||||
gsize length);
|
||||
|
||||
FP_GNUC_ACCESS (read_only, 3, 4)
|
||||
void fpi_usb_transfer_fill_interrupt_full (FpiUsbTransfer *transfer,
|
||||
guint8 endpoint,
|
||||
guint8 *buffer,
|
||||
|
||||
@@ -25,11 +25,78 @@
|
||||
#include "fpi-device.h"
|
||||
|
||||
static const FpIdEntry whitelist_id_table[] = {
|
||||
/* Unsupported (for now) Validity Sensors finger print readers */
|
||||
{ .vid = 0x138a, .pid = 0x0090 }, /* Found on e.g. Lenovo T460s */
|
||||
/* Currently known and unsupported devices.
|
||||
* You can generate this list from the wiki page using e.g.:
|
||||
* gio cat https://gitlab.freedesktop.org/libfprint/wiki/-/wikis/Unsupported-Devices.md | sed -n 's!|.*\([0-9a-fA-F]\{4\}\):\([0-9a-fA-F]\{4\}\).*|.*! { .vid = 0x\1, .pid = 0x\2 },!p'
|
||||
*/
|
||||
{ .vid = 0x04f3, .pid = 0x036b },
|
||||
{ .vid = 0x04f3, .pid = 0x0c00 },
|
||||
{ .vid = 0x04f3, .pid = 0x0c4b },
|
||||
{ .vid = 0x04f3, .pid = 0x0c4c },
|
||||
{ .vid = 0x04f3, .pid = 0x0c4f },
|
||||
{ .vid = 0x04f3, .pid = 0x0c57 },
|
||||
{ .vid = 0x04f3, .pid = 0x2706 },
|
||||
{ .vid = 0x06cb, .pid = 0x0081 },
|
||||
{ .vid = 0x06cb, .pid = 0x0088 },
|
||||
{ .vid = 0x06cb, .pid = 0x008a },
|
||||
{ .vid = 0x06cb, .pid = 0x009a },
|
||||
{ .vid = 0x06cb, .pid = 0x009b },
|
||||
{ .vid = 0x06cb, .pid = 0x00a2 },
|
||||
{ .vid = 0x06cb, .pid = 0x00b7 },
|
||||
{ .vid = 0x06cb, .pid = 0x00bb },
|
||||
{ .vid = 0x06cb, .pid = 0x00be },
|
||||
{ .vid = 0x06cb, .pid = 0x00c2 },
|
||||
{ .vid = 0x06cb, .pid = 0x00c9 },
|
||||
{ .vid = 0x06cb, .pid = 0x00cb },
|
||||
{ .vid = 0x06cb, .pid = 0x00d8 },
|
||||
{ .vid = 0x06cb, .pid = 0x00da },
|
||||
{ .vid = 0x06cb, .pid = 0x00e7 },
|
||||
{ .vid = 0x0a5c, .pid = 0x5801 },
|
||||
{ .vid = 0x0a5c, .pid = 0x5805 },
|
||||
{ .vid = 0x0a5c, .pid = 0x5834 },
|
||||
{ .vid = 0x0a5c, .pid = 0x5843 },
|
||||
{ .vid = 0x10a5, .pid = 0x0007 },
|
||||
{ .vid = 0x1188, .pid = 0x9545 },
|
||||
{ .vid = 0x138a, .pid = 0x0007 },
|
||||
{ .vid = 0x138a, .pid = 0x003a },
|
||||
{ .vid = 0x138a, .pid = 0x003c },
|
||||
{ .vid = 0x138a, .pid = 0x003d },
|
||||
{ .vid = 0x138a, .pid = 0x003f },
|
||||
{ .vid = 0x138a, .pid = 0x0090 },
|
||||
{ .vid = 0x138a, .pid = 0x0091 },
|
||||
{ .vid = 0x138a, .pid = 0x0092 },
|
||||
{ .vid = 0x138a, .pid = 0x0094 },
|
||||
{ .vid = 0x138a, .pid = 0x0097 }, /* Found on e.g. Lenovo T470s */
|
||||
{ .vid = 0x138a, .pid = 0x0097 },
|
||||
{ .vid = 0x138a, .pid = 0x009d },
|
||||
{ .vid = 0x138a, .pid = 0x00ab },
|
||||
{ .vid = 0x147e, .pid = 0x1002 },
|
||||
{ .vid = 0x1491, .pid = 0x0088 },
|
||||
{ .vid = 0x16d1, .pid = 0x1027 },
|
||||
{ .vid = 0x1c7a, .pid = 0x0300 },
|
||||
{ .vid = 0x1c7a, .pid = 0x0570 },
|
||||
{ .vid = 0x1c7a, .pid = 0x0575 },
|
||||
{ .vid = 0x27c6, .pid = 0x5042 },
|
||||
{ .vid = 0x27c6, .pid = 0x5110 },
|
||||
{ .vid = 0x27c6, .pid = 0x5117 },
|
||||
{ .vid = 0x27c6, .pid = 0x5201 },
|
||||
{ .vid = 0x27c6, .pid = 0x521d },
|
||||
{ .vid = 0x27c6, .pid = 0x5301 },
|
||||
{ .vid = 0x27c6, .pid = 0x530c },
|
||||
{ .vid = 0x27c6, .pid = 0x532d },
|
||||
{ .vid = 0x27c6, .pid = 0x533c },
|
||||
{ .vid = 0x27c6, .pid = 0x5381 },
|
||||
{ .vid = 0x27c6, .pid = 0x5385 },
|
||||
{ .vid = 0x27c6, .pid = 0x538c },
|
||||
{ .vid = 0x27c6, .pid = 0x538d },
|
||||
{ .vid = 0x27c6, .pid = 0x5395 },
|
||||
{ .vid = 0x27c6, .pid = 0x5584 },
|
||||
{ .vid = 0x27c6, .pid = 0x55a2 },
|
||||
{ .vid = 0x27c6, .pid = 0x55a4 },
|
||||
{ .vid = 0x27c6, .pid = 0x55b4 },
|
||||
{ .vid = 0x27c6, .pid = 0x5740 },
|
||||
{ .vid = 0x2808, .pid = 0x9338 },
|
||||
{ .vid = 0x298d, .pid = 0x2033 },
|
||||
{ .vid = 0x3538, .pid = 0x0930 },
|
||||
{ .vid = 0 },
|
||||
};
|
||||
|
||||
|
||||
@@ -161,6 +161,12 @@ foreach driver: drivers
|
||||
'drivers/synaptics/bmkt_message.c',
|
||||
]
|
||||
endif
|
||||
if driver == 'goodixmoc'
|
||||
drivers_sources += [
|
||||
'drivers/goodixmoc/goodix.c',
|
||||
'drivers/goodixmoc/goodix_proto.c',
|
||||
]
|
||||
endif
|
||||
endforeach
|
||||
|
||||
if aeslib
|
||||
@@ -228,6 +234,8 @@ libnbis = static_library('nbis',
|
||||
'-Wno-error=redundant-decls',
|
||||
'-Wno-redundant-decls',
|
||||
'-Wno-discarded-qualifiers',
|
||||
'-Wno-array-bounds',
|
||||
'-Wno-array-parameter',
|
||||
]),
|
||||
install: false)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
project('libfprint', [ 'c', 'cpp' ],
|
||||
version: '1.90.2',
|
||||
version: '1.90.7',
|
||||
license: 'LGPLv2.1+',
|
||||
default_options: [
|
||||
'buildtype=debugoptimized',
|
||||
@@ -110,6 +110,7 @@ default_drivers = [
|
||||
'upektc',
|
||||
'upeksonly',
|
||||
'upekts',
|
||||
'goodixmoc',
|
||||
]
|
||||
|
||||
all_drivers = default_drivers + virtual_drivers
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
To create a new umockdev test, you should:
|
||||
|
||||
1. Decide on what to test, the easiest case is just using the existing
|
||||
capture test case.
|
||||
2. Find the USB device you are testing with lsusb, e.g.:
|
||||
Bus 001 Device 005: ID 138a:0090 Validity Sensors, Inc. VFS7500 Touch Fingerprint Sensor
|
||||
This means we need to record USB device /dev/bus/usb/001/005
|
||||
3. Run "umockdev-record /dev/bus/usb/001/005 >device"
|
||||
This records the information about device, it should be placed into test/DRIVER/device
|
||||
4. Run the test, for a capture test this would be:
|
||||
umockdev-record -i /dev/bus/usb/001/005=capture.ioctl -- ./capture.py capture.png
|
||||
This will create a capture.ioctl and capture.png file.
|
||||
Please set the FP_DEVICE_EMULATION=1 environment variable. You may need
|
||||
to adjust the driver to adapt to the emulated environment (mainly if it
|
||||
uses random numbers, see synaptics.c for an example).
|
||||
5. Place all files into the driver subdirectory test/DRIVER,
|
||||
i.e. device, capture.ioctl, capture.png
|
||||
6. Add glue to meson.build
|
||||
7. Test whether everything works as expected
|
||||
|
||||
Please note, there is no need to use a real finger print in this case. If
|
||||
you would like to avoid submitting your own fingerprint then please just
|
||||
use e.g. the side of your finger, arm, or anything else that will produce
|
||||
an image with the device.
|
||||
|
||||
|
||||
Note that umockdev-record groups URBs aggressively. In most cases, manual
|
||||
intervention is unfortunately required. In most cases, drivers do a chain
|
||||
of commands like e.g. A then B each with a different reply. Umockdev will
|
||||
create a file like:
|
||||
|
||||
A
|
||||
reply 1
|
||||
reply 2
|
||||
B
|
||||
reply 1
|
||||
reply 2
|
||||
|
||||
which then needs to be re-ordered to be:
|
||||
|
||||
A
|
||||
reply 1
|
||||
B
|
||||
reply 1
|
||||
A
|
||||
reply 2
|
||||
B
|
||||
reply 2
|
||||
|
||||
Other changes may be needed to get everything working. For example the elan
|
||||
driver relies on a timeout that is not reported correctly. In this case the
|
||||
driver works around it by interpreting the protocol error differently in
|
||||
the virtual environment.
|
||||
@@ -27,7 +27,7 @@ A new 'capture' test is created by means of `capture.py` script:
|
||||
- `export LD_PRELOAD=<meson-build-dir>/libfprint/libfprint-2.so`
|
||||
- `export GI_TYPELIB_PATH=<meson-build-dir>/libfprint`
|
||||
|
||||
Also, sometimes the driver must be adopted to the emulated environment
|
||||
Also, sometimes the driver must be adapted to the emulated environment
|
||||
(mainly if it uses random numbers, see `synaptics.c` for an example).
|
||||
Set the following environment variable to enable this adaptation:
|
||||
- `export FP_DEVICE_EMULATION=1`
|
||||
@@ -41,6 +41,11 @@ A new 'capture' test is created by means of `capture.py` script:
|
||||
The following USB device is used in the example above:
|
||||
`/dev/bus/usb/001/005`.
|
||||
|
||||
For the following commands, it is assumed that the user that's
|
||||
running the commands has full access to the device node, whether
|
||||
by running the commands as `root`, or changing the permissions for
|
||||
that device node.
|
||||
|
||||
4. Record information about this device:
|
||||
|
||||
`umockdev-record /dev/bus/usb/001/005 > DRIVER/device`
|
||||
|
||||
13
tests/aes3500/capture.ioctl
Normal file
13
tests/aes3500/capture.ioctl
Normal file
File diff suppressed because one or more lines are too long
BIN
tests/aes3500/capture.png
Normal file
BIN
tests/aes3500/capture.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
561
tests/aes3500/device
Normal file
561
tests/aes3500/device
Normal file
@@ -0,0 +1,561 @@
|
||||
P: /devices/pci0000:00/0000:00:1c.0/0000:01:00.0/0000:02:02.0/0000:39:00.0/usb3/3-1/3-1.1/3-1.1.3
|
||||
N: bus/usb/003/004=12011001FFFFFF08FF0831570000000100010902200001010080320904000002FFFFFF000705810240000007050202080000
|
||||
E: BUSNUM=003
|
||||
E: DEVNAME=/dev/bus/usb/003/004
|
||||
E: DEVNUM=004
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: ID_BUS=usb
|
||||
E: ID_MODEL=Fingerprint_Sensor
|
||||
E: ID_MODEL_ENC=Fingerprint\x20Sensor
|
||||
E: ID_MODEL_FROM_DATABASE=AES3500 TruePrint Sensor
|
||||
E: ID_MODEL_ID=5731
|
||||
E: ID_REVISION=0000
|
||||
E: ID_SERIAL=08ff_Fingerprint_Sensor
|
||||
E: ID_USB_INTERFACES=:ffffff:
|
||||
E: ID_VENDOR=08ff
|
||||
E: ID_VENDOR_ENC=08ff
|
||||
E: ID_VENDOR_FROM_DATABASE=AuthenTec, Inc.
|
||||
E: ID_VENDOR_ID=08ff
|
||||
E: LIBFPRINT_DRIVER=AuthenTec AES3500
|
||||
E: MAJOR=189
|
||||
E: MINOR=259
|
||||
E: PRODUCT=8ff/5731/0
|
||||
E: SUBSYSTEM=usb
|
||||
E: TYPE=255/255/255
|
||||
A: authorized=1
|
||||
A: avoid_reset_quirk=0
|
||||
A: bConfigurationValue=1
|
||||
A: bDeviceClass=ff
|
||||
A: bDeviceProtocol=ff
|
||||
A: bDeviceSubClass=ff
|
||||
A: bMaxPacketSize0=8
|
||||
A: bMaxPower=100mA
|
||||
A: bNumConfigurations=1
|
||||
A: bNumInterfaces= 1
|
||||
A: bcdDevice=0000
|
||||
A: bmAttributes=80
|
||||
A: busnum=3
|
||||
A: configuration=
|
||||
H: descriptors=12011001FFFFFF08FF0831570000000100010902200001010080320904000002FFFFFF000705810240000007050202080000
|
||||
A: dev=189:259
|
||||
A: devnum=4
|
||||
A: devpath=1.1.3
|
||||
L: driver=../../../../../../../../../../bus/usb/drivers/usb
|
||||
A: idProduct=5731
|
||||
A: idVendor=08ff
|
||||
A: ltm_capable=no
|
||||
A: maxchild=0
|
||||
L: port=../3-1.1:1.0/3-1.1-port3
|
||||
A: power/active_duration=3601332
|
||||
A: power/async=enabled
|
||||
A: power/autosuspend=2
|
||||
A: power/autosuspend_delay_ms=2000
|
||||
A: power/connected_duration=3601332
|
||||
A: power/control=auto
|
||||
A: power/level=auto
|
||||
A: power/persist=1
|
||||
A: power/runtime_active_kids=0
|
||||
A: power/runtime_active_time=3601128
|
||||
A: power/runtime_enabled=enabled
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=0
|
||||
A: power/runtime_usage=0
|
||||
A: product=Fingerprint Sensor
|
||||
A: quirks=0x0
|
||||
A: removable=removable
|
||||
A: speed=12
|
||||
A: urbnum=82
|
||||
A: version= 1.10
|
||||
|
||||
P: /devices/pci0000:00/0000:00:1c.0/0000:01:00.0/0000:02:02.0/0000:39:00.0/usb3/3-1/3-1.1
|
||||
N: bus/usb/003/003=12011002090001403022060000910102000109021900010100E0000904000001090000000705810301000C
|
||||
E: BUSNUM=003
|
||||
E: DEVNAME=/dev/bus/usb/003/003
|
||||
E: DEVNUM=003
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: ID_BUS=usb
|
||||
E: ID_FOR_SEAT=usb-pci-0000_39_00_0-usb-0_1_1
|
||||
E: ID_MODEL=USB2.0_Hub
|
||||
E: ID_MODEL_ENC=USB2.0\x20Hub\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
|
||||
E: ID_MODEL_ID=0006
|
||||
E: ID_PATH=pci-0000:39:00.0-usb-0:1.1
|
||||
E: ID_PATH_TAG=pci-0000_39_00_0-usb-0_1_1
|
||||
E: ID_REVISION=9100
|
||||
E: ID_SERIAL=VIA_Labs__Inc._USB2.0_Hub
|
||||
E: ID_USB_INTERFACES=:090000:
|
||||
E: ID_VENDOR=VIA_Labs__Inc.
|
||||
E: ID_VENDOR_ENC=VIA\x20Labs\x2c\x20Inc.\x20\x20\x20\x20\x20\x20\x20\x20\x20
|
||||
E: ID_VENDOR_ID=2230
|
||||
E: MAJOR=189
|
||||
E: MINOR=258
|
||||
E: PRODUCT=2230/6/9100
|
||||
E: SUBSYSTEM=usb
|
||||
E: TAGS=:seat:
|
||||
E: TYPE=9/0/1
|
||||
A: authorized=1
|
||||
A: avoid_reset_quirk=0
|
||||
A: bConfigurationValue=1
|
||||
A: bDeviceClass=09
|
||||
A: bDeviceProtocol=01
|
||||
A: bDeviceSubClass=00
|
||||
A: bMaxPacketSize0=64
|
||||
A: bMaxPower=0mA
|
||||
A: bNumConfigurations=1
|
||||
A: bNumInterfaces= 1
|
||||
A: bcdDevice=9100
|
||||
A: bmAttributes=e0
|
||||
A: busnum=3
|
||||
A: configuration=
|
||||
H: descriptors=12011002090001403022060000910102000109021900010100E0000904000001090000000705810301000C
|
||||
A: dev=189:258
|
||||
A: devnum=3
|
||||
A: devpath=1.1
|
||||
L: driver=../../../../../../../../../bus/usb/drivers/usb
|
||||
A: idProduct=0006
|
||||
A: idVendor=2230
|
||||
A: ltm_capable=no
|
||||
A: manufacturer=VIA Labs, Inc.
|
||||
A: maxchild=4
|
||||
L: port=../3-1:1.0/3-1-port1
|
||||
A: power/active_duration=3601776
|
||||
A: power/async=enabled
|
||||
A: power/autosuspend=0
|
||||
A: power/autosuspend_delay_ms=0
|
||||
A: power/connected_duration=3601776
|
||||
A: power/control=auto
|
||||
A: power/level=auto
|
||||
A: power/runtime_active_kids=2
|
||||
A: power/runtime_active_time=3601572
|
||||
A: power/runtime_enabled=enabled
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=0
|
||||
A: power/runtime_usage=0
|
||||
A: power/wakeup=disabled
|
||||
A: power/wakeup_abort_count=
|
||||
A: power/wakeup_active=
|
||||
A: power/wakeup_active_count=
|
||||
A: power/wakeup_count=
|
||||
A: power/wakeup_expire_count=
|
||||
A: power/wakeup_last_time_ms=
|
||||
A: power/wakeup_max_time_ms=
|
||||
A: power/wakeup_total_time_ms=
|
||||
A: product=USB2.0 Hub
|
||||
A: quirks=0x0
|
||||
A: removable=fixed
|
||||
A: speed=480
|
||||
A: urbnum=40
|
||||
A: version= 2.10
|
||||
|
||||
P: /devices/pci0000:00/0000:00:1c.0/0000:01:00.0/0000:02:02.0/0000:39:00.0/usb3/3-1
|
||||
N: bus/usb/003/002=12011002090001403022060000910102000109021900010100E0000904000001090000000705810301000C
|
||||
E: BUSNUM=003
|
||||
E: DEVNAME=/dev/bus/usb/003/002
|
||||
E: DEVNUM=002
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: ID_BUS=usb
|
||||
E: ID_FOR_SEAT=usb-pci-0000_39_00_0-usb-0_1
|
||||
E: ID_MODEL=USB2.0_Hub
|
||||
E: ID_MODEL_ENC=USB2.0\x20Hub\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
|
||||
E: ID_MODEL_ID=0006
|
||||
E: ID_PATH=pci-0000:39:00.0-usb-0:1
|
||||
E: ID_PATH_TAG=pci-0000_39_00_0-usb-0_1
|
||||
E: ID_REVISION=9100
|
||||
E: ID_SERIAL=VIA_Labs__Inc._USB2.0_Hub
|
||||
E: ID_USB_INTERFACES=:090000:
|
||||
E: ID_VENDOR=VIA_Labs__Inc.
|
||||
E: ID_VENDOR_ENC=VIA\x20Labs\x2c\x20Inc.\x20\x20\x20\x20\x20\x20\x20\x20\x20
|
||||
E: ID_VENDOR_ID=2230
|
||||
E: MAJOR=189
|
||||
E: MINOR=257
|
||||
E: PRODUCT=2230/6/9100
|
||||
E: SUBSYSTEM=usb
|
||||
E: TAGS=:seat:
|
||||
E: TYPE=9/0/1
|
||||
A: authorized=1
|
||||
A: avoid_reset_quirk=0
|
||||
A: bConfigurationValue=1
|
||||
A: bDeviceClass=09
|
||||
A: bDeviceProtocol=01
|
||||
A: bDeviceSubClass=00
|
||||
A: bMaxPacketSize0=64
|
||||
A: bMaxPower=0mA
|
||||
A: bNumConfigurations=1
|
||||
A: bNumInterfaces= 1
|
||||
A: bcdDevice=9100
|
||||
A: bmAttributes=e0
|
||||
A: busnum=3
|
||||
A: configuration=
|
||||
H: descriptors=12011002090001403022060000910102000109021900010100E0000904000001090000000705810301000C
|
||||
A: dev=189:257
|
||||
A: devnum=2
|
||||
A: devpath=1
|
||||
L: driver=../../../../../../../../bus/usb/drivers/usb
|
||||
A: idProduct=0006
|
||||
A: idVendor=2230
|
||||
A: ltm_capable=no
|
||||
A: manufacturer=VIA Labs, Inc.
|
||||
A: maxchild=4
|
||||
L: port=../3-0:1.0/usb3-port1
|
||||
A: power/active_duration=3602292
|
||||
A: power/async=enabled
|
||||
A: power/autosuspend=0
|
||||
A: power/autosuspend_delay_ms=0
|
||||
A: power/connected_duration=3602292
|
||||
A: power/control=auto
|
||||
A: power/level=auto
|
||||
A: power/runtime_active_kids=1
|
||||
A: power/runtime_active_time=3602016
|
||||
A: power/runtime_enabled=enabled
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=0
|
||||
A: power/runtime_usage=0
|
||||
A: power/wakeup=disabled
|
||||
A: power/wakeup_abort_count=
|
||||
A: power/wakeup_active=
|
||||
A: power/wakeup_active_count=
|
||||
A: power/wakeup_count=
|
||||
A: power/wakeup_expire_count=
|
||||
A: power/wakeup_last_time_ms=
|
||||
A: power/wakeup_max_time_ms=
|
||||
A: power/wakeup_total_time_ms=
|
||||
A: product=USB2.0 Hub
|
||||
A: quirks=0x0
|
||||
A: removable=removable
|
||||
A: speed=480
|
||||
A: urbnum=31
|
||||
A: version= 2.10
|
||||
|
||||
P: /devices/pci0000:00/0000:00:1c.0/0000:01:00.0/0000:02:02.0/0000:39:00.0/usb3
|
||||
N: bus/usb/003/001=12010002090001406B1D020015040302010109021900010100E0000904000001090000000705810304000C
|
||||
E: BUSNUM=003
|
||||
E: DEVNAME=/dev/bus/usb/003/001
|
||||
E: DEVNUM=001
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: ID_BUS=usb
|
||||
E: ID_FOR_SEAT=usb-pci-0000_39_00_0
|
||||
E: ID_MODEL=xHCI_Host_Controller
|
||||
E: ID_MODEL_ENC=xHCI\x20Host\x20Controller
|
||||
E: ID_MODEL_FROM_DATABASE=2.0 root hub
|
||||
E: ID_MODEL_ID=0002
|
||||
E: ID_PATH=pci-0000:39:00.0
|
||||
E: ID_PATH_TAG=pci-0000_39_00_0
|
||||
E: ID_REVISION=0415
|
||||
E: ID_SERIAL=Linux_4.15.0-117-generic_xhci-hcd_xHCI_Host_Controller_0000:39:00.0
|
||||
E: ID_SERIAL_SHORT=0000:39:00.0
|
||||
E: ID_USB_INTERFACES=:090000:
|
||||
E: ID_VENDOR=Linux_4.15.0-117-generic_xhci-hcd
|
||||
E: ID_VENDOR_ENC=Linux\x204.15.0-117-generic\x20xhci-hcd
|
||||
E: ID_VENDOR_FROM_DATABASE=Linux Foundation
|
||||
E: ID_VENDOR_ID=1d6b
|
||||
E: MAJOR=189
|
||||
E: MINOR=256
|
||||
E: PRODUCT=1d6b/2/415
|
||||
E: SUBSYSTEM=usb
|
||||
E: TAGS=:seat:
|
||||
E: TYPE=9/0/1
|
||||
A: authorized=1
|
||||
A: authorized_default=1
|
||||
A: avoid_reset_quirk=0
|
||||
A: bConfigurationValue=1
|
||||
A: bDeviceClass=09
|
||||
A: bDeviceProtocol=01
|
||||
A: bDeviceSubClass=00
|
||||
A: bMaxPacketSize0=64
|
||||
A: bMaxPower=0mA
|
||||
A: bNumConfigurations=1
|
||||
A: bNumInterfaces= 1
|
||||
A: bcdDevice=0415
|
||||
A: bmAttributes=e0
|
||||
A: busnum=3
|
||||
A: configuration=
|
||||
H: descriptors=12010002090001406B1D020015040302010109021900010100E0000904000001090000000705810304000C
|
||||
A: dev=189:256
|
||||
A: devnum=1
|
||||
A: devpath=0
|
||||
L: driver=../../../../../../../bus/usb/drivers/usb
|
||||
A: idProduct=0002
|
||||
A: idVendor=1d6b
|
||||
A: interface_authorized_default=1
|
||||
A: ltm_capable=no
|
||||
A: manufacturer=Linux 4.15.0-117-generic xhci-hcd
|
||||
A: maxchild=2
|
||||
A: power/active_duration=3602700
|
||||
A: power/async=enabled
|
||||
A: power/autosuspend=0
|
||||
A: power/autosuspend_delay_ms=0
|
||||
A: power/connected_duration=3602700
|
||||
A: power/control=auto
|
||||
A: power/level=auto
|
||||
A: power/runtime_active_kids=1
|
||||
A: power/runtime_active_time=3602700
|
||||
A: power/runtime_enabled=enabled
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=0
|
||||
A: power/runtime_usage=0
|
||||
A: power/wakeup=disabled
|
||||
A: power/wakeup_abort_count=
|
||||
A: power/wakeup_active=
|
||||
A: power/wakeup_active_count=
|
||||
A: power/wakeup_count=
|
||||
A: power/wakeup_expire_count=
|
||||
A: power/wakeup_last_time_ms=
|
||||
A: power/wakeup_max_time_ms=
|
||||
A: power/wakeup_total_time_ms=
|
||||
A: product=xHCI Host Controller
|
||||
A: quirks=0x0
|
||||
A: removable=unknown
|
||||
A: serial=0000:39:00.0
|
||||
A: speed=480
|
||||
A: urbnum=24
|
||||
A: version= 2.00
|
||||
|
||||
P: /devices/pci0000:00/0000:00:1c.0/0000:01:00.0/0000:02:02.0/0000:39:00.0
|
||||
E: DRIVER=xhci_hcd
|
||||
E: ID_MODEL_FROM_DATABASE=DSL6340 USB 3.1 Controller [Alpine Ridge]
|
||||
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
|
||||
E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI
|
||||
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
|
||||
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
|
||||
E: MODALIAS=pci:v00008086d000015B5sv00002222sd00001111bc0Csc03i30
|
||||
E: PCI_CLASS=C0330
|
||||
E: PCI_ID=8086:15B5
|
||||
E: PCI_SLOT_NAME=0000:39:00.0
|
||||
E: PCI_SUBSYS_ID=2222:1111
|
||||
E: SUBSYSTEM=pci
|
||||
A: broken_parity_status=0
|
||||
A: class=0x0c0330
|
||||
H: config=8680B515060410000030030C200000000000F0D9000000000000000000000000000000000000000000000000222211110000000080000000000000000B010000
|
||||
A: consistent_dma_mask_bits=64
|
||||
A: current_link_speed=2.5 GT/s
|
||||
A: current_link_width=4
|
||||
A: d3cold_allowed=1
|
||||
A: dbc=disabled
|
||||
A: device=0x15b5
|
||||
A: dma_mask_bits=64
|
||||
L: driver=../../../../../../bus/pci/drivers/xhci_hcd
|
||||
A: driver_override=(null)
|
||||
A: enable=1
|
||||
L: iommu=../../../../../virtual/iommu/dmar1
|
||||
L: iommu_group=../../../../../../kernel/iommu_groups/17
|
||||
A: irq=141
|
||||
A: local_cpulist=0-3
|
||||
A: local_cpus=f
|
||||
A: max_link_speed=2.5 GT/s
|
||||
A: max_link_width=4
|
||||
A: modalias=pci:v00008086d000015B5sv00002222sd00001111bc0Csc03i30
|
||||
A: msi_bus=1
|
||||
A: msi_irqs/141=msi
|
||||
A: numa_node=-1
|
||||
A: pools=poolinfo - 0.1\nbuffer-2048 3 6 2048 3\nbuffer-512 12 16 512 2\nbuffer-128 0 0 128 0\nbuffer-32 0 0 32 0\nxHCI 1KB stream ctx arrays 0 0 1024 0\nxHCI 256 byte stream ctx arrays 0 0 256 0\nxHCI input/output contexts 15 15 2112 15\nxHCI ring segments 44 46 4096 46\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 3 32 128 1\nbuffer-32 0 0 32 0
|
||||
A: power/async=enabled
|
||||
A: power/control=on
|
||||
A: power/runtime_active_kids=2
|
||||
A: power/runtime_active_time=3602712
|
||||
A: power/runtime_enabled=forbidden
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=0
|
||||
A: power/runtime_usage=1
|
||||
A: power/wakeup=enabled
|
||||
A: power/wakeup_abort_count=0
|
||||
A: power/wakeup_active=0
|
||||
A: power/wakeup_active_count=0
|
||||
A: power/wakeup_count=0
|
||||
A: power/wakeup_expire_count=0
|
||||
A: power/wakeup_last_time_ms=224549241
|
||||
A: power/wakeup_max_time_ms=0
|
||||
A: power/wakeup_total_time_ms=0
|
||||
A: resource=0x00000000d9f00000 0x00000000d9f0ffff 0x0000000000040200\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000
|
||||
A: revision=0x00
|
||||
A: subsystem_device=0x1111
|
||||
A: subsystem_vendor=0x2222
|
||||
A: vendor=0x8086
|
||||
|
||||
P: /devices/pci0000:00/0000:00:1c.0/0000:01:00.0/0000:02:02.0
|
||||
E: DRIVER=pcieport
|
||||
E: ID_MODEL_FROM_DATABASE=DSL6340 Thunderbolt 3 Bridge [Alpine Ridge 2C 2015]
|
||||
E: ID_PCI_CLASS_FROM_DATABASE=Bridge
|
||||
E: ID_PCI_INTERFACE_FROM_DATABASE=Normal decode
|
||||
E: ID_PCI_SUBCLASS_FROM_DATABASE=PCI bridge
|
||||
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
|
||||
E: MODALIAS=pci:v00008086d00001576sv00002222sd00001111bc06sc04i00
|
||||
E: PCI_CLASS=60400
|
||||
E: PCI_ID=8086:1576
|
||||
E: PCI_SLOT_NAME=0000:02:02.0
|
||||
E: PCI_SUBSYS_ID=2222:1111
|
||||
E: SUBSYSTEM=pci
|
||||
A: broken_parity_status=0
|
||||
A: class=0x060400
|
||||
H: config=86807615060410000000040620000100000000000000000002393900F1010000F0D9F0D9F1FF010000000000000000000000000080000000000000000B011000
|
||||
A: consistent_dma_mask_bits=32
|
||||
A: current_link_speed=2.5 GT/s
|
||||
A: current_link_width=4
|
||||
A: d3cold_allowed=1
|
||||
A: device=0x1576
|
||||
A: dma_mask_bits=32
|
||||
L: driver=../../../../../bus/pci/drivers/pcieport
|
||||
A: driver_override=(null)
|
||||
A: enable=1
|
||||
L: iommu=../../../../virtual/iommu/dmar1
|
||||
L: iommu_group=../../../../../kernel/iommu_groups/17
|
||||
A: irq=140
|
||||
A: local_cpulist=0-3
|
||||
A: local_cpus=f
|
||||
A: max_link_speed=2.5 GT/s
|
||||
A: max_link_width=4
|
||||
A: modalias=pci:v00008086d00001576sv00002222sd00001111bc06sc04i00
|
||||
A: msi_bus=1
|
||||
A: msi_irqs/140=msi
|
||||
A: numa_node=-1
|
||||
A: power/async=enabled
|
||||
A: power/clk_ctl=0
|
||||
A: power/control=on
|
||||
A: power/link_state=0
|
||||
A: power/runtime_active_kids=1
|
||||
A: power/runtime_active_time=3602728
|
||||
A: power/runtime_enabled=forbidden
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=0
|
||||
A: power/runtime_usage=2
|
||||
A: power/wakeup=disabled
|
||||
A: power/wakeup_abort_count=
|
||||
A: power/wakeup_active=
|
||||
A: power/wakeup_active_count=
|
||||
A: power/wakeup_count=
|
||||
A: power/wakeup_expire_count=
|
||||
A: power/wakeup_last_time_ms=
|
||||
A: power/wakeup_max_time_ms=
|
||||
A: power/wakeup_total_time_ms=
|
||||
A: resource=0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x00000000d9f00000 0x00000000d9ffffff 0x0000000000000200\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000
|
||||
A: revision=0x00
|
||||
A: secondary_bus_number=57
|
||||
A: subordinate_bus_number=57
|
||||
A: subsystem_device=0x1111
|
||||
A: subsystem_vendor=0x2222
|
||||
A: vendor=0x8086
|
||||
|
||||
P: /devices/pci0000:00/0000:00:1c.0/0000:01:00.0
|
||||
E: DRIVER=pcieport
|
||||
E: ID_MODEL_FROM_DATABASE=DSL6340 Thunderbolt 3 Bridge [Alpine Ridge 2C 2015]
|
||||
E: ID_PCI_CLASS_FROM_DATABASE=Bridge
|
||||
E: ID_PCI_INTERFACE_FROM_DATABASE=Normal decode
|
||||
E: ID_PCI_SUBCLASS_FROM_DATABASE=PCI bridge
|
||||
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
|
||||
E: MODALIAS=pci:v00008086d00001576sv00002222sd00001111bc06sc04i00
|
||||
E: PCI_CLASS=60400
|
||||
E: PCI_ID=8086:1576
|
||||
E: PCI_SLOT_NAME=0000:01:00.0
|
||||
E: PCI_SUBSYS_ID=2222:1111
|
||||
E: SUBSYSTEM=pci
|
||||
A: broken_parity_status=0
|
||||
A: class=0x060400
|
||||
H: config=86807615060410000000040620000100000000000000000001023900F101000000C400DA01A0F1C100000000000000000000000080000000000000000B011000
|
||||
A: consistent_dma_mask_bits=32
|
||||
A: current_link_speed=8 GT/s
|
||||
A: current_link_width=2
|
||||
A: d3cold_allowed=1
|
||||
A: device=0x1576
|
||||
A: dma_mask_bits=32
|
||||
L: driver=../../../../bus/pci/drivers/pcieport
|
||||
A: driver_override=(null)
|
||||
A: enable=1
|
||||
L: iommu=../../../virtual/iommu/dmar1
|
||||
L: iommu_group=../../../../kernel/iommu_groups/14
|
||||
A: irq=137
|
||||
A: local_cpulist=0-3
|
||||
A: local_cpus=f
|
||||
A: max_link_speed=8 GT/s
|
||||
A: max_link_width=4
|
||||
A: modalias=pci:v00008086d00001576sv00002222sd00001111bc06sc04i00
|
||||
A: msi_bus=1
|
||||
A: msi_irqs/137=msi
|
||||
A: numa_node=-1
|
||||
A: power/async=enabled
|
||||
A: power/control=on
|
||||
A: power/runtime_active_kids=2
|
||||
A: power/runtime_active_time=3602740
|
||||
A: power/runtime_enabled=forbidden
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=0
|
||||
A: power/runtime_usage=2
|
||||
A: power/wakeup=enabled
|
||||
A: power/wakeup_abort_count=0
|
||||
A: power/wakeup_active=0
|
||||
A: power/wakeup_active_count=0
|
||||
A: power/wakeup_count=0
|
||||
A: power/wakeup_expire_count=0
|
||||
A: power/wakeup_last_time_ms=224549237
|
||||
A: power/wakeup_max_time_ms=0
|
||||
A: power/wakeup_total_time_ms=0
|
||||
A: resource=0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x00000000c4000000 0x00000000da0fffff 0x0000000000000200\n0x00000000a0000000 0x00000000c1ffffff 0x0000000000102201\n0x0000000000000000 0x0000000000000000 0x0000000000000000
|
||||
A: revision=0x00
|
||||
A: secondary_bus_number=2
|
||||
A: subordinate_bus_number=57
|
||||
A: subsystem_device=0x1111
|
||||
A: subsystem_vendor=0x2222
|
||||
A: vendor=0x8086
|
||||
|
||||
P: /devices/pci0000:00/0000:00:1c.0
|
||||
E: DRIVER=pcieport
|
||||
E: ID_MODEL_FROM_DATABASE=Sunrise Point-LP PCI Express Root Port
|
||||
E: ID_PCI_CLASS_FROM_DATABASE=Bridge
|
||||
E: ID_PCI_INTERFACE_FROM_DATABASE=Normal decode
|
||||
E: ID_PCI_SUBCLASS_FROM_DATABASE=PCI bridge
|
||||
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
|
||||
E: MODALIAS=pci:v00008086d00009D10sv00001028sd0000075Bbc06sc04i00
|
||||
E: PCI_CLASS=60400
|
||||
E: PCI_ID=8086:9D10
|
||||
E: PCI_SLOT_NAME=0000:00:1c.0
|
||||
E: PCI_SUBSYS_ID=1028:075B
|
||||
E: SUBSYSTEM=pci
|
||||
A: broken_parity_status=0
|
||||
A: class=0x060400
|
||||
H: config=8680109D07041000F1000406000081000000000000000000000139002020002000C400DA01A0F1C100000000000000000000000040000000000000000B011000
|
||||
A: consistent_dma_mask_bits=32
|
||||
A: current_link_speed=8 GT/s
|
||||
A: current_link_width=2
|
||||
A: d3cold_allowed=1
|
||||
A: device=0x9d10
|
||||
A: dma_mask_bits=32
|
||||
L: driver=../../../bus/pci/drivers/pcieport
|
||||
A: driver_override=(null)
|
||||
A: enable=1
|
||||
L: iommu=../../virtual/iommu/dmar1
|
||||
L: iommu_group=../../../kernel/iommu_groups/6
|
||||
A: irq=123
|
||||
A: local_cpulist=0-3
|
||||
A: local_cpus=f
|
||||
A: max_link_speed=8 GT/s
|
||||
A: max_link_width=2
|
||||
A: modalias=pci:v00008086d00009D10sv00001028sd0000075Bbc06sc04i00
|
||||
A: msi_bus=1
|
||||
A: msi_irqs/123=msi
|
||||
A: numa_node=-1
|
||||
A: power/async=enabled
|
||||
A: power/control=on
|
||||
A: power/runtime_active_kids=1
|
||||
A: power/runtime_active_time=228151860
|
||||
A: power/runtime_enabled=forbidden
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=0
|
||||
A: power/runtime_usage=2
|
||||
A: power/wakeup=disabled
|
||||
A: power/wakeup_abort_count=
|
||||
A: power/wakeup_active=
|
||||
A: power/wakeup_active_count=
|
||||
A: power/wakeup_count=
|
||||
A: power/wakeup_expire_count=
|
||||
A: power/wakeup_last_time_ms=
|
||||
A: power/wakeup_max_time_ms=
|
||||
A: power/wakeup_total_time_ms=
|
||||
A: resource=0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000002000 0x0000000000002fff 0x0000000000000100\n0x00000000c4000000 0x00000000da0fffff 0x0000000000000200\n0x00000000a0000000 0x00000000c1ffffff 0x0000000000102201\n0x0000000000000000 0x0000000000000000 0x0000000000000000
|
||||
A: revision=0xf1
|
||||
A: secondary_bus_number=1
|
||||
A: subordinate_bus_number=57
|
||||
A: subsystem_device=0x075b
|
||||
A: subsystem_vendor=0x1028
|
||||
A: vendor=0x8086
|
||||
|
||||
307
tests/goodixmoc/custom.ioctl
Normal file
307
tests/goodixmoc/custom.ioctl
Normal file
@@ -0,0 +1,307 @@
|
||||
@DEV /dev/bus/usb/001/003
|
||||
USBDEVFS_GET_CAPABILITIES 0 FD010000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 D00000000500BA4500611A297F
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00000008009D6200D00001B5A57582000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 192 0 D0000001850067980001FE415050000000000030313030303232384C454E4F564F0000474D3138384230004746333230360000312E30322E30310055534200000000005642530000000000303030303030303300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000051239DE6303030303033000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 140 140 0 C001000184008E71000064500F410C0A1800002300000101000101010100010105050100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B737316F3EB36C6A
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00000208004BB400C00101C96A6C6B000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 C00100030500FB040093B3ED01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 A6000002050049B600C27E4B39
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA000004080036C900A60001F1AFC9FB000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A60000050600609F000094D6C40E0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A20000030700AC53000F411A349263
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000060800E01F00A20001605AE410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A2000007070007F8005564FA6B157100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 44 44 0 A50000042400F40B000000000000000000000000000000000000000000000000000000000000000095D4A28A
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000080800CC3300A500013F9036A9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A50000090500DE2103D6515435000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 A10000050500807F007BE269C4
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00000A08001AE500A10001AE651B42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A100000B250002FD00B786B17D6A044D24C1651C2B1A76F6396D790639F58CA6D62DDDB8E179A9BD4A6C5C6C9200000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A200000607006C93000F41A33C2AB4
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00000C0800679800A200011C98B985000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A200000D0700807F0059643EDA283F00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A0000007070055AA016450891085EC
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00000E0800B14E00A000013F11196A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A000000F070004FB000000E0109A2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B00200080500629D004A354747
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00001008003FC000B002017532670A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B00200114500A15E008E0091009E006F0083007C006D00690079008800000000000000000000000000AF00A500AD00A000B100A300AA00A300A3009D00000000000000000000000000988D37C39E006F0083007C006D00690079008800000000000000000000000000AF00A500AD00A000B100A300AA00A300A3009D00000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A200000907002BD4000F41D2CA1A81
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000120800E91600A20001A47AD7CB000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A200001307000EF1004B640F46BD2D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A000000A0700C43B016450398D1A9E
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000140800946B00A0000121EDB70D000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A0000015070021DE0000007BC22C5100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B002000B0500DF200052FA3E5D
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA000016080042BD00B002019E7183CF000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B00200174500DC23008200A200AA0093009F009800A90087009A009100000000000000000000000000AF00A500AD00A000B100A300AA00A300A3009C00000000000000000000000000F1B14CECAA0093009F009800A90087009A009100000000000000000000000000AF00A500AD00A000B100A300AA00A300A3009C00000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A200000C0700EB14000F416BC2A256
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00001808006E9100A20001D8B88A5E000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A200001907008976005664DBD4593000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A000000D0700D22D01645041EE0D0E
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00001A0800B84700A00001FB312AB1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A000001B07000DF2000000CA0273AA00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B002000E05001FE000EF2AA657
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00001C0800C53A00B00201E2B3DE5A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B002001D45005BA400A8009100AB0071008B008F009100920093009100000000000000000000000000AF00A500AD00A000B100A300AA00A200A3009C000000000000000000000000008A57E0B3AB0071008B008F009100920093009100000000000000000000000000AF00A500AD00A000B100A300AA00A200A3009C00000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A200000F070056A9000F416A9F62DF
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00001E080013EC00A2000133FB6E9B000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A200001F0700F40B005A625A6BF72B00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A00000100700E11E016450A25FACED
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000200800DE2100A000011D15EAC2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A000002107006B94002900A6F807F200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B00200110500FA0500438F0629
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA000022080008F700B00201A289DE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B00200234500966900870088008800700085009600940070001A001A00000000000000000000000000AF00A500AD00A000B100A300AA00A300A3009D0000000000000000000000000074CA825A8800700085009600940070001A001A00000000000000000000000000AF00A500AD00A000B100A300AA00A300A3009D00000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A20000120700659A000F41892EC33C
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000240800758A00A20001D5DFAEE8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A20000250700926D00556427B73E5900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A000001307005CA3016450A3026C64
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000260800A35C00A00001F6560E07000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A0000027070016E90058265460564800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B002001405003AC500FE5F9E23
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00002808008F7000B00201DE4B8395000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B0020029450011EE007B00950097006E0084008A007400720078008000000000000000000000000000AE00A500AD00A000B100A200AA00A300A3009D000000000000000000000000007AB44F7697006E0084008A007400720078008000000000000000000000000000AE00A500AD00A000B100A200AA00A300A3009D00000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A20000150700738C000F41F14DD4AC
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00002A080059A600A200010F033354000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A200002B0700BE4100566455244C8900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A000001607009C630164501A0AD4B3
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00002C080024DB00A000018A945392000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A000002D0700916E005F2DD3D14D7200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B00200170500877800E690E739
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00002E0800F20D00B0020135086750000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B002002F45006C9300A80083008A006D00870082008900940074001A00000000000000000000000000AF00A500AD00A000B100A300AA00A300A3009D00000000000000000000000000DD3369188A006D00870082008900940074001A00000000000000000000000000AF00A500AD00A000B100A300AA00A300A3009D00000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A20000180700E21D000F4141D04BDE
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00003008007C8300A2000111FF9D33000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A200003107009B6400586440DB796400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A00000190700DB240164506BFCE486
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000320800AA5500A0000132763DDC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A000003307001FE072635FE0E8A18200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B002001A050016E900A4EAF211
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000340800D72800B002012BF4C937000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B0020035450049B6007D00920094008C009A008B008400890094006D00000000000000000000000000AE00A500AD00A000B100A300AA00A200A3009D00000000000000000000000000520A47F394008C009A008B008400890094006D00000000000000000000000000AE00A500AD00A000B100A300AA00A200A3009D00000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A200001B07005FA0000F41408D8B57
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA000036080001FE00A20001FABC79F6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A20000370700E619005964B9BF1A2300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A000001C07001BE4016450D2F45C51
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00003808002DD200A000014EB46049000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A000003907009867725F526A136B6D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B002001D050000FF0009B0C408
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00003A0800FB0400B00201F128548B000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B002003B4500659A0084007D008B0099009C006A009A007B0089008300000000000000000000000000AF00A500AD00A000B100A300AA00A300A3009C00000000000000000000000000BAEEF1FA8B0099009C006A009A007B0089008300000000000000000000000000AF00A500AD00A000B100A300AA00A300A3009C00000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A200001E07009F60000F41F9853380
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00003C0800867900A20001867E2463000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A200003D0700619E005864307089D800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A000001F0700A659016450D3A99CD8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00003E080050AF00A00001A5F7848C000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A000003F0700E51A0063324BE2275A00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B00200200500708F00DCB5EECB
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00004008001BE400B00201E7BD49D0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B00200414500857A0078006F0074009200A6008C0071006C008E009400000000000000000000000000AF00A500AD00A000B100A300A900A200A3009C0000000000000000000000000079DB6FC674009200A6008C0071006C008E009400000000000000000000000000AF00A500AD00A000B100A300A900A200A3009C00000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A2000021070039C6000F41C7E8B94B
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000420800CD3200A2000136F5F911000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A200004307002AD5005A647427533000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A00000220700D6290164502CAFB954
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000440800B04F00A00001B36299D7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A0000045070005FA0061447F5F4C1200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B00200230500CD3200C47A97D1
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000460800669900B002010CFEAD15000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B00200474500F807009500860087008D00A3006D007D0081009C007C00000000000000000000000000AF00A500AD00A000B100A300AA00A300A3009C0000000000000000000000000074D7CC3787008D00A3006D007D0081009C007C00000000000000000000000000AF00A500AD00A000B100A300AA00A300A3009C00000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A20000240700F906000F417EE0019C
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00004808004AB500A200014A37A484000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A20000490700AD52005764F1A7756700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A00000250700C03F01645054CCAEC4
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00004A08009C6300A0000169BE046B000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A000004B070029D60041281F96933800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B002002605000DF20079AA0FDB
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00004C0800E11E00B00201703CF080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B002004D45007F80009E008E008E007E00AB00840096007F0092008100000000000000000000000000AF00A500AD00A000B100A300AA00A300A3009C00000000000000000000000000D393E7738E007E00AB00840096007F0092008100000000000000000000000000AF00A500AD00A000B100A300AA00A300A3009C00000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A2000027070044BB000F417FBDC115
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00004E080037C800A20001A1744041000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A200004F0700D02F005964C7DF8EA700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A0000028070051AE016450E45131B6
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000500800B94600A000017742AA0C000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A000005107000CF300624F1EC75A2600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B002002905004AB5002B5AB4E0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00005208006F9000B00201C8DE9ECE000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B00200534500F10E0077007A00720083007500930073007E006E008200000000000000000000000000AE00A400AC009F00B100A200A900A200A3009C00000000000000000000000000C5190965720083007500930073007E006E008200000000000000000000000000AE00A400AC009F00B100A200A900A200A3009C00000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A200002A0700D52A000F41CF205E67
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA000054080012ED00A20001BF88EE26000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A20000550700F50A0058641D3C23CD00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A000002B0700EC13016450E50CF13F
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000560800C43B00A000019C014EC9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A00000570700718E726054F685049700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B002002C05008A7500968A2CEA
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000580800E81700B00201B41CC35B000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B002005945007689008C007100780072007A009500A10088009C008F00000000000000000000000000AE00A500AD00A000B100A200A900A200A3009C00000000000000000000000000D98A26F0780072007A009500A10088009C008F00000000000000000000000000AE00A500AD00A000B100A200A900A200A3009C00000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A200002D0700C33C000F41B74349F7
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00005A08003EC100A200016554739A000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A200005B0700D926005964EDCD672F00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A000002E07002CD30164505C0449E8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00005C080043BC00A00001E0C3135C000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A000005D0700F609725F58291DE42400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B002002F050037C8008E4555F0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00005E0800956A00B002015F5F279E000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B002005F45000BF400A30088009D008D00A80071007F0092006F006100000000000000000000000000AE00A400AC009F00B100A200A900A200A3009C000000000000000000000000001A1438ED9D008D00A80071007F0092006F006100000000000000000000000000AE00A400AC009F00B100A200A900A200A3009C00000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A20000300700F00F000F4154F2E814
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA000060080058A700A200018370B3E9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A20000610700BF400059646AA8553300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A00000310700C9360164507EDE474C
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00006208008E7100A00001A0F91306000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A000006307003BC4006432979DA1E700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 B0020032050004FB00326A5B9D
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000640800F30C00B00201B97BE7ED000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 B002006545006D92008D008F008A00750083008D0092008B0071007A00000000000000000000000000AE00A500AD00A000B100A200A900A200A3009C00000000000000000000000000394AB8458A00750083008D0092008B0071007A00000000000000000000000000AE00A500AD00A000B100A200A900A200A3009C00000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A200003307004DB2000F4155AF289D
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA000066080025DA00A200016833572C000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A20000670700C23D0057645CD0AEF300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A0000034070009F6016450C7D6FF9B
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA000068080009F600A00001DC3B4E93000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A00000690700BC43002E00509568C700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A3000035070019E6000F41EC883513
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00006A0800DF2000A30001C8D82C7D000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A300006B05003BC40055C25B16000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 114 114 0 A40000366A006798640043010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001E4650312D30303030303030302D302D30303030303030302D6E6F626F647900B5C8699F
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00006C0800A25D00A40001A68D87BD000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A400006D0500996600E41BAEE2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 13 13 0 A60000370500689700E8D1ECD8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00006E0800748B00A6000185042752000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 128 0 A600006F6C0055AA0001640043010107000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001E4650312D30303030303030302D302D30303030303030302D6E6F626F6479006EA4C362000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 A20000380700A15E010023D1112994
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000700800FA0500A20001E14E401B000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A200007107001DE2005A635942221700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 44 44 0 A50000392400847B000000000000000000000000000000000000000000000000000000000000000038910386
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00007208002CD300A5000129052BF2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 192 0 A50000739300A15E005A632900000000640043010107000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001E4650312D30303030303030302D302D30303030303030302D6E6F626F6479008B7767E4A81CC57C17A21C0F44B08232229E7F2E5DBFA70A5CEF58A3966ED710002FF9938030303030303030302D302D30303030303030302D6E6F626F6479008B7767E4A81CC57C17A2
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 15 15 0 a200003a07007788010023107a86d3
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA0000700800FA0500A20001E14E401B000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A200007107001DE2005A635942221700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 44 44 0 a500003b240052ad0000000000000000000000000000000000000000000000000000000000000000828af704
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA00007208002CD300A5000129052BF2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 192 0 A50000739300A15E005A632900000000640043010107000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001E4650312D30303030303030302D302D30303030303030302D6E6F626F6479008B7767E4A81CC57C17A21C0F44B08232229E7F2E5DBFA70A5CEF58A3966ED710002FF9938030303030303030302D302D30303030303030302D6E6F626F6479008B7767E4A81CC57C17A2
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 114 114 0 a700003c6a009b64640043010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e4650312d30303030303030302d302d30303030303030302d6e6f626f647900473c9b29
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 AA000074080051AE00A70001AC924B34000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 0 0
|
||||
USBDEVFS_REAPURBNDELAY 0 3 131 0 0 2048 64 0 A7000075050011EE00ACFFDA28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
74
tests/goodixmoc/custom.py
Executable file
74
tests/goodixmoc/custom.py
Executable file
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import gi
|
||||
gi.require_version('FPrint', '2.0')
|
||||
from gi.repository import FPrint, GLib
|
||||
|
||||
ctx = GLib.main_context_default()
|
||||
|
||||
c = FPrint.Context()
|
||||
c.enumerate()
|
||||
devices = c.get_devices()
|
||||
|
||||
d = devices[0]
|
||||
del devices
|
||||
|
||||
assert d.get_driver() == "goodixmoc"
|
||||
|
||||
d.open_sync()
|
||||
|
||||
template = FPrint.Print.new(d)
|
||||
|
||||
def enroll_progress(*args):
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NEEDED
|
||||
print('enroll progress: ' + str(args))
|
||||
|
||||
def identify_done(dev, res):
|
||||
global identified
|
||||
identified = True
|
||||
identify_match, identify_print = dev.identify_finish(res)
|
||||
print('indentification_done: ', identify_match, identify_print)
|
||||
assert identify_match.equal(identify_print)
|
||||
|
||||
# List, enroll, list, verify, identify, delete
|
||||
print("enrolling")
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
p = d.enroll_sync(template, None, enroll_progress, None)
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
print("enroll done")
|
||||
|
||||
print("listing")
|
||||
stored = d.list_prints_sync()
|
||||
print("listing done")
|
||||
assert len(stored) == 1
|
||||
assert stored[0].equal(p)
|
||||
print("verifying")
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
verify_res, verify_print = d.verify_sync(p)
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
print("verify done")
|
||||
del p
|
||||
assert verify_res == True
|
||||
|
||||
identified = False
|
||||
deserialized_prints = []
|
||||
for p in stored:
|
||||
deserialized_prints.append(FPrint.Print.deserialize(p.serialize()))
|
||||
assert deserialized_prints[-1].equal(p)
|
||||
del stored
|
||||
|
||||
print('async identifying')
|
||||
d.identify(deserialized_prints, callback=identify_done)
|
||||
del deserialized_prints
|
||||
|
||||
while not identified:
|
||||
ctx.iteration(True)
|
||||
|
||||
print("deleting")
|
||||
d.delete_print_sync(p)
|
||||
print("delete done")
|
||||
|
||||
d.close_sync()
|
||||
|
||||
del d
|
||||
del c
|
||||
171
tests/goodixmoc/device
Normal file
171
tests/goodixmoc/device
Normal file
@@ -0,0 +1,171 @@
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1/1-8
|
||||
N: bus/usb/001/003=12010002EF000040C627A26000010102030109022000010103A0320904000002FF0000040705830240000007050102400000
|
||||
E: DEVNAME=/dev/bus/usb/001/003
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=27c6/60a2/100
|
||||
E: TYPE=239/0/0
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=003
|
||||
E: MAJOR=189
|
||||
E: MINOR=2
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=Goodix_Technology_Co.__Ltd.
|
||||
E: ID_VENDOR_ENC=Goodix\x20Technology\x20Co.\x2c\x20Ltd.
|
||||
E: ID_VENDOR_ID=27c6
|
||||
E: ID_MODEL=Goodix_USB2.0_MISC
|
||||
E: ID_MODEL_ENC=Goodix\x20USB2.0\x20MISC
|
||||
E: ID_MODEL_ID=60a2
|
||||
E: ID_REVISION=0100
|
||||
E: ID_SERIAL=Goodix_Technology_Co.__Ltd._Goodix_USB2.0_MISC_UIDCBEE4D7B_XXXX_MOC_B0
|
||||
E: ID_SERIAL_SHORT=UIDCBEE4D7B_XXXX_MOC_B0
|
||||
E: ID_BUS=usb
|
||||
E: ID_USB_INTERFACES=:ff0000:
|
||||
E: ID_VENDOR_FROM_DATABASE=Shenzhen Goodix Technology Co.,Ltd.
|
||||
E: ID_PATH=pci-0000:00:14.0-usb-0:8
|
||||
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_8
|
||||
E: LIBFPRINT_DRIVER=AuthenTec AES1610
|
||||
A: authorized=1
|
||||
A: avoid_reset_quirk=0
|
||||
A: bConfigurationValue=1
|
||||
A: bDeviceClass=ef
|
||||
A: bDeviceProtocol=00
|
||||
A: bDeviceSubClass=00
|
||||
A: bMaxPacketSize0=64
|
||||
A: bMaxPower=100mA
|
||||
A: bNumConfigurations=1
|
||||
A: bNumInterfaces= 1
|
||||
A: bcdDevice=0100
|
||||
A: bmAttributes=a0
|
||||
A: busnum=1
|
||||
A: configuration=UIDCBEE4D7B_XXXX_MOC_B0
|
||||
H: descriptors=12010002EF000040C627A26000010102030109022000010103A0320904000002FF0000040705830240000007050102400000
|
||||
A: dev=189:2
|
||||
A: devnum=3
|
||||
A: devpath=8
|
||||
L: driver=../../../../../bus/usb/drivers/usb
|
||||
A: idProduct=60a2
|
||||
A: idVendor=27c6
|
||||
A: ltm_capable=no
|
||||
A: manufacturer=Goodix Technology Co., Ltd.
|
||||
A: maxchild=0
|
||||
L: port=../1-0:1.0/usb1-port8
|
||||
A: power/active_duration=324448
|
||||
A: power/async=enabled
|
||||
A: power/autosuspend=2
|
||||
A: power/autosuspend_delay_ms=2000
|
||||
A: power/connected_duration=5916532
|
||||
A: power/control=auto
|
||||
A: power/level=auto
|
||||
A: power/persist=1
|
||||
A: power/runtime_active_kids=0
|
||||
A: power/runtime_active_time=327268
|
||||
A: power/runtime_enabled=enabled
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=5588987
|
||||
A: power/runtime_usage=0
|
||||
A: power/wakeup=disabled
|
||||
A: power/wakeup_abort_count=
|
||||
A: power/wakeup_active=
|
||||
A: power/wakeup_active_count=
|
||||
A: power/wakeup_count=
|
||||
A: power/wakeup_expire_count=
|
||||
A: power/wakeup_last_time_ms=
|
||||
A: power/wakeup_max_time_ms=
|
||||
A: power/wakeup_total_time_ms=
|
||||
A: product=Goodix USB2.0 MISC
|
||||
A: quirks=0x0
|
||||
A: removable=fixed
|
||||
A: rx_lanes=1
|
||||
A: serial=UIDCBEE4D7B_XXXX_MOC_B0
|
||||
A: speed=12
|
||||
A: tx_lanes=1
|
||||
A: urbnum=2180
|
||||
A: version= 2.00
|
||||
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb1
|
||||
N: bus/usb/001/001=12010002090001406B1D020004050302010109021900010100E0000904000001090000000705810304000C
|
||||
E: DEVNAME=/dev/bus/usb/001/001
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=1d6b/2/504
|
||||
E: TYPE=9/0/1
|
||||
E: BUSNUM=001
|
||||
E: DEVNUM=001
|
||||
E: MAJOR=189
|
||||
E: MINOR=0
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=Linux_5.4.0-29-generic_xhci-hcd
|
||||
E: ID_VENDOR_ENC=Linux\x205.4.0-29-generic\x20xhci-hcd
|
||||
E: ID_VENDOR_ID=1d6b
|
||||
E: ID_MODEL=xHCI_Host_Controller
|
||||
E: ID_MODEL_ENC=xHCI\x20Host\x20Controller
|
||||
E: ID_MODEL_ID=0002
|
||||
E: ID_REVISION=0504
|
||||
E: ID_SERIAL=Linux_5.4.0-29-generic_xhci-hcd_xHCI_Host_Controller_0000:00:14.0
|
||||
E: ID_SERIAL_SHORT=0000:00:14.0
|
||||
E: ID_BUS=usb
|
||||
E: ID_USB_INTERFACES=:090000:
|
||||
E: ID_VENDOR_FROM_DATABASE=Linux Foundation
|
||||
E: ID_MODEL_FROM_DATABASE=2.0 root hub
|
||||
E: ID_PATH=pci-0000:00:14.0
|
||||
E: ID_PATH_TAG=pci-0000_00_14_0
|
||||
E: ID_FOR_SEAT=usb-pci-0000_00_14_0
|
||||
E: TAGS=:seat:
|
||||
A: authorized=1
|
||||
A: authorized_default=1
|
||||
A: avoid_reset_quirk=0
|
||||
A: bConfigurationValue=1
|
||||
A: bDeviceClass=09
|
||||
A: bDeviceProtocol=01
|
||||
A: bDeviceSubClass=00
|
||||
A: bMaxPacketSize0=64
|
||||
A: bMaxPower=0mA
|
||||
A: bNumConfigurations=1
|
||||
A: bNumInterfaces= 1
|
||||
A: bcdDevice=0504
|
||||
A: bmAttributes=e0
|
||||
A: busnum=1
|
||||
A: configuration=
|
||||
H: descriptors=12010002090001406B1D020004050302010109021900010100E0000904000001090000000705810304000C
|
||||
A: dev=189:0
|
||||
A: devnum=1
|
||||
A: devpath=0
|
||||
L: driver=../../../../bus/usb/drivers/usb
|
||||
A: idProduct=0002
|
||||
A: idVendor=1d6b
|
||||
A: interface_authorized_default=1
|
||||
A: ltm_capable=no
|
||||
A: manufacturer=Linux 5.4.0-29-generic xhci-hcd
|
||||
A: maxchild=12
|
||||
A: power/active_duration=5879432
|
||||
A: power/async=enabled
|
||||
A: power/autosuspend=0
|
||||
A: power/autosuspend_delay_ms=0
|
||||
A: power/connected_duration=5916912
|
||||
A: power/control=auto
|
||||
A: power/level=auto
|
||||
A: power/runtime_active_kids=2
|
||||
A: power/runtime_active_time=5879430
|
||||
A: power/runtime_enabled=enabled
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=37481
|
||||
A: power/runtime_usage=0
|
||||
A: power/wakeup=disabled
|
||||
A: power/wakeup_abort_count=
|
||||
A: power/wakeup_active=
|
||||
A: power/wakeup_active_count=
|
||||
A: power/wakeup_count=
|
||||
A: power/wakeup_expire_count=
|
||||
A: power/wakeup_last_time_ms=
|
||||
A: power/wakeup_max_time_ms=
|
||||
A: power/wakeup_total_time_ms=
|
||||
A: product=xHCI Host Controller
|
||||
A: quirks=0x0
|
||||
A: removable=unknown
|
||||
A: rx_lanes=1
|
||||
A: serial=0000:00:14.0
|
||||
A: speed=480
|
||||
A: tx_lanes=1
|
||||
A: urbnum=1319
|
||||
A: version= 2.00
|
||||
@@ -17,10 +17,13 @@ envs.set('FP_DRIVERS_WHITELIST', 'virtual_image')
|
||||
envs.set('NO_AT_BRIDGE', '1')
|
||||
|
||||
drivers_tests = [
|
||||
'aes3500',
|
||||
'elan',
|
||||
'synaptics',
|
||||
'vfs0050',
|
||||
'vfs301',
|
||||
'vfs5011',
|
||||
'goodixmoc',
|
||||
]
|
||||
|
||||
if get_option('introspection')
|
||||
|
||||
@@ -4,14 +4,16 @@ USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 01
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 40 38 0 00009C37FE5C669C2D000A01014101C10000D11BB7134A090FA1000000000100000000000003
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 5 5 0 A7FE011100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE01130100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 37 37 0 A7FE02512000014650312D30303030303030302D302D30303030303030302D6E6F626F6479
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE025400
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 5 5 0 A7FE021100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE02130100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 37 37 0 A7FE03512000014650312D30303030303030302D302D30303030303030302D6E6F626F6479
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE035400
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE026000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE036000
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
@@ -20,13 +22,13 @@ USBDEVFS_REAPURBNDELAY 0 3 1 0 0 37 37 0 A7FE02512000014650312D30303030303030302
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910100
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 05000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE0255010C
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE0355010C
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE026000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE036000
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
@@ -35,19 +37,19 @@ USBDEVFS_REAPURBNDELAY 0 3 1 0 0 37 37 0 A7FE02512000014650312D30303030303030302
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910100
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 05000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE02550119
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE03550119
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE026000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE036000
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE02550125
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE03550125
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 05000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910100
|
||||
@@ -56,13 +58,13 @@ USBDEVFS_REAPURBNDELAY 0 3 1 0 0 37 37 0 A7FE02512000014650312D30303030303030302
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE026000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE036000
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE02550125
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE03550125
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 05000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910100
|
||||
@@ -71,13 +73,13 @@ USBDEVFS_REAPURBNDELAY 0 3 1 0 0 37 37 0 A7FE02512000014650312D30303030303030302
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE026000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE036000
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE02550132
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE03550132
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 05000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910100
|
||||
@@ -86,13 +88,13 @@ USBDEVFS_REAPURBNDELAY 0 3 1 0 0 37 37 0 A7FE02512000014650312D30303030303030302
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE026000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE036000
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE0255013E
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE0355013E
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 05000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910100
|
||||
@@ -101,13 +103,13 @@ USBDEVFS_REAPURBNDELAY 0 3 1 0 0 37 37 0 A7FE02512000014650312D30303030303030302
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE026000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE036000
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE0255013E
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE0355013E
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 05000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910100
|
||||
@@ -116,13 +118,13 @@ USBDEVFS_REAPURBNDELAY 0 3 1 0 0 37 37 0 A7FE02512000014650312D30303030303030302
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE026000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE036000
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE0255014B
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE0355014B
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 05000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910100
|
||||
@@ -131,7 +133,7 @@ USBDEVFS_REAPURBNDELAY 0 3 1 0 0 37 37 0 A7FE02512000014650312D30303030303030302
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE026000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE036000
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
@@ -140,13 +142,13 @@ USBDEVFS_REAPURBNDELAY 0 3 1 0 0 37 37 0 A7FE02512000014650312D30303030303030302
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910100
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 05000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE02550157
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE03550157
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE026000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE036000
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
@@ -155,21 +157,21 @@ USBDEVFS_REAPURBNDELAY 0 3 1 0 0 37 37 0 A7FE02512000014650312D30303030303030302
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910100
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 05000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE02550164
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE03550164
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 05000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 37 0 0000FE02591F014650312D30303030303030302D302D30303030303030302D6E6F626F6479
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 37 0 0000FE03591F014650312D30303030303030302D302D30303030303030302D6E6F626F6479
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 5 5 0 A7FE037100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 41 0 0000FE03752301012007014650312D30303030303030302D302D30303030303030302D6E6F626F6479
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 5 5 0 A7FE037200
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE037600
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 35 35 0 A7FE04651E4650312D30303030303030302D302D30303030303030302D6E6F626F6479
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE046600
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 5 5 0 A7FE047100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 41 0 0000FE04752301012007014650312D30303030303030302D302D30303030303030302D6E6F626F6479
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 5 5 0 A7FE047200
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE047600
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 35 35 0 A7FE05651E4650312D30303030303030302D302D30303030303030302D6E6F626F6479
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE056600
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE046000
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE056000
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 06000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910101
|
||||
@@ -178,9 +180,9 @@ USBDEVFS_REAPURBNDELAY 0 3 1 0 0 35 35 0 A7FE04651E4650312D30303030303030302D302
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 7 0 0000FE00910100
|
||||
USBDEVFS_REAPURBNDELAY 0 1 131 0 0 7 7 0 05000000000100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 1 1 0 A8
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 39 0 0000FE0468214F2B014650312D30303030303030302D302D30303030303030302D6E6F626F6479
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 36 36 0 A7FE05811F014650312D30303030303030302D302D30303030303030302D6E6F626F6479
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 37 0 0000FE05831F014650312D30303030303030302D302D30303030303030302D6E6F626F6479
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 5 5 0 A7FE06A100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE06A200
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 39 0 0000FE0568214F2B014650312D30303030303030302D302D30303030303030302D6E6F626F6479
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 36 36 0 A7FE06811F014650312D30303030303030302D302D30303030303030302D6E6F626F6479
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 37 0 0000FE06831F014650312D30303030303030302D302D30303030303030302D6E6F626F6479
|
||||
USBDEVFS_REAPURBNDELAY 0 3 1 0 0 5 5 0 A7FE07A100
|
||||
USBDEVFS_REAPURBNDELAY 0 3 129 0 0 266 6 0 0000FE07A200
|
||||
|
||||
|
||||
@@ -20,11 +20,14 @@ d.open_sync()
|
||||
template = FPrint.Print.new(d)
|
||||
|
||||
def enroll_progress(*args):
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NEEDED
|
||||
print('enroll progress: ' + str(args))
|
||||
|
||||
# List, enroll, list, verify, delete, list
|
||||
print("enrolling")
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
p = d.enroll_sync(template, None, enroll_progress, None)
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
print("enroll done")
|
||||
|
||||
print("listing")
|
||||
@@ -33,7 +36,9 @@ print("listing done")
|
||||
assert len(stored) == 1
|
||||
assert stored[0].equal(p)
|
||||
print("verifying")
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
verify_res, verify_print = d.verify_sync(p)
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
print("verify done")
|
||||
assert verify_res == True
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <libfprint/fprint.h>
|
||||
|
||||
#include "test-utils.h"
|
||||
#include "fpi-device.h"
|
||||
|
||||
static void
|
||||
test_context_new (void)
|
||||
@@ -92,6 +93,296 @@ test_context_enumerates_new_devices (void)
|
||||
fpt_teardown_virtual_device_environment ();
|
||||
}
|
||||
|
||||
#define DEV_REMOVED_CB 1
|
||||
#define CTX_DEVICE_REMOVED_CB 2
|
||||
|
||||
static void
|
||||
device_removed_cb (FpDevice *device, FptContext *tctx)
|
||||
{
|
||||
g_assert_nonnull (device);
|
||||
g_assert_true (device == tctx->device);
|
||||
|
||||
g_assert_null (tctx->user_data);
|
||||
tctx->user_data = GINT_TO_POINTER (DEV_REMOVED_CB);
|
||||
}
|
||||
|
||||
static void
|
||||
context_device_removed_cb (FpContext *ctx, FpDevice *device, FptContext *tctx)
|
||||
{
|
||||
g_assert_nonnull (device);
|
||||
g_assert_true (device == tctx->device);
|
||||
|
||||
/* "device-removed" on context is always after "removed" on device */
|
||||
g_assert_cmpint (GPOINTER_TO_INT (tctx->user_data), ==, DEV_REMOVED_CB);
|
||||
tctx->user_data = GINT_TO_POINTER (CTX_DEVICE_REMOVED_CB);
|
||||
}
|
||||
|
||||
static void
|
||||
test_context_remove_device_closed (void)
|
||||
{
|
||||
g_autoptr(FptContext) tctx = fpt_context_new_with_virtual_imgdev ();
|
||||
gboolean removed;
|
||||
|
||||
tctx->user_data = NULL;
|
||||
g_signal_connect (tctx->device, "removed", (GCallback) device_removed_cb, tctx);
|
||||
g_signal_connect (tctx->fp_context, "device-removed", (GCallback) context_device_removed_cb, tctx);
|
||||
|
||||
/* Triggering remove on closed device. */
|
||||
fpi_device_remove (tctx->device);
|
||||
|
||||
g_assert_nonnull (tctx->device);
|
||||
g_object_get (tctx->device, "removed", &removed, NULL);
|
||||
g_assert_true (removed);
|
||||
g_assert_cmpint (GPOINTER_TO_INT (tctx->user_data), ==, DEV_REMOVED_CB);
|
||||
|
||||
/* device-removed is dispatched from idle. */
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
{
|
||||
}
|
||||
|
||||
/* The device is now destroyed and device-removed was called. */
|
||||
g_assert_null (tctx->device);
|
||||
g_assert_cmpint (GPOINTER_TO_INT (tctx->user_data), ==, CTX_DEVICE_REMOVED_CB);
|
||||
|
||||
fpt_teardown_virtual_device_environment ();
|
||||
}
|
||||
|
||||
static void
|
||||
close_done_cb (GObject *device, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
g_autoptr(FpPrint) print = NULL;
|
||||
GError **error = user_data;
|
||||
|
||||
g_assert_nonnull (error);
|
||||
g_assert_false (fp_device_close_finish (FP_DEVICE (device), res, error));
|
||||
g_assert_null (print);
|
||||
g_assert_nonnull (*error);
|
||||
}
|
||||
|
||||
static void
|
||||
test_context_remove_device_closing (void)
|
||||
{
|
||||
g_autoptr(FptContext) tctx = fpt_context_new_with_virtual_imgdev ();
|
||||
g_autoptr(GError) close_error = NULL;
|
||||
g_autoptr(GError) error = NULL;
|
||||
gboolean removed;
|
||||
|
||||
tctx->user_data = NULL;
|
||||
g_signal_connect (tctx->device, "removed", (GCallback) device_removed_cb, tctx);
|
||||
g_signal_connect (tctx->fp_context, "device-removed", (GCallback) context_device_removed_cb, tctx);
|
||||
|
||||
fp_device_open_sync (tctx->device, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
/* Triggering remove on device that is being closed. */
|
||||
fp_device_close (tctx->device, NULL, close_done_cb, &close_error);
|
||||
fpi_device_remove (tctx->device);
|
||||
|
||||
/* Removed but not yet notified*/
|
||||
g_assert_nonnull (tctx->device);
|
||||
g_object_get (tctx->device, "removed", &removed, NULL);
|
||||
g_assert_true (removed);
|
||||
g_assert_null (tctx->user_data);
|
||||
|
||||
/* Running the mainloop now will cause the close to fail eventually. */
|
||||
while (!close_error)
|
||||
g_main_context_iteration (NULL, TRUE);
|
||||
g_assert_error (close_error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_REMOVED);
|
||||
|
||||
/* Now the removed callback has been called already. */
|
||||
g_assert_nonnull (tctx->device);
|
||||
g_assert_cmpint (GPOINTER_TO_INT (tctx->user_data), ==, DEV_REMOVED_CB);
|
||||
|
||||
/* While device-removed needs another idle iteration. */
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
{
|
||||
}
|
||||
|
||||
g_assert_null (tctx->device);
|
||||
g_assert_cmpint (GPOINTER_TO_INT (tctx->user_data), ==, CTX_DEVICE_REMOVED_CB);
|
||||
|
||||
fpt_teardown_virtual_device_environment ();
|
||||
}
|
||||
|
||||
static void
|
||||
test_context_remove_device_open (void)
|
||||
{
|
||||
g_autoptr(FptContext) tctx = fpt_context_new_with_virtual_imgdev ();
|
||||
g_autoptr(GError) error = NULL;
|
||||
gboolean removed = FALSE;
|
||||
|
||||
tctx->user_data = NULL;
|
||||
g_signal_connect (tctx->fp_context, "device-removed", (GCallback) context_device_removed_cb, tctx);
|
||||
g_signal_connect (tctx->device, "removed", (GCallback) device_removed_cb, tctx);
|
||||
|
||||
fp_device_open_sync (tctx->device, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
/* Triggering remove on open device. */
|
||||
fpi_device_remove (tctx->device);
|
||||
|
||||
g_assert_nonnull (tctx->device);
|
||||
g_object_get (tctx->device, "removed", &removed, NULL);
|
||||
g_assert_true (removed);
|
||||
g_assert_cmpint (GPOINTER_TO_INT (tctx->user_data), ==, DEV_REMOVED_CB);
|
||||
|
||||
/* At this point, the "removed" cb on the device should have been called!
|
||||
* Iterating the mainloop will not change anything.
|
||||
*/
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
{
|
||||
}
|
||||
g_assert_cmpint (GPOINTER_TO_INT (tctx->user_data), ==, DEV_REMOVED_CB);
|
||||
|
||||
/* On close, the device will be removed from the context,
|
||||
* but only a main loop iteration later. */
|
||||
fp_device_close_sync (tctx->device, NULL, &error);
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_REMOVED);
|
||||
g_assert_nonnull (tctx->device);
|
||||
g_assert_cmpint (GPOINTER_TO_INT (tctx->user_data), ==, DEV_REMOVED_CB);
|
||||
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
{
|
||||
}
|
||||
g_assert_null (tctx->device);
|
||||
g_assert_cmpint (GPOINTER_TO_INT (tctx->user_data), ==, CTX_DEVICE_REMOVED_CB);
|
||||
|
||||
fpt_teardown_virtual_device_environment ();
|
||||
}
|
||||
|
||||
static void
|
||||
open_done_cb (GObject *device, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(FpPrint) print = NULL;
|
||||
gboolean *data = user_data;
|
||||
|
||||
g_assert_true (fp_device_open_finish (FP_DEVICE (device), res, &error));
|
||||
g_assert_null (print);
|
||||
g_assert_null (error);
|
||||
|
||||
*data = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
test_context_remove_device_opening (void)
|
||||
{
|
||||
g_autoptr(FptContext) tctx = fpt_context_new_with_virtual_imgdev ();
|
||||
g_autoptr(GError) close_error = NULL;
|
||||
gboolean open_done = FALSE;
|
||||
gboolean removed;
|
||||
|
||||
tctx->user_data = NULL;
|
||||
g_signal_connect (tctx->device, "removed", (GCallback) device_removed_cb, tctx);
|
||||
g_signal_connect (tctx->fp_context, "device-removed", (GCallback) context_device_removed_cb, tctx);
|
||||
|
||||
fp_device_open (tctx->device, NULL, open_done_cb, &open_done);
|
||||
g_assert_false (open_done);
|
||||
|
||||
fpi_device_remove (tctx->device);
|
||||
|
||||
/* Removed but not yet notified*/
|
||||
g_assert_nonnull (tctx->device);
|
||||
g_object_get (tctx->device, "removed", &removed, NULL);
|
||||
g_assert_true (removed);
|
||||
g_assert_null (tctx->user_data);
|
||||
|
||||
/* Running the mainloop now will cause the open to *succeed* despite removal! */
|
||||
while (!open_done)
|
||||
g_main_context_iteration (NULL, TRUE);
|
||||
|
||||
/* Now the removed callback has been called already. */
|
||||
g_assert_nonnull (tctx->device);
|
||||
g_assert_cmpint (GPOINTER_TO_INT (tctx->user_data), ==, DEV_REMOVED_CB);
|
||||
|
||||
fp_device_close_sync (tctx->device, NULL, &close_error);
|
||||
g_assert_error (close_error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_REMOVED);
|
||||
|
||||
g_assert_nonnull (tctx->device);
|
||||
g_assert_cmpint (GPOINTER_TO_INT (tctx->user_data), ==, DEV_REMOVED_CB);
|
||||
|
||||
/* The device-removed signal needs an idle iteration. */
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
{
|
||||
}
|
||||
|
||||
g_assert_null (tctx->device);
|
||||
g_assert_cmpint (GPOINTER_TO_INT (tctx->user_data), ==, CTX_DEVICE_REMOVED_CB);
|
||||
|
||||
fpt_teardown_virtual_device_environment ();
|
||||
}
|
||||
|
||||
static void
|
||||
enroll_done_cb (GObject *device, GAsyncResult *res, gpointer user_data)
|
||||
{
|
||||
g_autoptr(FpPrint) print = NULL;
|
||||
GError **error = user_data;
|
||||
|
||||
g_assert_nonnull (error);
|
||||
print = fp_device_enroll_finish (FP_DEVICE (device), res, error);
|
||||
g_assert_null (print);
|
||||
g_assert_nonnull (*error);
|
||||
}
|
||||
|
||||
static void
|
||||
test_context_remove_device_active (void)
|
||||
{
|
||||
g_autoptr(FptContext) tctx = fpt_context_new_with_virtual_imgdev ();
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(GCancellable) cancellable = NULL;
|
||||
g_autoptr(GError) enroll_error = NULL;
|
||||
FpPrint *template;
|
||||
gboolean removed = FALSE;
|
||||
|
||||
tctx->user_data = NULL;
|
||||
g_signal_connect (tctx->fp_context, "device-removed", (GCallback) context_device_removed_cb, tctx);
|
||||
g_signal_connect (tctx->device, "removed", (GCallback) device_removed_cb, tctx);
|
||||
|
||||
fp_device_open_sync (tctx->device, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
/* Start an enroll that we can cancel/fail later.
|
||||
* NOTE: We need to cancel explicitly as remove() does not trigger a failure!
|
||||
*/
|
||||
template = fp_print_new (tctx->device);
|
||||
cancellable = g_cancellable_new ();
|
||||
fp_device_enroll (tctx->device, template, cancellable, NULL, NULL, NULL, enroll_done_cb, &enroll_error);
|
||||
|
||||
/* Triggering remove on active device. */
|
||||
fpi_device_remove (tctx->device);
|
||||
|
||||
/* The removed property has changed, but the cb has *not* been called yet. */
|
||||
g_assert_nonnull (tctx->device);
|
||||
g_object_get (tctx->device, "removed", &removed, NULL);
|
||||
g_assert_true (removed);
|
||||
g_assert_null (tctx->user_data);
|
||||
|
||||
/* Running the mainloop now will cause the operation to fail eventually. */
|
||||
while (!enroll_error)
|
||||
g_main_context_iteration (NULL, TRUE);
|
||||
|
||||
/* The virtual image device throws an PROTO error internally,
|
||||
* but we should still receive a REMOVED error here. */
|
||||
g_assert_error (enroll_error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_REMOVED);
|
||||
g_assert_cmpint (GPOINTER_TO_INT (tctx->user_data), ==, DEV_REMOVED_CB);
|
||||
|
||||
/* Now we close the device, state remains unchanged mostly. */
|
||||
fp_device_close_sync (tctx->device, NULL, &error);
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_REMOVED);
|
||||
g_assert_nonnull (tctx->device);
|
||||
g_assert_cmpint (GPOINTER_TO_INT (tctx->user_data), ==, DEV_REMOVED_CB);
|
||||
|
||||
/* And "device-removed" is called */
|
||||
while (g_main_context_iteration (NULL, FALSE))
|
||||
{
|
||||
}
|
||||
|
||||
g_assert_null (tctx->device);
|
||||
g_assert_cmpint (GPOINTER_TO_INT (tctx->user_data), ==, CTX_DEVICE_REMOVED_CB);
|
||||
|
||||
fpt_teardown_virtual_device_environment ();
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
@@ -101,6 +392,11 @@ main (int argc, char *argv[])
|
||||
g_test_add_func ("/context/no-devices", test_context_has_no_devices);
|
||||
g_test_add_func ("/context/has-virtual-device", test_context_has_virtual_device);
|
||||
g_test_add_func ("/context/enumerates-new-devices", test_context_enumerates_new_devices);
|
||||
g_test_add_func ("/context/remove-device-closed", test_context_remove_device_closed);
|
||||
g_test_add_func ("/context/remove-device-closing", test_context_remove_device_closing);
|
||||
g_test_add_func ("/context/remove-device-open", test_context_remove_device_open);
|
||||
g_test_add_func ("/context/remove-device-opening", test_context_remove_device_opening);
|
||||
g_test_add_func ("/context/remove-device-active", test_context_remove_device_active);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
|
||||
@@ -178,6 +178,15 @@ test_device_get_scan_type (void)
|
||||
g_assert_cmpint (fp_device_get_scan_type (tctx->device), ==, FP_SCAN_TYPE_SWIPE);
|
||||
}
|
||||
|
||||
static void
|
||||
test_device_get_finger_status (void)
|
||||
{
|
||||
g_autoptr(FptContext) tctx = fpt_context_new_with_virtual_imgdev ();
|
||||
|
||||
fp_device_open_sync (tctx->device, NULL, NULL);
|
||||
g_assert_cmpint (fp_device_get_finger_status (tctx->device), ==, FP_FINGER_STATUS_NONE);
|
||||
}
|
||||
|
||||
static void
|
||||
test_device_get_nr_enroll_stages (void)
|
||||
{
|
||||
@@ -229,6 +238,7 @@ main (int argc, char *argv[])
|
||||
g_test_add_func ("/device/sync/get_device_id", test_device_get_device_id);
|
||||
g_test_add_func ("/device/sync/get_name", test_device_get_name);
|
||||
g_test_add_func ("/device/sync/get_scan_type", test_device_get_scan_type);
|
||||
g_test_add_func ("/device/sync/get_finger_status", test_device_get_finger_status);
|
||||
g_test_add_func ("/device/sync/get_nr_enroll_stages", test_device_get_nr_enroll_stages);
|
||||
g_test_add_func ("/device/sync/supports_identify", test_device_supports_identify);
|
||||
g_test_add_func ("/device/sync/supports_capture", test_device_supports_capture);
|
||||
|
||||
@@ -89,6 +89,29 @@ auto_reset_device_class_cleanup (FpAutoResetClass *dev_class)
|
||||
}
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FpAutoResetClass, auto_reset_device_class_cleanup)
|
||||
|
||||
|
||||
static void
|
||||
assert_equal_galleries (GPtrArray *g1,
|
||||
GPtrArray *g2)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
g_assert ((g1 && g2) || (!g1 || !g1));
|
||||
|
||||
if (g1 == g2)
|
||||
return;
|
||||
|
||||
g_assert_cmpuint (g1->len, ==, g2->len);
|
||||
|
||||
for (i = 0; i < g1->len; i++)
|
||||
{
|
||||
FpPrint *print = g_ptr_array_index (g1, i);
|
||||
|
||||
g_assert_true (g_ptr_array_find_with_equal_func (g2, print, (GEqualFunc)
|
||||
fp_print_equal, NULL));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_device_notify (FpDevice *device, GParamSpec *spec, gpointer user_data)
|
||||
{
|
||||
@@ -98,6 +121,43 @@ on_device_notify (FpDevice *device, GParamSpec *spec, gpointer user_data)
|
||||
fake_dev->user_data = g_param_spec_ref (spec);
|
||||
}
|
||||
|
||||
static FpPrint *
|
||||
make_fake_print (FpDevice *device,
|
||||
GVariant *print_data)
|
||||
{
|
||||
FpPrint *enrolled_print = fp_print_new (device);
|
||||
|
||||
fpi_print_set_type (enrolled_print, FPI_PRINT_RAW);
|
||||
|
||||
if (!print_data)
|
||||
print_data = g_variant_new_string ("Test print private data");
|
||||
g_object_set (G_OBJECT (enrolled_print), "fpi-data", print_data, NULL);
|
||||
|
||||
return enrolled_print;
|
||||
}
|
||||
|
||||
static FpPrint *
|
||||
make_fake_print_reffed (FpDevice *device,
|
||||
GVariant *print_data)
|
||||
{
|
||||
return g_object_ref_sink (make_fake_print (device, print_data));
|
||||
}
|
||||
|
||||
static GPtrArray *
|
||||
make_fake_prints_gallery (FpDevice *device,
|
||||
size_t size)
|
||||
{
|
||||
GPtrArray *array;
|
||||
size_t i;
|
||||
|
||||
array = g_ptr_array_new_full (size, g_object_unref);
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
g_ptr_array_add (array, make_fake_print_reffed (device, g_variant_new_uint64 (i)));
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
/* Tests */
|
||||
|
||||
static void
|
||||
@@ -200,6 +260,160 @@ test_driver_set_scan_type_swipe (void)
|
||||
g_assert_cmpstr (pspec->name, ==, "scan-type");
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_finger_status_inactive (void)
|
||||
{
|
||||
g_autoptr(FpDevice) device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
FpFingerStatusFlags finger_status;
|
||||
|
||||
g_signal_connect (device, "notify::finger-status", G_CALLBACK (on_device_notify), NULL);
|
||||
|
||||
g_assert_false (fpi_device_report_finger_status (device, FP_FINGER_STATUS_NONE));
|
||||
g_assert_cmpuint (fp_device_get_finger_status (device), ==, FP_FINGER_STATUS_NONE);
|
||||
|
||||
g_object_get (fake_dev, "finger-status", &finger_status, NULL);
|
||||
g_assert_cmpuint (finger_status, ==, FP_FINGER_STATUS_NONE);
|
||||
|
||||
g_assert (fake_dev->last_called_function != on_device_notify);
|
||||
g_assert_null (g_steal_pointer (&fake_dev->user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_finger_status_needed (void)
|
||||
{
|
||||
g_autoptr(FpDevice) device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
g_autoptr(GParamSpec) pspec = NULL;
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
FpFingerStatusFlags finger_status;
|
||||
|
||||
g_signal_connect (device, "notify::finger-status", G_CALLBACK (on_device_notify), NULL);
|
||||
|
||||
g_assert_true (fpi_device_report_finger_status (device, FP_FINGER_STATUS_NEEDED));
|
||||
g_assert_cmpuint (fp_device_get_finger_status (device), ==, FP_FINGER_STATUS_NEEDED);
|
||||
|
||||
g_object_get (fake_dev, "finger-status", &finger_status, NULL);
|
||||
g_assert_cmpuint (finger_status, ==, FP_FINGER_STATUS_NEEDED);
|
||||
|
||||
g_assert (fake_dev->last_called_function == on_device_notify);
|
||||
pspec = g_steal_pointer (&fake_dev->user_data);
|
||||
g_assert_cmpstr (pspec->name, ==, "finger-status");
|
||||
|
||||
fake_dev->last_called_function = NULL;
|
||||
g_assert_false (fpi_device_report_finger_status (device, FP_FINGER_STATUS_NEEDED));
|
||||
g_assert_null (fake_dev->last_called_function);
|
||||
g_assert_null (g_steal_pointer (&fake_dev->user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_finger_status_present (void)
|
||||
{
|
||||
g_autoptr(FpDevice) device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
g_autoptr(GParamSpec) pspec = NULL;
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
FpFingerStatusFlags finger_status;
|
||||
|
||||
g_signal_connect (device, "notify::finger-status", G_CALLBACK (on_device_notify), NULL);
|
||||
|
||||
g_assert_true (fpi_device_report_finger_status (device, FP_FINGER_STATUS_PRESENT));
|
||||
g_assert_cmpuint (fp_device_get_finger_status (device), ==, FP_FINGER_STATUS_PRESENT);
|
||||
|
||||
g_object_get (fake_dev, "finger-status", &finger_status, NULL);
|
||||
g_assert_cmpuint (finger_status, ==, FP_FINGER_STATUS_PRESENT);
|
||||
|
||||
g_assert (fake_dev->last_called_function == on_device_notify);
|
||||
pspec = g_steal_pointer (&fake_dev->user_data);
|
||||
g_assert_cmpstr (pspec->name, ==, "finger-status");
|
||||
|
||||
fake_dev->last_called_function = NULL;
|
||||
g_assert_false (fpi_device_report_finger_status (device, FP_FINGER_STATUS_PRESENT));
|
||||
g_assert_null (fake_dev->last_called_function);
|
||||
g_assert_null (g_steal_pointer (&fake_dev->user_data));
|
||||
}
|
||||
|
||||
static void
|
||||
driver_finger_status_changes_check (FpDevice *device, gboolean add)
|
||||
{
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
g_autoptr(GFlagsClass) status_class = g_type_class_ref (FP_TYPE_FINGER_STATUS_FLAGS);
|
||||
guint expected_status;
|
||||
guint initial_value;
|
||||
guint i;
|
||||
gulong signal_id;
|
||||
|
||||
if (add)
|
||||
initial_value = FP_FINGER_STATUS_NONE;
|
||||
else
|
||||
initial_value = status_class->mask;
|
||||
|
||||
g_assert_cmpuint (fp_device_get_finger_status (device), ==, initial_value);
|
||||
|
||||
signal_id = g_signal_connect (device, "notify::finger-status",
|
||||
G_CALLBACK (on_device_notify), NULL);
|
||||
|
||||
for (i = 0, expected_status = initial_value; i < status_class->n_values; ++i)
|
||||
{
|
||||
g_autoptr(GParamSpec) pspec = NULL;
|
||||
FpFingerStatusFlags finger_status = status_class->values[i].value;
|
||||
FpFingerStatusFlags added_status = add ? finger_status : FP_FINGER_STATUS_NONE;
|
||||
FpFingerStatusFlags removed_status = add ? FP_FINGER_STATUS_NONE : finger_status;
|
||||
gboolean ret;
|
||||
|
||||
fake_dev->last_called_function = NULL;
|
||||
ret = fpi_device_report_finger_status_changes (device,
|
||||
added_status,
|
||||
removed_status);
|
||||
if (finger_status != FP_FINGER_STATUS_NONE)
|
||||
g_assert_true (ret);
|
||||
else
|
||||
g_assert_false (ret);
|
||||
|
||||
expected_status |= added_status;
|
||||
expected_status &= ~removed_status;
|
||||
|
||||
g_assert_cmpuint (fp_device_get_finger_status (device), ==, expected_status);
|
||||
|
||||
if (finger_status != FP_FINGER_STATUS_NONE)
|
||||
{
|
||||
g_assert (fake_dev->last_called_function == on_device_notify);
|
||||
pspec = g_steal_pointer (&fake_dev->user_data);
|
||||
g_assert_cmpstr (pspec->name, ==, "finger-status");
|
||||
}
|
||||
|
||||
fake_dev->last_called_function = NULL;
|
||||
g_assert_false (fpi_device_report_finger_status_changes (device,
|
||||
added_status,
|
||||
removed_status));
|
||||
g_assert_null (fake_dev->last_called_function);
|
||||
g_assert_null (g_steal_pointer (&fake_dev->user_data));
|
||||
}
|
||||
|
||||
if (add)
|
||||
g_assert_cmpuint (fp_device_get_finger_status (device), ==, status_class->mask);
|
||||
else
|
||||
g_assert_cmpuint (fp_device_get_finger_status (device), ==, FP_FINGER_STATUS_NONE);
|
||||
|
||||
fake_dev->last_called_function = NULL;
|
||||
g_assert_false (fpi_device_report_finger_status_changes (device,
|
||||
FP_FINGER_STATUS_NONE,
|
||||
FP_FINGER_STATUS_NONE));
|
||||
|
||||
g_assert_null (fake_dev->last_called_function);
|
||||
g_assert_null (g_steal_pointer (&fake_dev->user_data));
|
||||
|
||||
g_signal_handler_disconnect (device, signal_id);
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_finger_status_changes (void)
|
||||
{
|
||||
g_autoptr(FpDevice) device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
|
||||
driver_finger_status_changes_check (device, TRUE);
|
||||
driver_finger_status_changes_check (device, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_get_nr_enroll_stages (void)
|
||||
{
|
||||
@@ -393,12 +607,12 @@ test_driver_open (void)
|
||||
|
||||
g_assert (fake_dev->last_called_function != dev_class->probe);
|
||||
|
||||
fp_device_open_sync (device, NULL, &error);
|
||||
g_assert_true (fp_device_open_sync (device, NULL, &error));
|
||||
g_assert (fake_dev->last_called_function == dev_class->open);
|
||||
g_assert_no_error (error);
|
||||
g_assert_true (fp_device_is_open (device));
|
||||
|
||||
fp_device_close_sync (FP_DEVICE (device), NULL, &error);
|
||||
g_assert_true (fp_device_close_sync (FP_DEVICE (device), NULL, &error));
|
||||
g_assert_no_error (error);
|
||||
}
|
||||
|
||||
@@ -411,7 +625,7 @@ test_driver_open_error (void)
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
fake_dev->ret_error = fpi_device_error_new (FP_DEVICE_ERROR_GENERAL);
|
||||
fp_device_open_sync (device, NULL, &error);
|
||||
g_assert_false (fp_device_open_sync (device, NULL, &error));
|
||||
g_assert (fake_dev->last_called_function == dev_class->open);
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL);
|
||||
g_assert_false (fp_device_is_open (device));
|
||||
@@ -426,7 +640,7 @@ test_driver_close (void)
|
||||
FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device);
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
fp_device_close_sync (device, NULL, &error);
|
||||
g_assert_true (fp_device_close_sync (device, NULL, &error));
|
||||
g_assert (fake_dev->last_called_function == dev_class->close);
|
||||
|
||||
g_assert_no_error (error);
|
||||
@@ -442,12 +656,12 @@ test_driver_close_error (void)
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
fake_dev->ret_error = fpi_device_error_new (FP_DEVICE_ERROR_GENERAL);
|
||||
fp_device_close_sync (device, NULL, &error);
|
||||
g_assert_false (fp_device_close_sync (device, NULL, &error));
|
||||
|
||||
g_assert (fake_dev->last_called_function == dev_class->close);
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL);
|
||||
g_assert (error == g_steal_pointer (&fake_dev->ret_error));
|
||||
g_assert_true (fp_device_is_open (device));
|
||||
g_assert_false (fp_device_is_open (device));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -529,7 +743,7 @@ test_driver_enroll_error_no_print (void)
|
||||
"*Driver passed an error but also provided a print, returning error*");
|
||||
|
||||
fake_dev->ret_error = fpi_device_error_new (FP_DEVICE_ERROR_GENERAL);
|
||||
fake_dev->ret_print = fp_print_new (device);
|
||||
fake_dev->ret_print = make_fake_print_reffed (device, NULL);
|
||||
g_object_add_weak_pointer (G_OBJECT (fake_dev->ret_print),
|
||||
(gpointer) (&fake_dev->ret_print));
|
||||
out_print =
|
||||
@@ -620,7 +834,8 @@ test_driver_enroll_progress_vfunc (FpDevice *device)
|
||||
|
||||
expected_data->completed_stages =
|
||||
g_random_int_range (fp_device_get_nr_enroll_stages (device), G_MAXINT32);
|
||||
expected_data->print = fp_print_new (device);
|
||||
expected_data->print = make_fake_print_reffed (device,
|
||||
g_variant_new_int32 (expected_data->completed_stages));
|
||||
expected_data->error = NULL;
|
||||
|
||||
error = fpi_device_error_new (FP_DEVICE_ERROR_GENERAL);
|
||||
@@ -678,10 +893,11 @@ test_driver_enroll_progress (void)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gboolean called;
|
||||
FpPrint *match;
|
||||
FpPrint *print;
|
||||
GError *error;
|
||||
gboolean called;
|
||||
FpPrint *match;
|
||||
FpPrint *print;
|
||||
GPtrArray *gallery;
|
||||
GError *error;
|
||||
} MatchCbData;
|
||||
|
||||
static void
|
||||
@@ -724,6 +940,14 @@ test_driver_match_cb (FpDevice *device,
|
||||
|
||||
if (match)
|
||||
g_assert_no_error (error);
|
||||
|
||||
/* Compar gallery if this is an identify operation */
|
||||
if (data->gallery)
|
||||
{
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
g_assert_false (fake_dev->action_data == data->gallery);
|
||||
assert_equal_galleries (fake_dev->action_data, data->gallery);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -731,7 +955,7 @@ test_driver_verify (void)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(FpAutoCloseDevice) device = auto_close_fake_device_new ();
|
||||
g_autoptr(FpPrint) enrolled_print = g_object_ref_sink (fp_print_new (device));
|
||||
g_autoptr(FpPrint) enrolled_print = make_fake_print_reffed (device, NULL);
|
||||
g_autoptr(FpPrint) out_print = NULL;
|
||||
g_autoptr(MatchCbData) match_data = g_new0 (MatchCbData, 1);
|
||||
FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device);
|
||||
@@ -739,9 +963,9 @@ test_driver_verify (void)
|
||||
gboolean match;
|
||||
|
||||
fake_dev->ret_result = FPI_MATCH_SUCCESS;
|
||||
fp_device_verify_sync (device, enrolled_print, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&match, &out_print, &error);
|
||||
g_assert_true (fp_device_verify_sync (device, enrolled_print, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&match, &out_print, &error));
|
||||
|
||||
g_assert (fake_dev->last_called_function == dev_class->verify);
|
||||
g_assert (fake_dev->action_data == enrolled_print);
|
||||
@@ -761,17 +985,18 @@ test_driver_verify_fail (void)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(FpAutoCloseDevice) device = auto_close_fake_device_new ();
|
||||
g_autoptr(FpPrint) enrolled_print = g_object_ref_sink (fp_print_new (device));
|
||||
g_autoptr(FpPrint) enrolled_print = NULL;
|
||||
g_autoptr(FpPrint) out_print = NULL;
|
||||
g_autoptr(MatchCbData) match_data = g_new0 (MatchCbData, 1);
|
||||
FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device);
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
gboolean match;
|
||||
|
||||
enrolled_print = make_fake_print_reffed (device, g_variant_new_uint64 (3));
|
||||
fake_dev->ret_result = FPI_MATCH_FAIL;
|
||||
fp_device_verify_sync (device, enrolled_print, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&match, &out_print, &error);
|
||||
g_assert_true (fp_device_verify_sync (device, enrolled_print, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&match, &out_print, &error));
|
||||
|
||||
g_assert (fake_dev->last_called_function == dev_class->verify);
|
||||
g_assert_no_error (error);
|
||||
@@ -790,7 +1015,7 @@ test_driver_verify_retry (void)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(FpAutoCloseDevice) device = auto_close_fake_device_new ();
|
||||
g_autoptr(FpPrint) enrolled_print = g_object_ref_sink (fp_print_new (device));
|
||||
g_autoptr(FpPrint) enrolled_print = make_fake_print_reffed (device, NULL);
|
||||
g_autoptr(FpPrint) out_print = NULL;
|
||||
g_autoptr(MatchCbData) match_data = g_new0 (MatchCbData, 1);
|
||||
FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device);
|
||||
@@ -799,9 +1024,9 @@ test_driver_verify_retry (void)
|
||||
|
||||
fake_dev->ret_result = FPI_MATCH_ERROR;
|
||||
fake_dev->ret_error = fpi_device_retry_new (FP_DEVICE_RETRY_GENERAL);
|
||||
fp_device_verify_sync (device, enrolled_print, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&match, &out_print, &error);
|
||||
g_assert_false (fp_device_verify_sync (device, enrolled_print, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&match, &out_print, &error));
|
||||
|
||||
g_assert_true (match_data->called);
|
||||
g_assert_null (match_data->match);
|
||||
@@ -818,7 +1043,7 @@ test_driver_verify_error (void)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(FpAutoCloseDevice) device = auto_close_fake_device_new ();
|
||||
g_autoptr(FpPrint) enrolled_print = g_object_ref_sink (fp_print_new (device));
|
||||
g_autoptr(FpPrint) enrolled_print = make_fake_print_reffed (device, NULL);
|
||||
g_autoptr(FpPrint) out_print = NULL;
|
||||
g_autoptr(MatchCbData) match_data = g_new0 (MatchCbData, 1);
|
||||
FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device);
|
||||
@@ -827,9 +1052,9 @@ test_driver_verify_error (void)
|
||||
|
||||
fake_dev->ret_result = FPI_MATCH_ERROR;
|
||||
fake_dev->ret_error = fpi_device_error_new (FP_DEVICE_ERROR_GENERAL);
|
||||
fp_device_verify_sync (device, enrolled_print, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&match, &out_print, &error);
|
||||
g_assert_false (fp_device_verify_sync (device, enrolled_print, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&match, &out_print, &error));
|
||||
|
||||
g_assert_false (match_data->called);
|
||||
g_assert_null (match_data->match);
|
||||
@@ -857,16 +1082,16 @@ test_driver_verify_not_reported (void)
|
||||
|
||||
dev_class->verify = fake_device_verify_immediate_complete;
|
||||
device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
enrolled_print = g_object_ref_sink (fp_print_new (device));
|
||||
enrolled_print = make_fake_print_reffed (device, NULL);
|
||||
|
||||
g_assert_true (fp_device_open_sync (device, NULL, NULL));
|
||||
|
||||
g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
|
||||
"*reported successful verify complete*not report*result*");
|
||||
|
||||
fp_device_verify_sync (device, enrolled_print, NULL,
|
||||
NULL, NULL,
|
||||
NULL, NULL, &error);
|
||||
g_assert_false (fp_device_verify_sync (device, enrolled_print, NULL,
|
||||
NULL, NULL,
|
||||
NULL, NULL, &error));
|
||||
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL);
|
||||
|
||||
@@ -900,7 +1125,7 @@ test_driver_verify_report_no_callback (void)
|
||||
dev_class->verify = fake_device_verify_complete_error;
|
||||
device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
fake_dev = FPI_DEVICE_FAKE (device);
|
||||
enrolled_print = g_object_ref_sink (fp_print_new (device));
|
||||
enrolled_print = make_fake_print_reffed (device, NULL);
|
||||
|
||||
g_assert_true (fp_device_open_sync (device, NULL, NULL));
|
||||
|
||||
@@ -909,9 +1134,9 @@ test_driver_verify_report_no_callback (void)
|
||||
|
||||
fake_dev->ret_result = FPI_MATCH_ERROR;
|
||||
fake_dev->ret_error = fpi_device_error_new (FP_DEVICE_ERROR_NOT_SUPPORTED);
|
||||
fp_device_verify_sync (device, enrolled_print, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&match, &print, &error);
|
||||
g_assert_false (fp_device_verify_sync (device, enrolled_print, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&match, &print, &error));
|
||||
|
||||
g_test_assert_expected_messages ();
|
||||
|
||||
@@ -940,7 +1165,7 @@ test_driver_verify_complete_retry (void)
|
||||
dev_class->verify = fake_device_verify_complete_error;
|
||||
device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
fake_dev = FPI_DEVICE_FAKE (device);
|
||||
enrolled_print = g_object_ref_sink (fp_print_new (device));
|
||||
enrolled_print = make_fake_print_reffed (device, NULL);
|
||||
|
||||
g_assert_true (fp_device_open_sync (device, NULL, NULL));
|
||||
|
||||
@@ -950,8 +1175,8 @@ test_driver_verify_complete_retry (void)
|
||||
test_driver_match_data_clear (match_data);
|
||||
fake_dev->ret_result = FPI_MATCH_FAIL;
|
||||
fake_dev->ret_error = fpi_device_retry_new (FP_DEVICE_RETRY_TOO_SHORT);
|
||||
fp_device_verify_sync (device, enrolled_print, NULL, test_driver_match_cb,
|
||||
match_data, &match, &print, &error);
|
||||
g_assert_false (fp_device_verify_sync (device, enrolled_print, NULL, test_driver_match_cb,
|
||||
match_data, &match, &print, &error));
|
||||
g_test_assert_expected_messages ();
|
||||
|
||||
g_assert_true (error == g_steal_pointer (&fake_dev->ret_error));
|
||||
@@ -972,8 +1197,8 @@ test_driver_verify_complete_retry (void)
|
||||
fake_dev->ret_result = FPI_MATCH_FAIL;
|
||||
fake_dev->ret_error = fpi_device_retry_new (FP_DEVICE_RETRY_TOO_SHORT);
|
||||
fake_dev->user_data = g_error_copy (fake_dev->ret_error);
|
||||
fp_device_verify_sync (device, enrolled_print, NULL, test_driver_match_cb,
|
||||
match_data, &match, &print, &error);
|
||||
g_assert_false (fp_device_verify_sync (device, enrolled_print, NULL, test_driver_match_cb,
|
||||
match_data, &match, &print, &error));
|
||||
|
||||
g_test_assert_expected_messages ();
|
||||
g_assert_true (error != g_steal_pointer (&fake_dev->ret_error));
|
||||
@@ -994,8 +1219,8 @@ test_driver_verify_complete_retry (void)
|
||||
fake_dev->ret_error = fpi_device_retry_new (FP_DEVICE_RETRY_TOO_SHORT);
|
||||
fake_dev->user_data = g_error_copy (fake_dev->ret_error);
|
||||
|
||||
fp_device_verify_sync (device, enrolled_print, NULL, test_driver_match_cb,
|
||||
match_data, &match, &print, &error);
|
||||
g_assert_false (fp_device_verify_sync (device, enrolled_print, NULL, test_driver_match_cb,
|
||||
match_data, &match, &print, &error));
|
||||
g_test_assert_expected_messages ();
|
||||
|
||||
g_assert_true (error != g_steal_pointer (&fake_dev->ret_error));
|
||||
@@ -1014,8 +1239,8 @@ test_driver_verify_complete_retry (void)
|
||||
test_driver_match_data_clear (match_data);
|
||||
fake_dev->ret_result = FPI_MATCH_ERROR;
|
||||
|
||||
fp_device_verify_sync (device, enrolled_print, NULL, test_driver_match_cb,
|
||||
match_data, &match, &print, &error);
|
||||
g_assert_false (fp_device_verify_sync (device, enrolled_print, NULL, test_driver_match_cb,
|
||||
match_data, &match, &print, &error));
|
||||
g_test_assert_expected_messages ();
|
||||
|
||||
g_assert_true (error != g_steal_pointer (&fake_dev->ret_error));
|
||||
@@ -1033,12 +1258,12 @@ test_driver_verify_complete_retry (void)
|
||||
test_driver_match_data_clear (match_data);
|
||||
fake_dev->ret_result = FPI_MATCH_ERROR;
|
||||
fake_dev->ret_error = fpi_device_retry_new (FP_DEVICE_RETRY_TOO_SHORT);
|
||||
fake_dev->ret_print = fp_print_new (device);
|
||||
fake_dev->ret_print = make_fake_print (device, NULL);
|
||||
g_object_add_weak_pointer (G_OBJECT (fake_dev->ret_print),
|
||||
(gpointer) (&fake_dev->ret_print));
|
||||
|
||||
fp_device_verify_sync (device, enrolled_print, NULL, test_driver_match_cb,
|
||||
match_data, &match, &print, &error);
|
||||
g_assert_false (fp_device_verify_sync (device, enrolled_print, NULL, test_driver_match_cb,
|
||||
match_data, &match, &print, &error));
|
||||
g_test_assert_expected_messages ();
|
||||
|
||||
g_assert_error (error, FP_DEVICE_RETRY, FP_DEVICE_RETRY_TOO_SHORT);
|
||||
@@ -1087,25 +1312,23 @@ test_driver_identify (void)
|
||||
g_autoptr(FpPrint) print = NULL;
|
||||
g_autoptr(FpPrint) matched_print = NULL;
|
||||
g_autoptr(FpAutoCloseDevice) device = auto_close_fake_device_new ();
|
||||
g_autoptr(GPtrArray) prints = g_ptr_array_new_with_free_func (g_object_unref);
|
||||
g_autoptr(GPtrArray) prints = make_fake_prints_gallery (device, 500);
|
||||
g_autoptr(MatchCbData) match_data = g_new0 (MatchCbData, 1);
|
||||
FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device);
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
FpPrint *expected_matched;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < 500; ++i)
|
||||
g_ptr_array_add (prints, g_object_ref_sink (fp_print_new (device)));
|
||||
|
||||
expected_matched = g_ptr_array_index (prints, g_random_int_range (0, 499));
|
||||
fp_print_set_description (expected_matched, "fake-verified");
|
||||
|
||||
g_assert_true (fp_device_supports_identify (device));
|
||||
|
||||
fake_dev->ret_print = fp_print_new (device);
|
||||
fp_device_identify_sync (device, prints, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&matched_print, &print, &error);
|
||||
match_data->gallery = prints;
|
||||
|
||||
fake_dev->ret_print = make_fake_print (device, NULL);
|
||||
g_assert_true (fp_device_identify_sync (device, prints, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&matched_print, &print, &error));
|
||||
|
||||
g_assert_true (match_data->called);
|
||||
g_assert_nonnull (match_data->match);
|
||||
@@ -1113,7 +1336,6 @@ test_driver_identify (void)
|
||||
g_assert_true (match_data->print == print);
|
||||
|
||||
g_assert (fake_dev->last_called_function == dev_class->identify);
|
||||
g_assert (fake_dev->action_data == prints);
|
||||
g_assert_no_error (error);
|
||||
|
||||
g_assert (print != NULL && print == fake_dev->ret_print);
|
||||
@@ -1127,21 +1349,17 @@ test_driver_identify_fail (void)
|
||||
g_autoptr(FpPrint) print = NULL;
|
||||
g_autoptr(FpPrint) matched_print = NULL;
|
||||
g_autoptr(FpAutoCloseDevice) device = auto_close_fake_device_new ();
|
||||
g_autoptr(GPtrArray) prints = g_ptr_array_new_with_free_func (g_object_unref);
|
||||
g_autoptr(GPtrArray) prints = make_fake_prints_gallery (device, 500);
|
||||
g_autoptr(MatchCbData) match_data = g_new0 (MatchCbData, 1);
|
||||
FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device);
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < 500; ++i)
|
||||
g_ptr_array_add (prints, g_object_ref_sink (fp_print_new (device)));
|
||||
|
||||
g_assert_true (fp_device_supports_identify (device));
|
||||
|
||||
fake_dev->ret_print = fp_print_new (device);
|
||||
fp_device_identify_sync (device, prints, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&matched_print, &print, &error);
|
||||
fake_dev->ret_print = make_fake_print (device, NULL);
|
||||
g_assert_true (fp_device_identify_sync (device, prints, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&matched_print, &print, &error));
|
||||
|
||||
g_assert_true (match_data->called);
|
||||
g_assert_null (match_data->match);
|
||||
@@ -1163,15 +1381,11 @@ test_driver_identify_retry (void)
|
||||
g_autoptr(FpPrint) print = NULL;
|
||||
g_autoptr(FpPrint) matched_print = NULL;
|
||||
g_autoptr(FpAutoCloseDevice) device = auto_close_fake_device_new ();
|
||||
g_autoptr(GPtrArray) prints = g_ptr_array_new_with_free_func (g_object_unref);
|
||||
g_autoptr(GPtrArray) prints = make_fake_prints_gallery (device, 500);
|
||||
g_autoptr(MatchCbData) match_data = g_new0 (MatchCbData, 1);
|
||||
FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device);
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
FpPrint *expected_matched;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < 500; ++i)
|
||||
g_ptr_array_add (prints, g_object_ref_sink (fp_print_new (device)));
|
||||
|
||||
expected_matched = g_ptr_array_index (prints, g_random_int_range (0, 499));
|
||||
fp_print_set_description (expected_matched, "fake-verified");
|
||||
@@ -1179,9 +1393,9 @@ test_driver_identify_retry (void)
|
||||
g_assert_true (fp_device_supports_identify (device));
|
||||
|
||||
fake_dev->ret_error = fpi_device_retry_new (FP_DEVICE_RETRY_GENERAL);
|
||||
fp_device_identify_sync (device, prints, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&matched_print, &print, &error);
|
||||
g_assert_false (fp_device_identify_sync (device, prints, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&matched_print, &print, &error));
|
||||
|
||||
g_assert_true (match_data->called);
|
||||
g_assert_null (match_data->match);
|
||||
@@ -1201,15 +1415,11 @@ test_driver_identify_error (void)
|
||||
g_autoptr(FpPrint) print = NULL;
|
||||
g_autoptr(FpPrint) matched_print = NULL;
|
||||
g_autoptr(FpAutoCloseDevice) device = auto_close_fake_device_new ();
|
||||
g_autoptr(GPtrArray) prints = g_ptr_array_new_with_free_func (g_object_unref);
|
||||
g_autoptr(GPtrArray) prints = make_fake_prints_gallery (device, 500);
|
||||
g_autoptr(MatchCbData) match_data = g_new0 (MatchCbData, 1);
|
||||
FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device);
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
FpPrint *expected_matched;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < 500; ++i)
|
||||
g_ptr_array_add (prints, g_object_ref_sink (fp_print_new (device)));
|
||||
|
||||
expected_matched = g_ptr_array_index (prints, g_random_int_range (0, 499));
|
||||
fp_print_set_description (expected_matched, "fake-verified");
|
||||
@@ -1217,9 +1427,9 @@ test_driver_identify_error (void)
|
||||
g_assert_true (fp_device_supports_identify (device));
|
||||
|
||||
fake_dev->ret_error = fpi_device_error_new (FP_DEVICE_ERROR_GENERAL);
|
||||
fp_device_identify_sync (device, prints, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&matched_print, &print, &error);
|
||||
g_assert_false (fp_device_identify_sync (device, prints, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&matched_print, &print, &error));
|
||||
|
||||
g_assert_false (match_data->called);
|
||||
g_assert_null (match_data->match);
|
||||
@@ -1243,24 +1453,21 @@ test_driver_identify_not_reported (void)
|
||||
{
|
||||
g_autoptr(FpAutoResetClass) dev_class = auto_reset_device_class ();
|
||||
g_autoptr(FpAutoCloseDevice) device = NULL;
|
||||
g_autoptr(GPtrArray) prints = g_ptr_array_new_with_free_func (g_object_unref);
|
||||
g_autoptr(GPtrArray) prints = NULL;
|
||||
g_autoptr(GError) error = NULL;
|
||||
unsigned int i;
|
||||
|
||||
dev_class->identify = fake_device_identify_immediate_complete;
|
||||
device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
|
||||
for (i = 0; i < 500; ++i)
|
||||
g_ptr_array_add (prints, g_object_ref_sink (fp_print_new (device)));
|
||||
prints = make_fake_prints_gallery (device, 500);
|
||||
|
||||
g_assert_true (fp_device_open_sync (device, NULL, NULL));
|
||||
|
||||
g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
|
||||
"*reported successful identify complete*not report*result*");
|
||||
|
||||
fp_device_identify_sync (device, prints, NULL,
|
||||
NULL, NULL,
|
||||
NULL, NULL, &error);
|
||||
g_assert_false (fp_device_identify_sync (device, prints, NULL,
|
||||
NULL, NULL,
|
||||
NULL, NULL, &error));
|
||||
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL);
|
||||
|
||||
@@ -1283,21 +1490,18 @@ static void
|
||||
test_driver_identify_complete_retry (void)
|
||||
{
|
||||
g_autoptr(FpAutoResetClass) dev_class = auto_reset_device_class ();
|
||||
g_autoptr(GPtrArray) prints = g_ptr_array_new_with_free_func (g_object_unref);
|
||||
g_autoptr(GPtrArray) prints = NULL;
|
||||
g_autoptr(MatchCbData) match_data = g_new0 (MatchCbData, 1);
|
||||
g_autoptr(FpAutoCloseDevice) device = NULL;
|
||||
g_autoptr(FpPrint) print = NULL;
|
||||
g_autoptr(FpPrint) match = NULL;
|
||||
g_autoptr(GError) error = NULL;
|
||||
FpiDeviceFake *fake_dev;
|
||||
int i;
|
||||
|
||||
dev_class->identify = fake_device_identify_complete_error;
|
||||
device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
for (i = 0; i < 500; ++i)
|
||||
g_ptr_array_add (prints, g_object_ref_sink (fp_print_new (device)));
|
||||
prints = make_fake_prints_gallery (device, 500);
|
||||
|
||||
g_assert_true (fp_device_open_sync (device, NULL, NULL));
|
||||
|
||||
@@ -1309,8 +1513,9 @@ test_driver_identify_complete_retry (void)
|
||||
fake_dev->ret_error = fpi_device_retry_new (FP_DEVICE_RETRY_TOO_SHORT);
|
||||
fake_dev->user_data = g_error_copy (fake_dev->ret_error);
|
||||
|
||||
fp_device_identify_sync (device, prints, NULL, test_driver_match_cb, match_data,
|
||||
&match, &print, &error);
|
||||
g_assert_false (fp_device_identify_sync (device, prints, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&match, &print, &error));
|
||||
g_test_assert_expected_messages ();
|
||||
|
||||
g_assert_true (error != g_steal_pointer (&fake_dev->ret_error));
|
||||
@@ -1326,11 +1531,12 @@ test_driver_identify_complete_retry (void)
|
||||
"*Driver reported a match to a print that was not in the gallery*");
|
||||
|
||||
test_driver_match_data_clear (match_data);
|
||||
fake_dev->ret_match = fp_print_new (device);
|
||||
fake_dev->ret_match = make_fake_print_reffed (device, NULL);
|
||||
g_object_add_weak_pointer (G_OBJECT (fake_dev->ret_match),
|
||||
(gpointer) (&fake_dev->ret_match));
|
||||
fp_device_identify_sync (device, prints, NULL, test_driver_match_cb, match_data,
|
||||
&match, &print, &error);
|
||||
g_assert_true (fp_device_identify_sync (device, prints, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&match, &print, &error));
|
||||
g_test_assert_expected_messages ();
|
||||
|
||||
g_object_unref (fake_dev->ret_match);
|
||||
@@ -1349,11 +1555,12 @@ test_driver_identify_complete_retry (void)
|
||||
test_driver_match_data_clear (match_data);
|
||||
fake_dev->ret_error = fpi_device_retry_new (FP_DEVICE_RETRY_REMOVE_FINGER);
|
||||
fake_dev->ret_match = prints->pdata[0];
|
||||
fake_dev->ret_print = fp_print_new (device);
|
||||
fake_dev->ret_print = make_fake_print (device, NULL);
|
||||
g_object_add_weak_pointer (G_OBJECT (fake_dev->ret_print),
|
||||
(gpointer) (&fake_dev->ret_print));
|
||||
fp_device_identify_sync (device, prints, NULL, test_driver_match_cb, match_data,
|
||||
&match, &print, &error);
|
||||
g_assert_false (fp_device_identify_sync (device, prints, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&match, &print, &error));
|
||||
g_test_assert_expected_messages ();
|
||||
|
||||
g_assert_error (error, FP_DEVICE_RETRY, FP_DEVICE_RETRY_REMOVE_FINGER);
|
||||
@@ -1371,7 +1578,7 @@ test_driver_identify_report_no_callback (void)
|
||||
{
|
||||
g_autoptr(FpAutoResetClass) dev_class = auto_reset_device_class ();
|
||||
g_autoptr(MatchCbData) match_data = g_new0 (MatchCbData, 1);
|
||||
g_autoptr(GPtrArray) prints = g_ptr_array_new_with_free_func (g_object_unref);
|
||||
g_autoptr(GPtrArray) prints = NULL;
|
||||
g_autoptr(FpAutoCloseDevice) device = NULL;
|
||||
G_GNUC_UNUSED g_autoptr(FpPrint) enrolled_print = NULL;
|
||||
g_autoptr(FpPrint) print = NULL;
|
||||
@@ -1382,7 +1589,8 @@ test_driver_identify_report_no_callback (void)
|
||||
dev_class->identify = fake_device_identify_complete_error;
|
||||
device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
fake_dev = FPI_DEVICE_FAKE (device);
|
||||
enrolled_print = g_object_ref_sink (fp_print_new (device));
|
||||
prints = make_fake_prints_gallery (device, 0);
|
||||
enrolled_print = make_fake_print_reffed (device, NULL);
|
||||
|
||||
g_assert_true (fp_device_open_sync (device, NULL, NULL));
|
||||
|
||||
@@ -1390,9 +1598,9 @@ test_driver_identify_report_no_callback (void)
|
||||
"*Driver reported a verify error that was not in the retry domain*");
|
||||
|
||||
fake_dev->ret_error = fpi_device_error_new (FP_DEVICE_ERROR_NOT_SUPPORTED);
|
||||
fp_device_identify_sync (device, prints, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&match, &print, &error);
|
||||
g_assert_false (fp_device_identify_sync (device, prints, NULL,
|
||||
test_driver_match_cb, match_data,
|
||||
&match, &print, &error));
|
||||
|
||||
g_test_assert_expected_messages ();
|
||||
|
||||
@@ -1509,15 +1717,10 @@ test_driver_list (void)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(FpAutoCloseDevice) device = auto_close_fake_device_new ();
|
||||
g_autoptr(GPtrArray) prints = make_fake_prints_gallery (device, 500);
|
||||
FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device);
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
g_autoptr(GPtrArray) prints = g_ptr_array_new_with_free_func (g_object_unref);
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < 500; ++i)
|
||||
g_ptr_array_add (prints, fp_print_new (device));
|
||||
|
||||
fake_dev->ret_list = g_steal_pointer (&prints);
|
||||
prints = fp_device_list_prints_sync (device, NULL, &error);
|
||||
|
||||
@@ -1570,7 +1773,7 @@ test_driver_delete (void)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(FpAutoCloseDevice) device = auto_close_fake_device_new ();
|
||||
g_autoptr(FpPrint) enrolled_print = fp_print_new (device);
|
||||
g_autoptr(FpPrint) enrolled_print = make_fake_print_reffed (device, NULL);
|
||||
FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device);
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
gboolean ret;
|
||||
@@ -1587,7 +1790,7 @@ test_driver_delete_error (void)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(FpAutoCloseDevice) device = auto_close_fake_device_new ();
|
||||
g_autoptr(FpPrint) enrolled_print = fp_print_new (device);
|
||||
g_autoptr(FpPrint) enrolled_print = make_fake_print_reffed (device, NULL);
|
||||
FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device);
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
gboolean ret;
|
||||
@@ -1655,7 +1858,7 @@ test_driver_cancel (void)
|
||||
device = auto_close_fake_device_new ();
|
||||
fake_dev = FPI_DEVICE_FAKE (device);
|
||||
cancellable = g_cancellable_new ();
|
||||
enrolled_print = fp_print_new (device);
|
||||
enrolled_print = make_fake_print_reffed (device, NULL);
|
||||
|
||||
fp_device_delete_print (device, enrolled_print, cancellable,
|
||||
on_driver_cancel_delete, &completed);
|
||||
@@ -1673,11 +1876,11 @@ test_driver_cancel_fail (void)
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(FpAutoCloseDevice) device = auto_close_fake_device_new ();
|
||||
g_autoptr(GCancellable) cancellable = g_cancellable_new ();
|
||||
g_autoptr(FpPrint) enrolled_print = fp_print_new (device);
|
||||
g_autoptr(FpPrint) enrolled_print = make_fake_print_reffed (device, NULL);
|
||||
FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device);
|
||||
FpiDeviceFake *fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
fp_device_delete_print_sync (device, enrolled_print, cancellable, &error);
|
||||
g_assert_true (fp_device_delete_print_sync (device, enrolled_print, cancellable, &error));
|
||||
g_assert (fake_dev->last_called_function == dev_class->delete);
|
||||
g_cancellable_cancel (cancellable);
|
||||
|
||||
@@ -1748,7 +1951,7 @@ test_driver_action_get_cancellable_open (void)
|
||||
fake_dev = FPI_DEVICE_FAKE (device);
|
||||
|
||||
cancellable = g_cancellable_new ();
|
||||
fp_device_open_sync (device, cancellable, NULL);
|
||||
g_assert_true (fp_device_open_sync (device, cancellable, NULL));
|
||||
|
||||
g_assert (fake_dev->last_called_function == test_driver_action_get_cancellable_open_vfunc);
|
||||
}
|
||||
@@ -1907,8 +2110,8 @@ static void
|
||||
test_driver_action_error_all (void)
|
||||
{
|
||||
g_autoptr(FpAutoCloseDevice) device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
g_autoptr(FpPrint) enrolled_print = g_object_ref_sink (fp_print_new (device));
|
||||
g_autoptr(GPtrArray) prints = g_ptr_array_new_with_free_func (g_object_unref);
|
||||
g_autoptr(FpPrint) enrolled_print = make_fake_print_reffed (device, NULL);
|
||||
g_autoptr(GPtrArray) prints = make_fake_prints_gallery (device, 0);
|
||||
g_autoptr(GError) error = NULL;
|
||||
FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device);
|
||||
FpiDeviceFake *fake_dev;
|
||||
@@ -1928,12 +2131,6 @@ test_driver_action_error_all (void)
|
||||
|
||||
fake_dev->return_action_error = TRUE;
|
||||
|
||||
fake_dev->ret_error = fpi_device_error_new (FP_DEVICE_ERROR_DATA_INVALID);
|
||||
g_assert_false (fp_device_close_sync (device, NULL, &error));
|
||||
g_assert_true (fake_dev->last_called_function == dev_class->close);
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_DATA_INVALID);
|
||||
g_clear_error (&error);
|
||||
|
||||
fake_dev->ret_error = fpi_device_error_new (FP_DEVICE_ERROR_DATA_INVALID);
|
||||
g_assert_null (fp_device_enroll_sync (device, fp_print_new (device), NULL,
|
||||
NULL, NULL, &error));
|
||||
@@ -1972,14 +2169,21 @@ test_driver_action_error_all (void)
|
||||
g_assert_true (fake_dev->last_called_function == dev_class->delete);
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_DATA_INVALID);
|
||||
g_clear_error (&error);
|
||||
|
||||
/* Test close last, as we can't operate on a closed device. */
|
||||
fake_dev->ret_error = fpi_device_error_new (FP_DEVICE_ERROR_DATA_INVALID);
|
||||
g_assert_false (fp_device_close_sync (device, NULL, &error));
|
||||
g_assert_true (fake_dev->last_called_function == dev_class->close);
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_DATA_INVALID);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
|
||||
static void
|
||||
test_driver_action_error_fallback_all (void)
|
||||
{
|
||||
g_autoptr(FpAutoCloseDevice) device = g_object_new (FPI_TYPE_DEVICE_FAKE, NULL);
|
||||
g_autoptr(FpPrint) enrolled_print = g_object_ref_sink (fp_print_new (device));
|
||||
g_autoptr(GPtrArray) prints = g_ptr_array_new_with_free_func (g_object_unref);
|
||||
g_autoptr(FpPrint) enrolled_print = make_fake_print_reffed (device, NULL);
|
||||
g_autoptr(GPtrArray) prints = make_fake_prints_gallery (device, 0);
|
||||
g_autoptr(GError) error = NULL;
|
||||
FpDeviceClass *dev_class = FP_DEVICE_GET_CLASS (device);
|
||||
FpiDeviceFake *fake_dev;
|
||||
@@ -2005,16 +2209,6 @@ test_driver_action_error_fallback_all (void)
|
||||
"error function*");
|
||||
|
||||
fake_dev->return_action_error = TRUE;
|
||||
g_assert_false (fp_device_close_sync (device, NULL, &error));
|
||||
g_test_assert_expected_messages ();
|
||||
g_assert_true (fake_dev->last_called_function == dev_class->close);
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL);
|
||||
g_clear_error (&error);
|
||||
|
||||
g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
|
||||
"*Device failed to pass an error to generic action "
|
||||
"error function*");
|
||||
|
||||
g_assert_null (fp_device_enroll_sync (device, fp_print_new (device), NULL,
|
||||
NULL, NULL, &error));
|
||||
g_test_assert_expected_messages ();
|
||||
@@ -2074,6 +2268,17 @@ test_driver_action_error_fallback_all (void)
|
||||
g_assert_true (fake_dev->last_called_function == dev_class->delete);
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL);
|
||||
g_clear_error (&error);
|
||||
|
||||
/* Test close last, as we can't operate on a closed device. */
|
||||
g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
|
||||
"*Device failed to pass an error to generic action "
|
||||
"error function*");
|
||||
|
||||
g_assert_false (fp_device_close_sync (device, NULL, &error));
|
||||
g_test_assert_expected_messages ();
|
||||
g_assert_true (fake_dev->last_called_function == dev_class->close);
|
||||
g_assert_error (error, FP_DEVICE_ERROR, FP_DEVICE_ERROR_GENERAL);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2207,6 +2412,10 @@ main (int argc, char *argv[])
|
||||
g_test_add_func ("/driver/get_scan_type/swipe", test_driver_get_scan_type_swipe);
|
||||
g_test_add_func ("/driver/set_scan_type/press", test_driver_set_scan_type_press);
|
||||
g_test_add_func ("/driver/set_scan_type/swipe", test_driver_set_scan_type_swipe);
|
||||
g_test_add_func ("/driver/finger_status/inactive", test_driver_finger_status_inactive);
|
||||
g_test_add_func ("/driver/finger_status/waiting", test_driver_finger_status_needed);
|
||||
g_test_add_func ("/driver/finger_status/present", test_driver_finger_status_present);
|
||||
g_test_add_func ("/driver/finger_status/changes", test_driver_finger_status_changes);
|
||||
g_test_add_func ("/driver/get_nr_enroll_stages", test_driver_get_nr_enroll_stages);
|
||||
g_test_add_func ("/driver/set_nr_enroll_stages", test_driver_set_nr_enroll_stages);
|
||||
g_test_add_func ("/driver/supports_identify", test_driver_supports_identify);
|
||||
|
||||
6
tests/umockdev-test.py
Executable file → Normal file
6
tests/umockdev-test.py
Executable file → Normal file
@@ -87,6 +87,12 @@ try:
|
||||
if os.path.exists(os.path.join(ddir, "custom.ioctl")):
|
||||
custom()
|
||||
|
||||
except Exception as e:
|
||||
# Store created output files for inspection (in the build directory)
|
||||
outdir = os.path.join('errors', os.path.basename(ddir))
|
||||
shutil.copytree(tmpdir, outdir, dirs_exist_ok=True)
|
||||
raise e
|
||||
|
||||
finally:
|
||||
shutil.rmtree(tmpdir)
|
||||
|
||||
|
||||
217
tests/vfs301/capture-recorded.ioctl
Normal file
217
tests/vfs301/capture-recorded.ioctl
Normal file
File diff suppressed because one or more lines are too long
199
tests/vfs301/capture.ioctl
Normal file
199
tests/vfs301/capture.ioctl
Normal file
File diff suppressed because one or more lines are too long
BIN
tests/vfs301/capture.png
Normal file
BIN
tests/vfs301/capture.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
307
tests/vfs301/device
Normal file
307
tests/vfs301/device
Normal file
@@ -0,0 +1,307 @@
|
||||
P: /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3
|
||||
N: bus/usb/002/005=12011001FF10FF088A130500900C0000000109022700010100A0320904000003FF000000070501024000000705810240000007058202400000
|
||||
E: DEVNAME=/dev/bus/usb/002/005
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=138a/5/c90
|
||||
E: TYPE=255/16/255
|
||||
E: BUSNUM=002
|
||||
E: DEVNUM=005
|
||||
E: MAJOR=189
|
||||
E: MINOR=132
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=138a
|
||||
E: ID_VENDOR_ENC=138a
|
||||
E: ID_VENDOR_ID=138a
|
||||
E: ID_MODEL=0005
|
||||
E: ID_MODEL_ENC=0005
|
||||
E: ID_MODEL_ID=0005
|
||||
E: ID_REVISION=0c90
|
||||
E: ID_SERIAL=138a_0005
|
||||
E: ID_BUS=usb
|
||||
E: ID_USB_INTERFACES=:ff0000:
|
||||
E: ID_VENDOR_FROM_DATABASE=Validity Sensors, Inc.
|
||||
E: ID_MODEL_FROM_DATABASE=VFS301 Fingerprint Reader
|
||||
E: ID_PATH=pci-0000:00:1d.0-usb-0:1.3
|
||||
E: ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_3
|
||||
E: LIBFPRINT_DRIVER=Validity VFS301
|
||||
A: authorized=1
|
||||
A: avoid_reset_quirk=0
|
||||
A: bConfigurationValue=1
|
||||
A: bDeviceClass=ff
|
||||
A: bDeviceProtocol=ff
|
||||
A: bDeviceSubClass=10
|
||||
A: bMaxPacketSize0=8
|
||||
A: bMaxPower=100mA
|
||||
A: bNumConfigurations=1
|
||||
A: bNumInterfaces= 1
|
||||
A: bcdDevice=0c90
|
||||
A: bmAttributes=a0
|
||||
A: busnum=2
|
||||
A: configuration=
|
||||
H: descriptors=12011001FF10FF088A130500900C0000000109022700010100A0320904000003FF000000070501024000000705810240000007058202400000
|
||||
A: dev=189:132
|
||||
A: devnum=5
|
||||
A: devpath=1.3
|
||||
L: driver=../../../../../../bus/usb/drivers/usb
|
||||
A: idProduct=0005
|
||||
A: idVendor=138a
|
||||
A: ltm_capable=no
|
||||
A: maxchild=0
|
||||
L: port=../2-1:1.0/2-1-port3
|
||||
A: power/active_duration=1612976
|
||||
A: power/async=enabled
|
||||
A: power/autosuspend=2
|
||||
A: power/autosuspend_delay_ms=2000
|
||||
A: power/connected_duration=2159928
|
||||
A: power/control=auto
|
||||
A: power/level=auto
|
||||
A: power/persist=1
|
||||
A: power/runtime_active_kids=0
|
||||
A: power/runtime_active_time=1612851
|
||||
A: power/runtime_enabled=enabled
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=546887
|
||||
A: power/runtime_usage=0
|
||||
A: power/wakeup=disabled
|
||||
A: power/wakeup_abort_count=
|
||||
A: power/wakeup_active=
|
||||
A: power/wakeup_active_count=
|
||||
A: power/wakeup_count=
|
||||
A: power/wakeup_expire_count=
|
||||
A: power/wakeup_last_time_ms=
|
||||
A: power/wakeup_max_time_ms=
|
||||
A: power/wakeup_total_time_ms=
|
||||
A: quirks=0x0
|
||||
A: removable=fixed
|
||||
A: rx_lanes=1
|
||||
A: speed=12
|
||||
A: tx_lanes=1
|
||||
A: urbnum=7
|
||||
A: version= 1.10
|
||||
|
||||
P: /devices/pci0000:00/0000:00:1d.0/usb2/2-1
|
||||
N: bus/usb/002/002=12010002090001408780200000000000000109021900010100E0000904000001090000000705810302000C
|
||||
E: DEVNAME=/dev/bus/usb/002/002
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=8087/20/0
|
||||
E: TYPE=9/0/1
|
||||
E: BUSNUM=002
|
||||
E: DEVNUM=002
|
||||
E: MAJOR=189
|
||||
E: MINOR=129
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=8087
|
||||
E: ID_VENDOR_ENC=8087
|
||||
E: ID_VENDOR_ID=8087
|
||||
E: ID_MODEL=0020
|
||||
E: ID_MODEL_ENC=0020
|
||||
E: ID_MODEL_ID=0020
|
||||
E: ID_REVISION=0000
|
||||
E: ID_SERIAL=8087_0020
|
||||
E: ID_BUS=usb
|
||||
E: ID_USB_INTERFACES=:090000:
|
||||
E: ID_VENDOR_FROM_DATABASE=Intel Corp.
|
||||
E: ID_MODEL_FROM_DATABASE=Integrated Rate Matching Hub
|
||||
E: ID_PATH=pci-0000:00:1d.0-usb-0:1
|
||||
E: ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1
|
||||
E: ID_FOR_SEAT=usb-pci-0000_00_1d_0-usb-0_1
|
||||
E: TAGS=:seat:
|
||||
A: authorized=1
|
||||
A: avoid_reset_quirk=0
|
||||
A: bConfigurationValue=1
|
||||
A: bDeviceClass=09
|
||||
A: bDeviceProtocol=01
|
||||
A: bDeviceSubClass=00
|
||||
A: bMaxPacketSize0=64
|
||||
A: bMaxPower=0mA
|
||||
A: bNumConfigurations=1
|
||||
A: bNumInterfaces= 1
|
||||
A: bcdDevice=0000
|
||||
A: bmAttributes=e0
|
||||
A: busnum=2
|
||||
A: configuration=
|
||||
H: descriptors=12010002090001408780200000000000000109021900010100E0000904000001090000000705810302000C
|
||||
A: dev=189:129
|
||||
A: devnum=2
|
||||
A: devpath=1
|
||||
L: driver=../../../../../bus/usb/drivers/usb
|
||||
A: idProduct=0020
|
||||
A: idVendor=8087
|
||||
A: ltm_capable=no
|
||||
A: maxchild=8
|
||||
L: port=../2-0:1.0/usb2-port1
|
||||
A: power/active_duration=2160820
|
||||
A: power/async=enabled
|
||||
A: power/autosuspend=0
|
||||
A: power/autosuspend_delay_ms=0
|
||||
A: power/connected_duration=2160824
|
||||
A: power/control=auto
|
||||
A: power/level=auto
|
||||
A: power/runtime_active_kids=3
|
||||
A: power/runtime_active_time=2160531
|
||||
A: power/runtime_enabled=enabled
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=0
|
||||
A: power/runtime_usage=0
|
||||
A: power/wakeup=disabled
|
||||
A: power/wakeup_abort_count=
|
||||
A: power/wakeup_active=
|
||||
A: power/wakeup_active_count=
|
||||
A: power/wakeup_count=
|
||||
A: power/wakeup_expire_count=
|
||||
A: power/wakeup_last_time_ms=
|
||||
A: power/wakeup_max_time_ms=
|
||||
A: power/wakeup_total_time_ms=
|
||||
A: quirks=0x0
|
||||
A: removable=fixed
|
||||
A: rx_lanes=1
|
||||
A: speed=480
|
||||
A: tx_lanes=1
|
||||
A: urbnum=75
|
||||
A: version= 2.00
|
||||
|
||||
P: /devices/pci0000:00/0000:00:1d.0/usb2
|
||||
N: bus/usb/002/001=12010002090000406B1D020004050302010109021900010100E0000904000001090000000705810304000C
|
||||
E: DEVNAME=/dev/bus/usb/002/001
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: PRODUCT=1d6b/2/504
|
||||
E: TYPE=9/0/0
|
||||
E: BUSNUM=002
|
||||
E: DEVNUM=001
|
||||
E: MAJOR=189
|
||||
E: MINOR=128
|
||||
E: SUBSYSTEM=usb
|
||||
E: ID_VENDOR=Linux_5.4.0-48-generic_ehci_hcd
|
||||
E: ID_VENDOR_ENC=Linux\x205.4.0-48-generic\x20ehci_hcd
|
||||
E: ID_VENDOR_ID=1d6b
|
||||
E: ID_MODEL=EHCI_Host_Controller
|
||||
E: ID_MODEL_ENC=EHCI\x20Host\x20Controller
|
||||
E: ID_MODEL_ID=0002
|
||||
E: ID_REVISION=0504
|
||||
E: ID_SERIAL=Linux_5.4.0-48-generic_ehci_hcd_EHCI_Host_Controller_0000:00:1d.0
|
||||
E: ID_SERIAL_SHORT=0000:00:1d.0
|
||||
E: ID_BUS=usb
|
||||
E: ID_USB_INTERFACES=:090000:
|
||||
E: ID_VENDOR_FROM_DATABASE=Linux Foundation
|
||||
E: ID_MODEL_FROM_DATABASE=2.0 root hub
|
||||
E: ID_PATH=pci-0000:00:1d.0
|
||||
E: ID_PATH_TAG=pci-0000_00_1d_0
|
||||
E: ID_FOR_SEAT=usb-pci-0000_00_1d_0
|
||||
E: TAGS=:seat:
|
||||
A: authorized=1
|
||||
A: authorized_default=1
|
||||
A: avoid_reset_quirk=0
|
||||
A: bConfigurationValue=1
|
||||
A: bDeviceClass=09
|
||||
A: bDeviceProtocol=00
|
||||
A: bDeviceSubClass=00
|
||||
A: bMaxPacketSize0=64
|
||||
A: bMaxPower=0mA
|
||||
A: bNumConfigurations=1
|
||||
A: bNumInterfaces= 1
|
||||
A: bcdDevice=0504
|
||||
A: bmAttributes=e0
|
||||
A: busnum=2
|
||||
A: configuration=
|
||||
H: descriptors=12010002090000406B1D020004050302010109021900010100E0000904000001090000000705810304000C
|
||||
A: dev=189:128
|
||||
A: devnum=1
|
||||
A: devpath=0
|
||||
L: driver=../../../../bus/usb/drivers/usb
|
||||
A: idProduct=0002
|
||||
A: idVendor=1d6b
|
||||
A: interface_authorized_default=1
|
||||
A: ltm_capable=no
|
||||
A: manufacturer=Linux 5.4.0-48-generic ehci_hcd
|
||||
A: maxchild=3
|
||||
A: power/active_duration=2161060
|
||||
A: power/async=enabled
|
||||
A: power/autosuspend=0
|
||||
A: power/autosuspend_delay_ms=0
|
||||
A: power/connected_duration=2161060
|
||||
A: power/control=auto
|
||||
A: power/level=auto
|
||||
A: power/runtime_active_kids=1
|
||||
A: power/runtime_active_time=2161035
|
||||
A: power/runtime_enabled=enabled
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=0
|
||||
A: power/runtime_usage=0
|
||||
A: power/wakeup=disabled
|
||||
A: power/wakeup_abort_count=
|
||||
A: power/wakeup_active=
|
||||
A: power/wakeup_active_count=
|
||||
A: power/wakeup_count=
|
||||
A: power/wakeup_expire_count=
|
||||
A: power/wakeup_last_time_ms=
|
||||
A: power/wakeup_max_time_ms=
|
||||
A: power/wakeup_total_time_ms=
|
||||
A: product=EHCI Host Controller
|
||||
A: quirks=0x0
|
||||
A: removable=unknown
|
||||
A: rx_lanes=1
|
||||
A: serial=0000:00:1d.0
|
||||
A: speed=480
|
||||
A: tx_lanes=1
|
||||
A: urbnum=26
|
||||
A: version= 2.00
|
||||
|
||||
P: /devices/pci0000:00/0000:00:1d.0
|
||||
E: DRIVER=ehci-pci
|
||||
E: PCI_CLASS=C0320
|
||||
E: PCI_ID=8086:3B34
|
||||
E: PCI_SUBSYS_ID=103C:7001
|
||||
E: PCI_SLOT_NAME=0000:00:1d.0
|
||||
E: MODALIAS=pci:v00008086d00003B34sv0000103Csd00007001bc0Csc03i20
|
||||
E: SUBSYSTEM=pci
|
||||
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
|
||||
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
|
||||
E: ID_PCI_INTERFACE_FROM_DATABASE=EHCI
|
||||
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
|
||||
E: ID_MODEL_FROM_DATABASE=5 Series/3400 Series Chipset USB2 Enhanced Host Controller
|
||||
A: ari_enabled=0
|
||||
A: broken_parity_status=0
|
||||
A: class=0x0c0320
|
||||
A: companion=
|
||||
H: config=8680343B060090020520030C00000000005810DB0000000000000000000000000000000000000000000000003C1001700000000050000000000000000B010000
|
||||
A: consistent_dma_mask_bits=32
|
||||
A: d3cold_allowed=1
|
||||
A: device=0x3b34
|
||||
A: dma_mask_bits=32
|
||||
L: driver=../../../bus/pci/drivers/ehci-pci
|
||||
A: driver_override=(null)
|
||||
A: enable=1
|
||||
A: irq=21
|
||||
A: local_cpulist=0-7
|
||||
A: local_cpus=ff
|
||||
A: modalias=pci:v00008086d00003B34sv0000103Csd00007001bc0Csc03i20
|
||||
A: msi_bus=1
|
||||
A: numa_node=-1
|
||||
A: pools=poolinfo - 0.1\nehci_sitd 0 0 96 0\nehci_itd 0 0 192 0\nehci_qh 12 42 96 1\nehci_qtd 13 84 96 2\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 2 32 128 1\nbuffer-32 0 0 32 0
|
||||
A: power/async=enabled
|
||||
A: power/control=on
|
||||
A: power/runtime_active_kids=1
|
||||
A: power/runtime_active_time=2161633
|
||||
A: power/runtime_enabled=forbidden
|
||||
A: power/runtime_status=active
|
||||
A: power/runtime_suspended_time=0
|
||||
A: power/runtime_usage=1
|
||||
A: power/wakeup=enabled
|
||||
A: power/wakeup_abort_count=0
|
||||
A: power/wakeup_active=0
|
||||
A: power/wakeup_active_count=0
|
||||
A: power/wakeup_count=0
|
||||
A: power/wakeup_expire_count=0
|
||||
A: power/wakeup_last_time_ms=0
|
||||
A: power/wakeup_max_time_ms=0
|
||||
A: power/wakeup_total_time_ms=0
|
||||
A: resource=0x00000000db105800 0x00000000db105bff 0x0000000000040200\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000\n0x0000000000000000 0x0000000000000000 0x0000000000000000
|
||||
A: revision=0x05
|
||||
A: subsystem_device=0x7001
|
||||
A: subsystem_vendor=0x103c
|
||||
A: uframe_periodic_max=100
|
||||
A: vendor=0x8086
|
||||
|
||||
@@ -172,6 +172,7 @@ class VirtualImage(unittest.TestCase):
|
||||
def done_cb(dev, res):
|
||||
print("Enroll done")
|
||||
fp = dev.enroll_finish(res)
|
||||
self.assertEqual(self.dev.get_finger_status(), FPrint.FingerStatusFlags.NONE)
|
||||
self._enrolled = fp
|
||||
|
||||
template = FPrint.Print.new(self.dev)
|
||||
@@ -182,6 +183,7 @@ class VirtualImage(unittest.TestCase):
|
||||
date = GLib.Date()
|
||||
date.set_dmy(*datetime.get_ymd()[::-1])
|
||||
template.props.enroll_date = date
|
||||
self.assertEqual(self.dev.get_finger_status(), FPrint.FingerStatusFlags.NONE)
|
||||
self.dev.enroll(template, None, progress_cb, tuple(), done_cb)
|
||||
|
||||
# Note: Assumes 5 enroll steps for this device!
|
||||
@@ -192,25 +194,36 @@ class VirtualImage(unittest.TestCase):
|
||||
# Test the image-device path where the finger is removed after
|
||||
# the minutiae scan is completed.
|
||||
self.send_finger_automatic(False)
|
||||
self.assertEqual(self.dev.get_finger_status(), FPrint.FingerStatusFlags.NEEDED)
|
||||
self.send_finger_report(True)
|
||||
self.assertEqual(self.dev.get_finger_status(),
|
||||
FPrint.FingerStatusFlags.NEEDED | FPrint.FingerStatusFlags.PRESENT)
|
||||
self.send_image(image)
|
||||
while self._step < 2:
|
||||
ctx.iteration(True)
|
||||
self.send_finger_report(False)
|
||||
|
||||
self.assertEqual(self.dev.get_finger_status(), FPrint.FingerStatusFlags.NEEDED)
|
||||
|
||||
self.send_finger_automatic(True)
|
||||
self.send_image(image)
|
||||
while self._step < 3:
|
||||
ctx.iteration(True)
|
||||
|
||||
self.assertEqual(self.dev.get_finger_status(), FPrint.FingerStatusFlags.NEEDED)
|
||||
|
||||
self.send_image(image)
|
||||
while self._step < 4:
|
||||
ctx.iteration(True)
|
||||
|
||||
self.assertEqual(self.dev.get_finger_status(), FPrint.FingerStatusFlags.NEEDED)
|
||||
|
||||
self.send_image(image)
|
||||
while self._enrolled is None:
|
||||
ctx.iteration(True)
|
||||
|
||||
self.assertEqual(self.dev.get_finger_status(), FPrint.FingerStatusFlags.NONE)
|
||||
|
||||
return self._enrolled
|
||||
|
||||
def test_enroll_verify(self):
|
||||
|
||||
Reference in New Issue
Block a user