mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
Initial commit of egismoc driver
This commit is contained in:
committed by
Marco Trevisan (Treviño)
parent
54ff730f0c
commit
0b9a64331f
BIN
tests/egismoc/custom.pcapng
Normal file
BIN
tests/egismoc/custom.pcapng
Normal file
Binary file not shown.
156
tests/egismoc/custom.py
Executable file
156
tests/egismoc/custom.py
Executable file
@@ -0,0 +1,156 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import traceback
|
||||
import sys
|
||||
import time
|
||||
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
|
||||
|
||||
d.open_sync()
|
||||
|
||||
assert d.get_driver() == "egismoc"
|
||||
assert not d.has_feature(FPrint.DeviceFeature.CAPTURE)
|
||||
assert d.has_feature(FPrint.DeviceFeature.IDENTIFY)
|
||||
assert d.has_feature(FPrint.DeviceFeature.VERIFY)
|
||||
assert d.has_feature(FPrint.DeviceFeature.DUPLICATES_CHECK)
|
||||
assert d.has_feature(FPrint.DeviceFeature.STORAGE)
|
||||
assert d.has_feature(FPrint.DeviceFeature.STORAGE_LIST)
|
||||
assert d.has_feature(FPrint.DeviceFeature.STORAGE_DELETE)
|
||||
assert d.has_feature(FPrint.DeviceFeature.STORAGE_CLEAR)
|
||||
|
||||
def enroll_progress(*args):
|
||||
print("finger status: ", d.get_finger_status())
|
||||
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)
|
||||
|
||||
# Beginning with list and clear assumes you begin with >0 prints enrolled before capturing
|
||||
|
||||
print("listing - device should have prints")
|
||||
stored = d.list_prints_sync()
|
||||
assert len(stored) > 0
|
||||
del stored
|
||||
|
||||
print("clear device storage")
|
||||
d.clear_storage_sync()
|
||||
print("clear done")
|
||||
|
||||
print("listing - device should be empty")
|
||||
stored = d.list_prints_sync()
|
||||
assert len(stored) == 0
|
||||
del stored
|
||||
|
||||
print("enrolling")
|
||||
template = FPrint.Print.new(d)
|
||||
template.set_finger(FPrint.Finger.LEFT_INDEX)
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
p1 = d.enroll_sync(template, None, enroll_progress, None)
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
print("enroll done")
|
||||
del template
|
||||
|
||||
print("listing - device should have 1 print")
|
||||
stored = d.list_prints_sync()
|
||||
assert len(stored) == 1
|
||||
assert stored[0].equal(p1)
|
||||
|
||||
print("verifying")
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
verify_res, verify_print = d.verify_sync(p1)
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
print("verify done")
|
||||
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("try to enroll duplicate")
|
||||
template = FPrint.Print.new(d)
|
||||
template.set_finger(FPrint.Finger.RIGHT_INDEX)
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
try:
|
||||
d.enroll_sync(template, None, enroll_progress, None)
|
||||
except GLib.Error as error:
|
||||
assert error.matches(FPrint.DeviceError.quark(),
|
||||
FPrint.DeviceError.DATA_DUPLICATE)
|
||||
except Exception as exc:
|
||||
raise
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
print("duplicate enroll attempt done")
|
||||
|
||||
print("listing - device should still only have 1 print")
|
||||
stored = d.list_prints_sync()
|
||||
assert len(stored) == 1
|
||||
assert stored[0].equal(p1)
|
||||
del stored
|
||||
|
||||
print("enroll new finger")
|
||||
template = FPrint.Print.new(d)
|
||||
template.set_finger(FPrint.Finger.RIGHT_INDEX)
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
p2 = d.enroll_sync(template, None, enroll_progress, None)
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
print("enroll new finger done")
|
||||
del template
|
||||
|
||||
print("listing - device should have 2 prints")
|
||||
stored = d.list_prints_sync()
|
||||
assert len(stored) == 2
|
||||
assert (stored[0].equal(p1) and stored[1].equal(p2)) or (stored[0].equal(p2) and stored[1].equal(p1))
|
||||
del stored
|
||||
|
||||
print("deleting first print")
|
||||
d.delete_print_sync(p1)
|
||||
print("delete done")
|
||||
del p1
|
||||
|
||||
print("listing - device should only have second print")
|
||||
stored = d.list_prints_sync()
|
||||
assert len(stored) == 1
|
||||
assert stored[0].equal(p2)
|
||||
del stored
|
||||
del p2
|
||||
|
||||
print("clear device storage")
|
||||
d.clear_storage_sync()
|
||||
print("clear done")
|
||||
|
||||
print("listing - device should be empty")
|
||||
stored = d.list_prints_sync()
|
||||
assert len(stored) == 0
|
||||
del stored
|
||||
|
||||
d.close_sync()
|
||||
|
||||
del d
|
||||
del c
|
||||
262
tests/egismoc/device
Normal file
262
tests/egismoc/device
Normal file
@@ -0,0 +1,262 @@
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb3/3-5
|
||||
N: bus/usb/003/012=12010002FF0000407A1C820581110102030109022700010100A0320904000003FF000000070581020002000705020200020007058303400005
|
||||
E: BUSNUM=003
|
||||
E: CURRENT_TAGS=:snap_cups_ippeveprinter:snap_cups_cupsd:
|
||||
E: DEVNAME=/dev/bus/usb/003/012
|
||||
E: DEVNUM=012
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: ID_BUS=usb
|
||||
E: ID_MODEL=ETU905A80-E
|
||||
E: ID_MODEL_ENC=ETU905A80-E
|
||||
E: ID_MODEL_ID=0582
|
||||
E: ID_PATH=pci-0000:00:14.0-usb-0:5
|
||||
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_5
|
||||
E: ID_REVISION=1181
|
||||
E: ID_SERIAL=EGIS_ETU905A80-E_0E7828PBS393
|
||||
E: ID_SERIAL_SHORT=0E7828PBS393
|
||||
E: ID_USB_INTERFACES=:ff0000:
|
||||
E: ID_USB_MODEL=ETU905A80-E
|
||||
E: ID_USB_MODEL_ENC=ETU905A80-E
|
||||
E: ID_USB_MODEL_ID=0582
|
||||
E: ID_USB_REVISION=1181
|
||||
E: ID_USB_SERIAL=EGIS_ETU905A80-E_0E7828PBS393
|
||||
E: ID_USB_SERIAL_SHORT=0E7828PBS393
|
||||
E: ID_USB_VENDOR=EGIS
|
||||
E: ID_USB_VENDOR_ENC=EGIS
|
||||
E: ID_USB_VENDOR_ID=1c7a
|
||||
E: ID_VENDOR=EGIS
|
||||
E: ID_VENDOR_ENC=EGIS
|
||||
E: ID_VENDOR_FROM_DATABASE=LighTuning Technology Inc.
|
||||
E: ID_VENDOR_ID=1c7a
|
||||
E: MAJOR=189
|
||||
E: MINOR=267
|
||||
E: PRODUCT=1c7a/582/1181
|
||||
E: SUBSYSTEM=usb
|
||||
E: TAGS=:snap_cups_ippeveprinter:snap_cups_cupsd:
|
||||
E: TYPE=255/0/0
|
||||
A: authorized=1\n
|
||||
A: avoid_reset_quirk=0\n
|
||||
A: bConfigurationValue=1\n
|
||||
A: bDeviceClass=ff\n
|
||||
A: bDeviceProtocol=00\n
|
||||
A: bDeviceSubClass=00\n
|
||||
A: bMaxPacketSize0=64\n
|
||||
A: bMaxPower=100mA\n
|
||||
A: bNumConfigurations=1\n
|
||||
A: bNumInterfaces= 1\n
|
||||
A: bcdDevice=1181\n
|
||||
A: bmAttributes=a0\n
|
||||
A: busnum=3\n
|
||||
A: configuration=
|
||||
H: descriptors=12010002FF0000407A1C820581110102030109022700010100A0320904000003FF000000070581020002000705020200020007058303400005
|
||||
A: dev=189:267\n
|
||||
A: devnum=12\n
|
||||
A: devpath=5\n
|
||||
L: driver=../../../../../bus/usb/drivers/usb
|
||||
L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:51/device:52/device:57
|
||||
A: idProduct=0582\n
|
||||
A: idVendor=1c7a\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=EGIS\n
|
||||
A: maxchild=0\n
|
||||
A: physical_location/dock=no\n
|
||||
A: physical_location/horizontal_position=center\n
|
||||
A: physical_location/lid=no\n
|
||||
A: physical_location/panel=unknown\n
|
||||
A: physical_location/vertical_position=center\n
|
||||
L: port=../3-0:1.0/usb3-port5
|
||||
A: power/active_duration=1425996\n
|
||||
A: power/async=enabled\n
|
||||
A: power/autosuspend=2\n
|
||||
A: power/autosuspend_delay_ms=2000\n
|
||||
A: power/connected_duration=1426656\n
|
||||
A: power/control=on\n
|
||||
A: power/level=on\n
|
||||
A: power/persist=0\n
|
||||
A: power/runtime_active_kids=0\n
|
||||
A: power/runtime_active_time=1426124\n
|
||||
A: power/runtime_enabled=forbidden\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=0\n
|
||||
A: power/runtime_usage=1\n
|
||||
A: power/wakeup=disabled\n
|
||||
A: power/wakeup_abort_count=\n
|
||||
A: power/wakeup_active=\n
|
||||
A: power/wakeup_active_count=\n
|
||||
A: power/wakeup_count=\n
|
||||
A: power/wakeup_expire_count=\n
|
||||
A: power/wakeup_last_time_ms=\n
|
||||
A: power/wakeup_max_time_ms=\n
|
||||
A: power/wakeup_total_time_ms=\n
|
||||
A: product=ETU905A80-E\n
|
||||
A: quirks=0x0\n
|
||||
A: removable=fixed\n
|
||||
A: rx_lanes=1\n
|
||||
A: serial=0E7828PBS393\n
|
||||
A: speed=480\n
|
||||
A: tx_lanes=1\n
|
||||
A: urbnum=2803\n
|
||||
A: version= 2.00\n
|
||||
|
||||
P: /devices/pci0000:00/0000:00:14.0/usb3
|
||||
N: bus/usb/003/001=12010002090001406B1D020002060302010109021900010100E0000904000001090000000705810304000C
|
||||
E: BUSNUM=003
|
||||
E: CURRENT_TAGS=:seat:snap_cups_cupsd:snap_cups_ippeveprinter:
|
||||
E: DEVNAME=/dev/bus/usb/003/001
|
||||
E: DEVNUM=001
|
||||
E: DEVTYPE=usb_device
|
||||
E: DRIVER=usb
|
||||
E: ID_AUTOSUSPEND=1
|
||||
E: ID_BUS=usb
|
||||
E: ID_FOR_SEAT=usb-pci-0000_00_14_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:00:14.0
|
||||
E: ID_PATH_TAG=pci-0000_00_14_0
|
||||
E: ID_REVISION=0602
|
||||
E: ID_SERIAL=Linux_6.2.0-34-generic_xhci-hcd_xHCI_Host_Controller_0000:00:14.0
|
||||
E: ID_SERIAL_SHORT=0000:00:14.0
|
||||
E: ID_USB_INTERFACES=:090000:
|
||||
E: ID_USB_MODEL=xHCI_Host_Controller
|
||||
E: ID_USB_MODEL_ENC=xHCI\x20Host\x20Controller
|
||||
E: ID_USB_MODEL_ID=0002
|
||||
E: ID_USB_REVISION=0602
|
||||
E: ID_USB_SERIAL=Linux_6.2.0-34-generic_xhci-hcd_xHCI_Host_Controller_0000:00:14.0
|
||||
E: ID_USB_SERIAL_SHORT=0000:00:14.0
|
||||
E: ID_USB_VENDOR=Linux_6.2.0-34-generic_xhci-hcd
|
||||
E: ID_USB_VENDOR_ENC=Linux\x206.2.0-34-generic\x20xhci-hcd
|
||||
E: ID_USB_VENDOR_ID=1d6b
|
||||
E: ID_VENDOR=Linux_6.2.0-34-generic_xhci-hcd
|
||||
E: ID_VENDOR_ENC=Linux\x206.2.0-34-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/602
|
||||
E: SUBSYSTEM=usb
|
||||
E: TAGS=:snap_cups_cupsd:seat:snap_cups_ippeveprinter:
|
||||
E: TYPE=9/0/1
|
||||
A: authorized=1\n
|
||||
A: authorized_default=1\n
|
||||
A: avoid_reset_quirk=0\n
|
||||
A: bConfigurationValue=1\n
|
||||
A: bDeviceClass=09\n
|
||||
A: bDeviceProtocol=01\n
|
||||
A: bDeviceSubClass=00\n
|
||||
A: bMaxPacketSize0=64\n
|
||||
A: bMaxPower=0mA\n
|
||||
A: bNumConfigurations=1\n
|
||||
A: bNumInterfaces= 1\n
|
||||
A: bcdDevice=0602\n
|
||||
A: bmAttributes=e0\n
|
||||
A: busnum=3\n
|
||||
A: configuration=
|
||||
H: descriptors=12010002090001406B1D020002060302010109021900010100E0000904000001090000000705810304000C
|
||||
A: dev=189:256\n
|
||||
A: devnum=1\n
|
||||
A: devpath=0\n
|
||||
L: driver=../../../../bus/usb/drivers/usb
|
||||
L: firmware_node=../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:51/device:52
|
||||
A: idProduct=0002\n
|
||||
A: idVendor=1d6b\n
|
||||
A: interface_authorized_default=1\n
|
||||
A: ltm_capable=no\n
|
||||
A: manufacturer=Linux 6.2.0-34-generic xhci-hcd\n
|
||||
A: maxchild=12\n
|
||||
A: power/active_duration=337953872\n
|
||||
A: power/async=enabled\n
|
||||
A: power/autosuspend=0\n
|
||||
A: power/autosuspend_delay_ms=0\n
|
||||
A: power/connected_duration=337978524\n
|
||||
A: power/control=auto\n
|
||||
A: power/level=auto\n
|
||||
A: power/runtime_active_kids=1\n
|
||||
A: power/runtime_active_time=337962424\n
|
||||
A: power/runtime_enabled=enabled\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=616\n
|
||||
A: power/runtime_usage=0\n
|
||||
A: power/wakeup=disabled\n
|
||||
A: power/wakeup_abort_count=\n
|
||||
A: power/wakeup_active=\n
|
||||
A: power/wakeup_active_count=\n
|
||||
A: power/wakeup_count=\n
|
||||
A: power/wakeup_expire_count=\n
|
||||
A: power/wakeup_last_time_ms=\n
|
||||
A: power/wakeup_max_time_ms=\n
|
||||
A: power/wakeup_total_time_ms=\n
|
||||
A: product=xHCI Host Controller\n
|
||||
A: quirks=0x0\n
|
||||
A: removable=unknown\n
|
||||
A: rx_lanes=1\n
|
||||
A: serial=0000:00:14.0\n
|
||||
A: speed=480\n
|
||||
A: tx_lanes=1\n
|
||||
A: urbnum=4969\n
|
||||
A: version= 2.00\n
|
||||
|
||||
P: /devices/pci0000:00/0000:00:14.0
|
||||
E: DRIVER=xhci_hcd
|
||||
E: ID_MODEL_FROM_DATABASE=Alder Lake PCH USB 3.2 xHCI Host Controller
|
||||
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:v00008086d000051EDsv0000144Dsd0000C870bc0Csc03i30
|
||||
E: PCI_CLASS=C0330
|
||||
E: PCI_ID=8086:51ED
|
||||
E: PCI_SLOT_NAME=0000:00:14.0
|
||||
E: PCI_SUBSYS_ID=144D:C870
|
||||
E: SUBSYSTEM=pci
|
||||
A: ari_enabled=0\n
|
||||
A: broken_parity_status=0\n
|
||||
A: class=0x0c0330\n
|
||||
H: config=8680ED51060490020130030C000080000400161D6000000000000000000000000000000000000000000000004D1470C8000000007000000000000000FF010000FD0134A089C27F8000000000000000003F6DD80F000000000000000000000000316000000000000000000000000000000180C2C1080000000000000000000000059087007805E0FE000000000000000009B014F01000400100000000C10A080000080E00001800008F50020000010000090000018680C00009001014000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B50F010112000000
|
||||
A: consistent_dma_mask_bits=64\n
|
||||
A: d3cold_allowed=1\n
|
||||
A: dbc=disabled\n
|
||||
A: device=0x51ed\n
|
||||
A: dma_mask_bits=64\n
|
||||
L: driver=../../../bus/pci/drivers/xhci_hcd
|
||||
A: driver_override=(null)\n
|
||||
A: enable=1\n
|
||||
L: firmware_node=../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:51
|
||||
A: index=7\n
|
||||
L: iommu=../../virtual/iommu/dmar1
|
||||
L: iommu_group=../../../kernel/iommu_groups/8
|
||||
A: irq=145\n
|
||||
A: label=Onboard - Other\n
|
||||
A: local_cpulist=0-15\n
|
||||
A: local_cpus=ffff\n
|
||||
A: modalias=pci:v00008086d000051EDsv0000144Dsd0000C870bc0Csc03i30\n
|
||||
A: msi_bus=1\n
|
||||
A: msi_irqs/145=msi\n
|
||||
A: numa_node=-1\n
|
||||
A: pools=poolinfo - 0.1\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\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 6 9 2112 9\nxHCI ring segments 26 34 4096 34\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 0 32 128 1\nbuffer-32 0 0 32 0\n
|
||||
A: power/async=enabled\n
|
||||
A: power/control=auto\n
|
||||
A: power/runtime_active_kids=1\n
|
||||
A: power/runtime_active_time=337964621\n
|
||||
A: power/runtime_enabled=enabled\n
|
||||
A: power/runtime_status=active\n
|
||||
A: power/runtime_suspended_time=438\n
|
||||
A: power/runtime_usage=0\n
|
||||
A: power/wakeup=enabled\n
|
||||
A: power/wakeup_abort_count=0\n
|
||||
A: power/wakeup_active=0\n
|
||||
A: power/wakeup_active_count=7\n
|
||||
A: power/wakeup_count=0\n
|
||||
A: power/wakeup_expire_count=7\n
|
||||
A: power/wakeup_last_time_ms=336554844\n
|
||||
A: power/wakeup_max_time_ms=105\n
|
||||
A: power/wakeup_total_time_ms=721\n
|
||||
A: power_state=D0\n
|
||||
A: resource=0x000000601d160000 0x000000601d16ffff 0x0000000000140204\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\n
|
||||
A: revision=0x01\n
|
||||
A: subsystem_device=0xc870\n
|
||||
A: subsystem_vendor=0x144d\n
|
||||
A: vendor=0x8086\n
|
||||
|
||||
@@ -51,6 +51,7 @@ drivers_tests = [
|
||||
'goodixmoc',
|
||||
'nb1010',
|
||||
'egis0570',
|
||||
'egismoc',
|
||||
'fpcmoc',
|
||||
'realtek',
|
||||
'focaltech_moc',
|
||||
|
||||
Reference in New Issue
Block a user