mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-05-11 08:28:08 +02:00
Merge branch 'focaltech-moh' into 'master'
focaltech: Add driver for FocalTech FT9362 fingerprint sensor See merge request libfprint/libfprint!588
This commit is contained in:
commit
106b22e0ec
10 changed files with 1602 additions and 2 deletions
|
|
@ -177,6 +177,11 @@ usb:v1C7Ap0603*
|
|||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver focaltech
|
||||
usb:v2808pC652*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
# Supported by libfprint driver focaltech_moc
|
||||
usb:v2808p9E48*
|
||||
usb:v2808pD979*
|
||||
|
|
@ -488,7 +493,6 @@ usb:v2808p9338*
|
|||
usb:v2808p9348*
|
||||
usb:v2808p93A9*
|
||||
usb:v2808pA658*
|
||||
usb:v2808pC652*
|
||||
usb:v2808pA553*
|
||||
usb:v298Dp2020*
|
||||
usb:v298Dp2033*
|
||||
|
|
|
|||
1178
libfprint/drivers/focaltech.c
Normal file
1178
libfprint/drivers/focaltech.c
Normal file
File diff suppressed because it is too large
Load diff
25
libfprint/drivers/focaltech.h
Normal file
25
libfprint/drivers/focaltech.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright (C) 2026 FocalTech Microelectronics
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "fpi-device.h"
|
||||
#include "fpi-ssm.h"
|
||||
|
||||
G_DECLARE_FINAL_TYPE (FpiDeviceFocaltech, fpi_device_focaltech,
|
||||
FPI, DEVICE_FOCALTECH, FpDevice)
|
||||
|
|
@ -162,7 +162,6 @@ static const FpIdEntry allowlist_id_table[] = {
|
|||
{ .vid = 0x2808, .pid = 0x9348 },
|
||||
{ .vid = 0x2808, .pid = 0x93a9 },
|
||||
{ .vid = 0x2808, .pid = 0xa658 },
|
||||
{ .vid = 0x2808, .pid = 0xc652 },
|
||||
{ .vid = 0x2808, .pid = 0xa553 },
|
||||
{ .vid = 0x298d, .pid = 0x2020 },
|
||||
{ .vid = 0x298d, .pid = 0x2033 },
|
||||
|
|
|
|||
|
|
@ -153,6 +153,8 @@ driver_sources = {
|
|||
[ 'drivers/realtek/realtek.c' ],
|
||||
'focaltech_moc' :
|
||||
[ 'drivers/focaltech_moc/focaltech_moc.c' ],
|
||||
'focaltech' :
|
||||
[ 'drivers/focaltech.c' ],
|
||||
}
|
||||
|
||||
helper_sources = {
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@ default_drivers = [
|
|||
'fpcmoc',
|
||||
'realtek',
|
||||
'focaltech_moc',
|
||||
'focaltech',
|
||||
]
|
||||
|
||||
spi_drivers = [
|
||||
|
|
@ -168,6 +169,7 @@ endian_independent_drivers = virtual_drivers + [
|
|||
'elanmoc',
|
||||
'etes603',
|
||||
'focaltech_moc',
|
||||
'focaltech',
|
||||
'nb1010',
|
||||
'realtek',
|
||||
'synaptics',
|
||||
|
|
|
|||
BIN
tests/focaltech/custom.pcapng
Normal file
BIN
tests/focaltech/custom.pcapng
Normal file
Binary file not shown.
57
tests/focaltech/custom.py
Normal file
57
tests/focaltech/custom.py
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import traceback
|
||||
import sys
|
||||
import gi
|
||||
|
||||
gi.require_version('FPrint', '2.0')
|
||||
from gi.repository import FPrint, GLib
|
||||
|
||||
# Exit with error on any exception, included those happening in async callbacks
|
||||
sys.excepthook = lambda *args: (traceback.print_exception(*args), sys.exit(1))
|
||||
|
||||
ctx = GLib.main_context_default()
|
||||
|
||||
c = FPrint.Context()
|
||||
c.enumerate()
|
||||
devices = c.get_devices()
|
||||
|
||||
d = devices[0]
|
||||
del devices
|
||||
|
||||
assert d.get_driver() == "focaltech"
|
||||
assert not d.has_feature(FPrint.DeviceFeature.CAPTURE)
|
||||
assert d.has_feature(FPrint.DeviceFeature.IDENTIFY)
|
||||
assert d.has_feature(FPrint.DeviceFeature.VERIFY)
|
||||
assert not d.has_feature(FPrint.DeviceFeature.DUPLICATES_CHECK)
|
||||
assert not d.has_feature(FPrint.DeviceFeature.STORAGE)
|
||||
assert not d.has_feature(FPrint.DeviceFeature.STORAGE_LIST)
|
||||
assert not d.has_feature(FPrint.DeviceFeature.STORAGE_DELETE)
|
||||
assert not d.has_feature(FPrint.DeviceFeature.STORAGE_CLEAR)
|
||||
|
||||
d.open_sync()
|
||||
|
||||
template = FPrint.Print.new(d)
|
||||
|
||||
def enroll_progress(*args):
|
||||
print("finger status: ", d.get_finger_status())
|
||||
print('enroll progress: ' + str(args))
|
||||
|
||||
# Enroll, then verify
|
||||
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("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
|
||||
|
||||
d.close_sync()
|
||||
|
||||
del d
|
||||
del c
|
||||
332
tests/focaltech/device
Normal file
332
tests/focaltech/device
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -59,6 +59,7 @@ drivers_tests = [
|
|||
'realtek',
|
||||
'realtek-5816',
|
||||
'focaltech_moc',
|
||||
'focaltech',
|
||||
]
|
||||
|
||||
if get_option('introspection')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue