15 private readonly
byte[] _rawPayloadData;
16 private readonly
byte[] _rawData;
17 private readonly
bool _isUsingDefaultKey;
39 _rawPayloadData = message.
Payload;
111 case Messages.CommandType.DeviceCapabilities:
113 case Messages.CommandType.LocalStatus:
115 case Messages.CommandType.InputStatus:
117 case Messages.CommandType.OutputStatus:
119 case Messages.CommandType.ReaderStatus:
121 case Messages.CommandType.OutputControl:
123 case Messages.CommandType.LEDControl:
125 case Messages.CommandType.BuzzerControl:
127 case Messages.CommandType.TextOutput:
129 case Messages.CommandType.CommunicationSet:
137 case Messages.CommandType.SessionChallenge:
138 return _rawPayloadData;
139 case Messages.CommandType.ServerCryptogram:
140 return _rawPayloadData;
141 case Messages.CommandType.MaxReplySize:
143 case Messages.CommandType.FileTransfer:
145 case Messages.CommandType.ManufacturerSpecific:
147 case Messages.CommandType.ExtendedWrite:
153 case Messages.CommandType.GenerateChallenge:
155 case Messages.CommandType.AuthenticateChallenge:
157 case Messages.CommandType.KeepActive:
169 case Messages.ReplyType.PdCapabilitiesReport:
171 case Messages.ReplyType.LocalStatusReport:
173 case Messages.ReplyType.InputStatusReport:
175 case Messages.ReplyType.OutputStatusReport:
177 case Messages.ReplyType.ReaderStatusReport:
179 case Messages.ReplyType.RawReaderData:
181 case Messages.ReplyType.FormattedReaderData:
185 case Messages.ReplyType.PdCommunicationsConfigurationReport:
187 case Messages.ReplyType.BiometricData:
189 case Messages.ReplyType.BiometricMatchResult:
191 case Messages.ReplyType.CrypticData:
192 return _rawPayloadData;
193 case Messages.ReplyType.InitialRMac:
194 return _rawPayloadData;
197 case Messages.ReplyType.FileTransferStatus:
201 case Messages.ReplyType.ResponseToChallenge:
202 return ChallengeResponse.ParseData(
RawPayloadData, _isUsingDefaultKey);
203 case Messages.ReplyType.ManufactureSpecific:
205 case Messages.ReplyType.ExtendedRead:
220 public ReadOnlySpan<byte>
RawData => _rawData;
byte Type
Command/reply code of the message.
byte Sequence
Message sequence number.
ReadOnlySpan< byte > OriginalMessageData
Original byte data which includes the header, security control block, payload, MAC and CRC/Checksum s...
bool IsUsingCrc
If true, the message has a CRC suffix; otherwise it has a checksum.
bool IsUsingDefaultKey
Gets whether the incoming message is using the default key.
byte[] Payload
Returns the raw message payload.
MessageType MessageType
Type of message.
byte Address
Address assigned to the device.
Command data to send a request to the PD to perform a biometric scan and match.
static BiometricReadData ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
Command data to send a request to the PD to perform a biometric scan and return data.
static BiometricTemplateData ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
Command data to set the communication configuration on a PD.
static CommunicationConfiguration ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
Represents the capabilities of a device within the context of OSDP (Open Supervised Device Protocol).
Command data to set the encryption key configuration on a PD.
static EncryptionKeyConfiguration ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
Extended write (transparent mode) command data sent to a PD.
static ExtendedWrite ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
Command data to send a data fragment of a file to a PD.
static FileTransferFragment ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
Command data to get the PIV data.
static GetPIVData ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
Manufacture specific command data sent to a PD.
static ManufacturerSpecific ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
Represents a fragment of data for a multipart message.
static MessageDataFragment ParseData(ReadOnlySpan< byte > data, MessageDataFragmentFieldSize sizeAndOffsetFieldSize)
Parses the message payload bytes.
Command data to control the outputs of a PD.
static OutputControls ParseData(ReadOnlySpan< byte > payloadData)
Parses the message payload bytes.
Command data to control the buzzer on a PD.
static ReaderBuzzerControl ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
Command data to control the color of LEDs.
static ReaderLedControls ParseData(ReadOnlySpan< byte > payloadData)
Parses the message payload bytes.
Command data for sending text to be shown on a PD.
static ReaderTextOutput ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
CommandType? CommandType
The type of command sent or null it is a reply.
Packet(IncomingMessage message)
Initializes a new instance of the Packet class from an incoming message.
ReadOnlySpan< byte > RawData
Raw bytes of the entire message data.
bool IsPayloadDecrypted
Indicates whether the payload was successfully decrypted.
ReplyType? ReplyType
The type of reply sent or null it is a command.
bool IsSecureMessage
Indicates if the message was sent via an established secure channel.
byte Address
Address of the message.
ReadOnlySpan< byte > RawPayloadData
Raw bytes of the payload data.
bool IsUsingCrc
Is CRC being used.
object ParsePayloadData()
Parse the payload data into an object.
byte Sequence
Sequence number of the message.
IncomingMessage IncomingMessage
The underlying incoming message.
bool IsUsingDefaultKey
Indicates if the secure channel is using the default key.
A biometric match reply after a scan.
The actual communication configuration of the PD sent as a reply.
A multi-part message data fragment reply.
static DataFragmentResponse ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
The PD device capabilities data sent as a reply.
The PD identification data sent as a reply.
static DeviceIdentification ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
An extended read (transparent mode) reply.
static ExtendedRead ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
The PD file transfer status sent as a reply.
static KeypadData ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
A local status report reply.
A manufacturer specific reply.
static ManufacturerSpecific ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
A output status report reply.
static OutputStatus ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
static RawCardData ParseData(ReadOnlySpan< byte > data)
Parses the data.
A reader status report reply.
Represents a parsed OSDP packet with decoded message information.
ReadOnlyMemory< byte > RawData
Raw bytes of the entire message data.
ReadOnlyMemory< byte > RawPayloadData
Raw bytes of the payload data.
MessageType
The type of message.
MessageDataFragmentFieldSize
Defines the field size used for the MessageDataFragment.TotalSize and MessageDataFragment....