OSDP.Net 5.2.1
A .NET library for implementing the Open Supervised Device Protocol (OSDP)
Loading...
Searching...
No Matches
BiometricReadData.cs
1using System;
2using System.Text;
5
7{
12 {
20 public BiometricReadData(byte readerNumber, BiometricType biometricType, BiometricFormat biometricFormatType,
21 byte quality)
22 {
23 ReaderNumber = readerNumber;
24 BiometricType = biometricType;
25 BiometricFormatType = biometricFormatType;
26 Quality = quality;
27 }
28
32 public byte ReaderNumber { get; }
33
38
43
47 public byte Quality { get; }
48
50 public override CommandType CommandType => CommandType.BioRead;
51
53 public override byte Code => (byte)CommandType;
54
56 public override ReadOnlySpan<byte> SecurityControlBlock() => SecurityBlock.CommandMessageWithDataSecurity;
57
59 public override byte[] BuildData()
60 {
61 return new []
62 {
64 (byte)BiometricType,
67 };
68 }
69
73 public static BiometricReadData ParseData(ReadOnlySpan<byte> data)
74 {
75 return new BiometricReadData(
76 data[0],
77 (BiometricType)data[1],
78 (BiometricFormat)data[2],
79 data[3]);
80 }
81
83 public override string ToString()
84 {
85 var sb = new StringBuilder();
86 sb.AppendLine($"Reader #: {ReaderNumber}");
87 sb.AppendLine($"Bio Type: {BiometricType}");
88 sb.AppendLine($" Format: {BiometricFormatType}");
89 sb.AppendLine($" Quality: {Quality}");
90 return sb.ToString();
91 }
92 }
93}
Contains standard Security Control Block data that can be used when building messages.
static BiometricReadData ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
BiometricFormat BiometricFormatType
Gets the format of the attached template.
BiometricReadData(byte readerNumber, BiometricType biometricType, BiometricFormat biometricFormatType, byte quality)
Initializes a new instance of the BiometricReadData class.
BiometricType BiometricType
Gets the type/body part to scan.
byte ReaderNumber
Gets the reader number starting at 0.
override ReadOnlySpan< byte > SecurityControlBlock()
Base class representing a payload of a PD command message.
BiometricFormat
Format of data to be scanned.