2using System.Collections.Generic;
42 public IEnumerable<byte>
ExtraData {
get;
private set; }
59 internal static Nak ParseData(ReadOnlySpan<byte> data)
61 var dataArray = data.ToArray();
62 if (dataArray.Length < 1)
64 throw new Exception(
"Invalid size for the data");
70 ExtraData = dataArray.Skip(1).Take(dataArray.Length - 1)
79 var buffer =
new byte[1];
87 var build =
new StringBuilder();
88 build.AppendLine($
"Error: {Helpers.SplitCamelCase(ErrorCode.ToString())}");
90 build.AppendLine($
" Data: {(extraDataArray.Length > 0 ? BitConverter.ToString(extraDataArray) : "(none)
")}");
91 return build.ToString();
Contains standard Security Control Block data that can be used when building messages.
Base class representing a payload an OSDP message.
override string ToString()
override ReadOnlySpan< byte > SecurityControlBlock()
override byte[] BuildData()
Nak(ErrorCode errorCode)
Creates a new instance of Nak class.
ErrorCode ErrorCode
Gets the error code.
IEnumerable< byte > ExtraData
Gets the extra data.
ReplyType
Identifies the type of OSDP protocol reply (PD -> ACU) message.
@ BioFormatNotSupported
The Bio format is not supported.
@ UnknownCommandCode
Unknown command code.
@ BioTypeNotSupported
The Bio type is not supported.
@ InvalidCommandLength
Command length error.
@ UnexpectedSequenceNumber
Unexpected sequence number detected in the header.
@ DoesNotSupportSecurityBlock
This PD does not support the security block that was received.
@ GenericError
The generic error.
@ BadChecksumOrCrc
Message check character(s) error (bad checksum/crc).
@ UnableToProcessCommand
Unable to process command record.
@ CommunicationSecurityNotMet
Encrypted communication is required to process this command.