OSDP.Net 5.2.1
A .NET library for implementing the Open Supervised Device Protocol (OSDP)
Loading...
Searching...
No Matches
Exceptions.cs
3using System;
4
5namespace OSDP.Net
6{
10 public class OSDPNetException : Exception
11 {
17 public OSDPNetException(string message) : base(message)
18 {
19 }
20
24 public OSDPNetException()
25 {
26 }
27 }
28
33 public sealed class NackReplyException : OSDPNetException
34 {
38 public Nak Reply { get; }
39
45 public NackReplyException(Nak replyData, string message = null) : base(message)
46 {
47 Message =
48 $"Received NAK error '{Helpers.SplitCamelCase(replyData.ErrorCode.ToString())}'.{(string.IsNullOrEmpty(message) ? string.Empty : $" {message}")}";
49 Reply = replyData;
50 }
51
53 public override string Message { get; }
54 }
55
59 public class InvalidPayloadException : OSDPNetException
60 {
66 public InvalidPayloadException(string message) : base(message) { }
67 }
68
73 public class SecureChannelRequired : OSDPNetException
74 {
78 public SecureChannelRequired()
79 {
80 }
81
87 public SecureChannelRequired(string message) : base(message)
88 {
89 }
90 }
91
97 public class SecureChannelKeyTypeMismatchException : OSDPNetException
98 {
102 public bool AcuUsedDefaultKey { get; }
103
107 public bool PdClaimedDefaultKey { get; }
108
114 public SecureChannelKeyTypeMismatchException(bool acuUsedDefaultKey, bool pdClaimedDefaultKey)
115 : base($"SCB key type mismatch: ACU used {(acuUsedDefaultKey ? "SCBK-D" : "SCBK")} " +
116 $"but PD responded with {(pdClaimedDefaultKey ? "SCBK-D" : "SCBK")}")
117 {
118 AcuUsedDefaultKey = acuUsedDefaultKey;
119 PdClaimedDefaultKey = pdClaimedDefaultKey;
120 }
121 }
122}
@ Nak
osdp_NAK - acknowledge; error response
Definition ReplyType.cs:16