29 PData = pData ??
throw new ArgumentNullException(nameof(pData));
56 var buffer =
new byte[2 +
PData.Length];
74 byte mode = data.Length > 0 ? data[0] : (byte)0;
75 byte pReply = data.Length > 1 ? data[1] : (byte)0;
76 byte[] pData = data.Length > 2 ? data.Slice(2).ToArray() : [];
86 new(0, 1, [currentMode, (byte)(enabled ? 1 : 0)]);
93 new(1, 1, [readerNumber]);
103 if (response ==
null)
throw new ArgumentNullException(nameof(response));
105 var data =
new byte[response.Length + 1];
106 data[0] = readerNumber;
107 Array.Copy(response, 0, data, 1, response.Length);
116 new(1, 2, [readerNumber]);
121 var sb =
new StringBuilder();
122 sb.AppendLine($
" Mode: {Mode}");
123 sb.AppendLine($
"PReply: {PReply}");
124 sb.AppendLine($
" PData: {BitConverter.ToString(PData)}");
125 return sb.ToString();
Contains standard Security Control Block data that can be used when building messages.
Base class representing a payload an OSDP message.
static ExtendedRead ModeZeroSettingReport(byte currentMode, bool enabled)
Builds a Mode-0 setting report reply (response to CommandData.ExtendedWrite.ReadModeSetting).
byte Mode
Gets the extended READ/WRITE mode.
static ExtendedRead ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
override string ToString()
override byte[] BuildData()
override ReadOnlySpan< byte > SecurityControlBlock()
byte PReply
Gets the mode-specific reply code.
ExtendedRead(byte mode, byte pReply, byte[] pData)
Initializes a new instance of the ExtendedRead class.
byte[] PData
Gets the reply data.
static ExtendedRead CardPresent(byte readerNumber)
Builds an unsolicited card-present notification on the specified reader.
static ExtendedRead SessionTerminated(byte readerNumber)
Builds a Mode-1 smart-card session-terminated reply.
static ExtendedRead ApduResponse(byte readerNumber, byte[] response)
Builds a Mode-1 APDU response reply.
ReplyType
Identifies the type of OSDP protocol reply (PD -> ACU) message.