Finger Unit

The following products are supported:

FingerUnit

class FingerUnit

Constructors

class FingerUnit(id: Literal[0, 1, 2] = 1, port: list | tuple = None)

Create a FingerUnit object.

参数:
  • id – The ID of the UART, 0 or 1 or 2.

  • port – UART pin numbers.

UIFLOW2:

init.png

Methods

FingerUnit.sleep() bool

After calling this method successfully, FPC1020A will not be able to respond to any messages.

返回:

True if the command was successful, False otherwise.

UIFLOW2:

sleep.png

FingerUnit.get_add_mode() int

In the no-repeat mode, only one user can be added with the same finger, and an error message will be returned if the second round of adding is forced.

返回:

mode (0: no-repeat mode, 1: repeat mode)

UIFLOW2:

get_add_mode.png

FingerUnit.set_add_mode(mode: int) int

In the no-repeat mode, only one user can be added with the same finger, and an error message will be returned if the second round of adding is forced.

参数:

mode – mode (0: no-repeat mode, 1: repeat mode)

返回:

mode (0: no-repeat mode, 1: repeat mode)

UIFLOW2:

set_add_mode.png

FingerUnit.add_user(id: int, permission: Literal[1, 2, 3]) int

add new user

After calling this method, you need to put your finger on the fingerprint module.

参数:
  • id – user id (0-149)

  • permission – user permission (1: normal, 2: admin, 3: super admin)

返回:

-1 if the command was unsuccessful, otherwise the user id.

UIFLOW2:

add_user.png

FingerUnit.delete_user(id: int) int

Delete the user with the specified id.

参数:

id – user id (0-149)

返回:

-1 if the command was unsuccessful, otherwise the user id.

UIFLOW2:

delete_user.png

FingerUnit.delete_all_user() bool

Delete all users.

返回:

True if the command was successful, False otherwise.

UIFLOW2:

delete_all_user.png

FingerUnit.get_user_count() int

Get registered users count.

返回:

-1 if the command was unsuccessful, otherwise the number of registered users.

UIFLOW2:

get_user_count.png

FingerUnit.get_user_capacity() int

Get the maximum number of users that can be registered.

返回:

-1 if the command was unsuccessful, otherwise the maximum number of users that can be registered.

UIFLOW2:

get_user_capacity.png

FingerUnit.compare_id(id: int, timeout: int = 5000) bool

Check whether the currently collected fingerprint matches the specified user id.

参数:

id – user id (0-149)

返回:

-1 if the command was unsuccessful, otherwise the user id.

UIFLOW2:

compare_id.png

FingerUnit.compare_finger(timeout: int = 5000) int

Detect whether the currently collected fingerprint is a registered user.

返回:

-1 if the command was unsuccessful, otherwise the user id.

UIFLOW2:

compare_finger.png

FingerUnit.get_user_list() list

Get the list of registered users.

返回:

list of registered users.

UIFLOW2:

get_user_list.png

FingerUnit.get_user_info(id: int) Union[tuple, None]:

Get the information of the user with the specified id.

参数:

id – user id (0-149)

返回:

tuple of (id, permission) if the command was successful, None otherwise.

UIFLOW2:

get_user_info.png

FingerUnit.get_user_permission(id: int) int

Get the permission of the user with the specified id.

参数:

id – user id (0-149)

返回:

-1 if the command was unsuccessful, otherwise the permission of the user.

UIFLOW2:

get_user_permission.png

FingerUnit.get_user_characteristics(id: int) bytes | None

Get the characteristics of the user with the specified id.

参数:

id – user id (0-149)

返回:

bytes of the characteristics if the command was successful, None otherwise.

UIFLOW2:

get_user_characteristic.png

FingerUnit.add_user_info(id, permissions, characteristic, timeout: int = 5000) bool

Register a new user with FPC1020A.

参数:
  • id – user id (0-149)

  • permissions – user permission (1: normal, 2: admin, 3: super admin)

  • characteristic – user characteristics

  • timeout – timeout in milliseconds

返回:

True if the command was successful, False otherwise.

UIFLOW2:

add_user_info.png

FingerUnit.capture_characteristic(timeout: int = 5000) bytes

Capture the characteristics of the fingerprint.

参数:

timeout – timeout in milliseconds

返回:

bytes of the characteristics if the command was successful, None otherwise.

FingerUnit.get_match_level() int

The comparison level ranges from 0 to 9, the larger the value, the stricter the comparison, and the default value is 5.

返回:

match level (0-9)

UIFLOW2:

get_match_level.png

FingerUnit.set_match_level(level: int) int

The comparison level ranges from 0 to 9, the larger the value, the stricter the comparison, and the default value is 5.

参数:

level – match level (0-9)

返回:

match level (0-9)

UIFLOW2:

set_match_level.png

FingerUnit.get_version() str

Get the version information of FPC1020A.

返回:

version information.