5internal class ReplyTracker
7 private readonly OutgoingMessage _issuingCommand;
8 private readonly DeviceProxy _device;
10 public ReplyTracker(Guid connectionId, IncomingMessage replyMessage, OutgoingMessage issuingCommand,
13 ConnectionId = connectionId;
14 ReplyMessage = replyMessage;
15 _issuingCommand = issuingCommand;
19 public IncomingMessage ReplyMessage {
get; }
21 public Guid ConnectionId {
get; }
30 public bool IsValidReply => ReplyMessage.Address == _issuingCommand.Address && ReplyMessage.IsDataCorrect;
38 public bool MatchIssuingCommand(
byte address,
byte commandCode) =>
39 address.Equals(_issuingCommand.Address) && commandCode.Equals(_issuingCommand.Code);
44 public bool IsReplyToSecureChannelHandshake =>
45 _issuingCommand.Code is (
byte)CommandType.SessionChallenge or (
byte)
CommandType.ServerCryptogram;
47 internal bool ValidateSecureChannelEstablishment()
49 if (!ReplyMessage.SecureCryptogramHasBeenAccepted())
54 _device.MessageSecureChannel.Establish(ReplyMessage.Payload);
CommandType
Identifies the type of OSDP protocol command (ACU -> PD) message.