Add DeleteAllUsers command

This commit is contained in:
2020-11-30 09:05:16 +01:00
parent da763d5912
commit bf8ce006e4
2 changed files with 21 additions and 1 deletions

View File

@@ -312,6 +312,26 @@ namespace WaveshareUARTFingerprintSensor
return false; return false;
} }
public bool DeleteAllUsers()
{
if (TrySendAndReceive(CommandType.DeleteAllUsers, 0, 0, 0, out var response, 1000))
{
return response.responseType == ResponseType.Success;
}
return false;
}
public bool DeleteAllUsersWithPermission(UserPermission userPermission)
{
if (TrySendAndReceive(CommandType.DeleteAllUsers, 0, 0, (byte)userPermission, out var response, 1000))
{
return response.responseType == ResponseType.Success;
}
return false;
}
private void OnWake() private void OnWake()
{ {
if (_wakePin.Read()) if (_wakePin.Read())

View File

@@ -1,6 +1,6 @@
namespace WaveshareUARTFingerprintSensor namespace WaveshareUARTFingerprintSensor
{ {
public enum UserPermission public enum UserPermission : byte
{ {
Level1 = 1, Level1 = 1,
Level2 = 2, Level2 = 2,