OSDP.Net 5.3.0-beta.3
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
25 {
26 }
27 }
28
34 {
38 public Nak Reply { get; }
39
45 public NackReplyException(Nak replyData, string message = null) : base(message)
46 {
47 // Not a nested interpolated string: Doxygen can't parse those and drops every class in this file.
48 var suffix = string.IsNullOrEmpty(message) ? string.Empty : " " + message;
49 Message = $"Received NAK error '{Helpers.SplitCamelCase(replyData.ErrorCode.ToString())}'.{suffix}";
50 Reply = replyData;
51 }
52
54 public override string Message { get; }
55 }
56
61 {
67 public InvalidPayloadException(string message) : base(message) { }
68 }
69
75 {
80 {
81 }
82
88 public SecureChannelRequired(string message) : base(message)
89 {
90 }
91 }
92
99 {
103 public bool AcuUsedDefaultKey { get; }
104
108 public bool PdClaimedDefaultKey { get; }
109
115 public SecureChannelKeyTypeMismatchException(bool acuUsedDefaultKey, bool pdClaimedDefaultKey)
116 : base($"SCB key type mismatch: ACU used {(acuUsedDefaultKey ? "SCBK-D" : "SCBK")} " +
117 $"but PD responded with {(pdClaimedDefaultKey ? "SCBK-D" : "SCBK")}")
118 {
119 AcuUsedDefaultKey = acuUsedDefaultKey;
120 PdClaimedDefaultKey = pdClaimedDefaultKey;
121 }
122 }
123}
InvalidPayloadException(string message)
Initializes a new instance of OSDP.Net.InvalidPayloadException with a specified error message.
Definition Exceptions.cs:67
A negative reply.
Definition Nak.cs:14
override string Message
Definition Exceptions.cs:54
Nak Reply
Parsed osdp_NAK packet data.
Definition Exceptions.cs:38
NackReplyException(Nak replyData, string message=null)
Initializes a new instance of OSDP.Net.NackReplyException class.
Definition Exceptions.cs:45
OSDPNetException()
Initializes a new instance of OSDP.Net.OSDPNetException.
Definition Exceptions.cs:24
OSDPNetException(string message)
Initializes a new instance of OSDP.Net.OSDPNetException with a specified error message.
Definition Exceptions.cs:17
bool PdClaimedDefaultKey
Gets a value indicating whether the PD claimed to use the default key (SCBK-D).
SecureChannelKeyTypeMismatchException(bool acuUsedDefaultKey, bool pdClaimedDefaultKey)
Initializes a new instance of SecureChannelKeyTypeMismatchException.
bool AcuUsedDefaultKey
Gets a value indicating whether the ACU was using the default key (SCBK-D).
SecureChannelRequired()
Initializes a new instance of OSDP.Net.SecureChannelRequired.
Definition Exceptions.cs:79
SecureChannelRequired(string message)
Initializes a new instance of OSDP.Net.SecureChannelRequired with a specified error message.
Definition Exceptions.cs:88