New reformatting of code after rebase and changes.
This commit is contained in:
parent
9f116547d0
commit
4417e49612
13 changed files with 51 additions and 52 deletions
|
|
@ -158,11 +158,9 @@ class Device(dbus.service.Object):
|
||||||
logging.exception(e)
|
logging.exception(e)
|
||||||
self.EnrollStatus('enroll-failed', True)
|
self.EnrollStatus('enroll-failed', True)
|
||||||
|
|
||||||
if index == None:
|
if index is None:
|
||||||
logging.exception(
|
logging.exception('Unknown finger name passed to enroll? ' + finger_name + ' (' +
|
||||||
'Unknown finger name passed to enroll? ' +
|
winbio_name + ')')
|
||||||
finger_name + ' (' + winbio_name + ')'
|
|
||||||
)
|
|
||||||
self.EnrollStatus('enroll-failed', True)
|
self.EnrollStatus('enroll-failed', True)
|
||||||
else:
|
else:
|
||||||
thread = Thread(target=run)
|
thread = Thread(target=run)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
from validitysensor.usb import usb
|
|
||||||
from validitysensor.sensor import factory_reset, RebootException
|
from validitysensor.sensor import factory_reset, RebootException
|
||||||
|
from validitysensor.usb import usb
|
||||||
|
|
||||||
try:
|
try:
|
||||||
usb.open()
|
usb.open()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import dbus.mainloop.glib
|
import dbus.mainloop.glib
|
||||||
|
|
||||||
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
|
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
|
||||||
|
|
||||||
bus = dbus.SystemBus()
|
bus = dbus.SystemBus()
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ from binascii import hexlify
|
||||||
|
|
||||||
from validitysensor.sensor import sensor
|
from validitysensor.sensor import sensor
|
||||||
|
|
||||||
|
|
||||||
# usb.trace_enabled = True
|
# usb.trace_enabled = True
|
||||||
# tls.trace_enabled = True
|
# tls.trace_enabled = True
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
import typing
|
||||||
from binascii import hexlify
|
from binascii import hexlify
|
||||||
from struct import pack, unpack
|
from struct import pack, unpack
|
||||||
import typing
|
|
||||||
|
|
||||||
from .blobs import db_write_enable
|
from .blobs import db_write_enable
|
||||||
from .flash import call_cleanups
|
from .flash import call_cleanups
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,8 @@ class ModuleInfo:
|
||||||
|
|
||||||
|
|
||||||
class FirmwareInfo:
|
class FirmwareInfo:
|
||||||
def __init__(self, major: int, minor: int, buildtime: int, modules: typing.Sequence[ModuleInfo]):
|
def __init__(self, major: int, minor: int, buildtime: int,
|
||||||
|
modules: typing.Sequence[ModuleInfo]):
|
||||||
self.major, self.minor, self.buildtime, self.modules = major, minor, buildtime, modules
|
self.major, self.minor, self.buildtime, self.modules = major, minor, buildtime, modules
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
|
|
||||||
|
|
@ -408,7 +408,8 @@ class Sensor:
|
||||||
|
|
||||||
return key_line
|
return key_line
|
||||||
|
|
||||||
def line_update_type_1(self, mode: CaptureMode, chunks: typing.List[typing.List[typing.Union[int, bytes]]]):
|
def line_update_type_1(self, mode: CaptureMode,
|
||||||
|
chunks: typing.List[typing.List[typing.Union[int, bytes]]]):
|
||||||
for c in chunks:
|
for c in chunks:
|
||||||
# Timeslot Table 2D
|
# Timeslot Table 2D
|
||||||
if c[0] == 0x34:
|
if c[0] == 0x34:
|
||||||
|
|
@ -511,7 +512,8 @@ class Sensor:
|
||||||
|
|
||||||
return chunks
|
return chunks
|
||||||
|
|
||||||
def line_update_type_2(self, mode: CaptureMode, chunks: typing.List[typing.List[typing.Union[int, bytes]]]):
|
def line_update_type_2(self, mode: CaptureMode,
|
||||||
|
chunks: typing.List[typing.List[typing.Union[int, bytes]]]):
|
||||||
for c in chunks:
|
for c in chunks:
|
||||||
# patch the 2D params.
|
# patch the 2D params.
|
||||||
# The following is only needed on some rom versions below 6.5 as reported by cmd_01
|
# The following is only needed on some rom versions below 6.5 as reported by cmd_01
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ class SensorTypeInfo:
|
||||||
if i.sensor_type == sensor_type:
|
if i.sensor_type == sensor_type:
|
||||||
return i
|
return i
|
||||||
|
|
||||||
def __init__(self, sensor_type: int, bytes_per_line: int, repeat_multiplier: int, lines_per_calibration_data: int,
|
def __init__(self, sensor_type: int, bytes_per_line: int, repeat_multiplier: int,
|
||||||
line_width: int, calibration_blob: str):
|
lines_per_calibration_data: int, line_width: int, calibration_blob: str):
|
||||||
self.sensor_type = sensor_type
|
self.sensor_type = sensor_type
|
||||||
self.repeat_multiplier = repeat_multiplier
|
self.repeat_multiplier = repeat_multiplier
|
||||||
self.lines_per_calibration_data = lines_per_calibration_data
|
self.lines_per_calibration_data = lines_per_calibration_data
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
import typing
|
||||||
from binascii import hexlify
|
from binascii import hexlify
|
||||||
from struct import unpack, pack
|
from struct import unpack, pack
|
||||||
import typing
|
|
||||||
|
|
||||||
codes = {}
|
codes = {}
|
||||||
codes[0x0] = "No Operation"
|
codes[0x0] = "No Operation"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import logging
|
import logging
|
||||||
|
import typing
|
||||||
from os.path import basename
|
from os.path import basename
|
||||||
from time import ctime
|
from time import ctime
|
||||||
import typing
|
|
||||||
|
|
||||||
from .flash import write_flash_all, write_fw_signature, get_fw_info
|
from .flash import write_flash_all, write_fw_signature, get_fw_info
|
||||||
from .sensor import reboot, write_hw_reg32, read_hw_reg32, identify_sensor
|
from .sensor import reboot, write_hw_reg32, read_hw_reg32, identify_sensor
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import errno
|
import errno
|
||||||
import logging
|
import logging
|
||||||
|
import typing
|
||||||
from binascii import hexlify, unhexlify
|
from binascii import hexlify, unhexlify
|
||||||
from struct import unpack
|
from struct import unpack
|
||||||
import typing
|
|
||||||
|
|
||||||
import usb.core as ucore
|
import usb.core as ucore
|
||||||
from usb.core import USBError
|
from usb.core import USBError
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,10 @@ finger_ids = {
|
||||||
"WINBIO_ANSI_381_POS_LH_MIDDLE_FINGER": 8,
|
"WINBIO_ANSI_381_POS_LH_MIDDLE_FINGER": 8,
|
||||||
"WINBIO_ANSI_381_POS_LH_RING_FINGER": 9,
|
"WINBIO_ANSI_381_POS_LH_RING_FINGER": 9,
|
||||||
"WINBIO_ANSI_381_POS_LH_LITTLE_FINGER": 10,
|
"WINBIO_ANSI_381_POS_LH_LITTLE_FINGER": 10,
|
||||||
|
|
||||||
"WINBIO_ANSI_381_POS_RH_FOUR_FINGERS": 13,
|
"WINBIO_ANSI_381_POS_RH_FOUR_FINGERS": 13,
|
||||||
"WINBIO_ANSI_381_POS_LH_FOUR_FINGERS": 14,
|
"WINBIO_ANSI_381_POS_LH_FOUR_FINGERS": 14,
|
||||||
"WINBIO_ANSI_381_POS_TWO_THUMBS": 15,
|
"WINBIO_ANSI_381_POS_TWO_THUMBS": 15,
|
||||||
|
|
||||||
|
|
||||||
# https://github.com/tpn/winsdk-10/blob/9b69fd26ac0c7d0b83d378dba01080e93349c2ed/Include/10.0.16299.0/shared/winbio_types.h#L920-L929
|
# https://github.com/tpn/winsdk-10/blob/9b69fd26ac0c7d0b83d378dba01080e93349c2ed/Include/10.0.16299.0/shared/winbio_types.h#L920-L929
|
||||||
"WINBIO_FINGER_UNSPECIFIED_POS_01": 0xf5,
|
"WINBIO_FINGER_UNSPECIFIED_POS_01": 0xf5,
|
||||||
"WINBIO_FINGER_UNSPECIFIED_POS_02": 0xf6,
|
"WINBIO_FINGER_UNSPECIFIED_POS_02": 0xf6,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue