Skip to content

Commit b270749

Browse files
Patch Soft Reset
1 parent 25222d0 commit b270749

File tree

1 file changed

+100
-74
lines changed

1 file changed

+100
-74
lines changed

Visual Studio Projects/ZWaveJS.NET/ZWaveJS.NET/ZWaveOptions.cs

Lines changed: 100 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,120 @@ public class ZWaveOptions
77
{
88
public ZWaveOptions()
99
{
10+
this.timeouts = new CFGTimeouts();
11+
this.attempts = new CFGAttempts();
1012
this.logConfig = new CFGLogConfig();
1113
this.interview = new CFGInterview();
1214
this.storage = new CFGStorage();
1315
this.securityKeys = new CFGSecurityKeys();
1416
this.securityKeysLongRange = new CFGSecurityKeysLR();
15-
this.timeouts = new CFGTimeouts();
16-
this.enableSoftReset = true;
1717
this.disableOptimisticValueUpdate = false;
1818
this.emitValueUpdateAfterSetValue = false;
19+
this.features = new CFGFeatures();
20+
1921
}
2022

2123
public CFGTimeouts timeouts { get; set; }
24+
public CFGAttempts attempts { get; set; }
2225
public CFGLogConfig logConfig { get; set; }
26+
public CFGInterview interview { get; set; }
2327
public CFGStorage storage { get; set; }
2428
public CFGSecurityKeys securityKeys { get; set; }
2529
public CFGSecurityKeysLR securityKeysLongRange { get; set; }
26-
public CFGInterview interview { get; set; }
27-
public bool enableSoftReset { get; set; }
2830
public bool disableOptimisticValueUpdate { get; set; }
2931
public bool emitValueUpdateAfterSetValue { get; set; }
32+
public CFGFeatures features { get; set; }
33+
34+
35+
public class CFGTimeouts
36+
{
37+
public int? ack { get; set; }
38+
public int? @byte { get; set; }
39+
public int? response { get; set; }
40+
public int? sendDataAbort { get; set; }
41+
public int? sendDataCallback { get; set; }
42+
public int? report { get; set; }
43+
public int? nonce { get; set; }
44+
public int? retryJammed { get; set; }
45+
public int? sendToSleep { get; set; }
46+
public int? serialAPIStarted { get; set; }
47+
}
48+
49+
public class CFGAttempts
50+
{
51+
public int? controller { get; set; }
52+
public int? sendData { get; set; }
53+
public int? sendDataJammed { get; set; }
54+
public int? nodeInterview { get; set; }
55+
}
56+
57+
public class CFGLogConfig
58+
{
59+
public CFGLogConfig()
60+
{
61+
this.enabled = false;
62+
this.logToFile = false;
63+
this.level = Enums.LogLevel.Debug;
64+
this.filename = Path.Combine(Directory.GetCurrentDirectory(), "zwave-js.log");
65+
}
66+
67+
public bool logToFile { get; set; }
68+
public bool enabled { get; set; }
69+
public Enums.LogLevel level { get; set; }
70+
public int[] nodeFilter { get; set; }
71+
public string filename { get; set; }
72+
}
73+
74+
public class CFGInterview
75+
{
76+
public CFGInterview()
77+
{
78+
this.queryAllUserCodes = false;
79+
this.disableOnNodeAdded = false;
80+
}
81+
82+
public bool queryAllUserCodes { get; set; }
83+
public bool disableOnNodeAdded { get; set; }
84+
}
85+
86+
public class CFGStorage
87+
{
88+
public CFGStorage()
89+
{
90+
this.throttle = "normal";
91+
this.cacheDir = Path.Combine(Directory.GetCurrentDirectory(), "zwave-js-cache");
92+
}
93+
94+
public string cacheDir { get; set; }
95+
public string deviceConfigPriorityDir { get; set; }
96+
public string throttle { get; set; }
97+
}
98+
99+
public class CFGSecurityKeys
100+
{
101+
public string S2_Unauthenticated { get; set; }
102+
public string S2_Authenticated { get; set; }
103+
public string S2_AccessControl { get; set; }
104+
public string S0_Legacy { get; set; }
105+
}
106+
107+
public class CFGSecurityKeysLR
108+
{
109+
public string S2_Authenticated { get; set; }
110+
public string S2_AccessControl { get; set; }
111+
}
112+
113+
public class CFGFeatures
114+
{
115+
public CFGFeatures()
116+
{
117+
this.softReset = true;
118+
this.unresponsiveControllerRecovery = true;
119+
}
120+
121+
public bool softReset { get; set; }
122+
public bool unresponsiveControllerRecovery { get; set; }
123+
}
30124

31125
internal bool MissingLRKeys()
32126
{
@@ -38,9 +132,7 @@ internal bool MissingLRKeys()
38132

39133
if (this.securityKeysLongRange.S2_Authenticated == null)
40134
return true;
41-
42-
43-
135+
44136
return false;
45137
}
46138

@@ -95,71 +187,5 @@ internal bool CheckKeyLength()
95187

96188
}
97189
}
98-
99-
public class CFGInterview
100-
{
101-
public CFGInterview()
102-
{
103-
this.queryAllUserCodes = false;
104-
this.disableOnNodeAdded = false;
105-
}
106-
107-
public bool queryAllUserCodes { get; set; }
108-
public bool disableOnNodeAdded { get; set; }
109-
}
110-
111-
public class CFGTimeouts
112-
{
113-
public int? ack { get; set; }
114-
public int? response { get; set; }
115-
public int? sendDataCallback { get; set; }
116-
public int? report { get; set; }
117-
public int? nonce { get; set; }
118-
public int? serialAPIStarted { get; set; }
119-
}
120-
121-
public class CFGLogConfig
122-
{
123-
public CFGLogConfig()
124-
{
125-
this.enabled = false;
126-
this.logToFile = false;
127-
this.level = Enums.LogLevel.Debug;
128-
this.filename = Path.Combine(Directory.GetCurrentDirectory(), "zwave-js.log");
129-
}
130-
131-
public bool logToFile { get; set; }
132-
public bool enabled { get; set; }
133-
public Enums.LogLevel level { get; set; }
134-
public int[] nodeFilter { get; set; }
135-
public string filename { get; set; }
136-
}
137-
138-
public class CFGStorage
139-
{
140-
141-
public CFGStorage()
142-
{
143-
this.throttle = "normal";
144-
this.cacheDir = Path.Combine(Directory.GetCurrentDirectory(), "zwave-js-cache");
145-
}
146-
147-
public string cacheDir { get; set; }
148-
public string deviceConfigPriorityDir { get; set; }
149-
public string throttle { get; set; }
150-
}
151-
152-
public class CFGSecurityKeys
153-
{
154-
public string S2_Unauthenticated { get; set; }
155-
public string S2_Authenticated { get; set; }
156-
public string S2_AccessControl { get; set; }
157-
public string S0_Legacy { get; set; }
158-
}
159-
160-
public class CFGSecurityKeysLR
161-
{
162-
public string S2_Authenticated { get; set; }
163-
public string S2_AccessControl { get; set; }
164-
}
190+
165191
}

0 commit comments

Comments
 (0)