Finger Unit
The following products are supported:
class FingerUnit
Constructors
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:

- 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:

- 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:

- 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:

- 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:

- FingerUnit.delete_all_user() bool
Delete all users.
- 返回:
True if the command was successful, False otherwise.
UIFLOW2:

- FingerUnit.get_user_count() int
Get registered users count.
- 返回:
-1 if the command was unsuccessful, otherwise the number of registered users.
UIFLOW2:

- 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:

- 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:

- 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:

- FingerUnit.get_user_list() list
Get the list of registered users.
- 返回:
list of registered users.
UIFLOW2:

- 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:

- 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:

- 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:

- 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:

- 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:



