Add TryQueryPermission command

This commit is contained in:
2020-11-30 09:39:50 +01:00
parent 713a3a2188
commit 76163715bb

View File

@@ -359,6 +359,25 @@ namespace WaveshareUARTFingerprintSensor
return false;
}
public bool TryQueryPermission(ushort userID, out UserPermission userPermission)
{
(byte high, byte low) = Utils.Split(userID);
if (TrySendAndReceive(CommandType.QueryPermission, high, low, 0, out var reponse, 1000))
{
if (reponse.responseType != ResponseType.NoUser)
{
userPermission = (UserPermission)reponse.responseType;
return true;
}
}
userPermission = default;
return true;
}
public void Sleep()
{
_sleeping = true;