OSDP.Net 5.2.1
A .NET library for implementing the Open Supervised Device Protocol (OSDP)
Loading...
Searching...
No Matches
BiometricMatchResult.cs
1using System;
2using System.Text;
3
5{
9 public class BiometricMatchResult
10 {
14 private BiometricMatchResult()
15 {
16 }
17
21 public byte ReaderNumber { get; private set; }
22
26 public BiometricStatus Status { get; private set; }
27
31 public byte Score { get; private set; }
32
37 internal static BiometricMatchResult ParseData(ReadOnlySpan<byte> data)
38 {
39 var dataArray = data.ToArray();
40 if (dataArray.Length != 3)
41 {
42 throw new Exception("Invalid size for the data");
43 }
44
45 var biometricResult = new BiometricMatchResult
46 {
47 ReaderNumber = dataArray[0],
48 Status = typeof(BiometricStatus).IsEnumDefined((int)data[1])
49 ? (BiometricStatus)data[1]
50 : BiometricStatus.UnknownError,
51 Score = dataArray[2]
52 };
53
54 return biometricResult;
55 }
56
58 public override string ToString()
59 {
60 var build = new StringBuilder();
61 build.AppendLine($"Reader Number: {ReaderNumber}");
62 build.AppendLine($" Status: {Status}");
63 build.AppendLine($" Score: {Score}");
64
65 return build.ToString();
66 }
67 }
68}
A biometric match reply after a scan.
BiometricStatus Status
Gets the results of the PD performing the biometric scan.
byte ReaderNumber
Gets the reader number 0=First Reader 1=Second Reader.
byte Score
Gets biometric score with no match at 0x00 and best match at 0xFF.
BiometricStatus
Results of the biometric scanning.