zwave-js 8.7.7 → 8.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/build/CommandClass.js +1 -0
  2. package/build/CommandClass.js.map +1 -1
  3. package/build/Controller.d.ts +1 -0
  4. package/build/Controller.d.ts.map +1 -1
  5. package/build/Controller.js +4 -1
  6. package/build/Controller.js.map +1 -1
  7. package/build/Node.d.ts +1 -1
  8. package/build/Node.d.ts.map +1 -1
  9. package/build/Node.js.map +1 -1
  10. package/build/Utils.d.ts +1 -0
  11. package/build/Utils.d.ts.map +1 -1
  12. package/build/Utils.js +7 -1
  13. package/build/Utils.js.map +1 -1
  14. package/build/lib/commandclass/API.d.ts +15 -3
  15. package/build/lib/commandclass/API.d.ts.map +1 -1
  16. package/build/lib/commandclass/API.js +50 -0
  17. package/build/lib/commandclass/API.js.map +1 -1
  18. package/build/lib/commandclass/CommandClass.d.ts +0 -6
  19. package/build/lib/commandclass/CommandClass.d.ts.map +1 -1
  20. package/build/lib/commandclass/CommandClass.js +0 -12
  21. package/build/lib/commandclass/CommandClass.js.map +1 -1
  22. package/build/lib/commandclass/Security2CC.d.ts +1 -10
  23. package/build/lib/commandclass/Security2CC.d.ts.map +1 -1
  24. package/build/lib/commandclass/Security2CC.js +16 -48
  25. package/build/lib/commandclass/Security2CC.js.map +1 -1
  26. package/build/lib/commandclass/SecurityCC.d.ts +2 -9
  27. package/build/lib/commandclass/SecurityCC.d.ts.map +1 -1
  28. package/build/lib/commandclass/SecurityCC.js +9 -53
  29. package/build/lib/commandclass/SecurityCC.js.map +1 -1
  30. package/build/lib/commandclass/WakeUpCC.d.ts.map +1 -1
  31. package/build/lib/commandclass/WakeUpCC.js +1 -0
  32. package/build/lib/commandclass/WakeUpCC.js.map +1 -1
  33. package/build/lib/controller/BridgeApplicationCommandRequest.d.ts +2 -6
  34. package/build/lib/controller/BridgeApplicationCommandRequest.d.ts.map +1 -1
  35. package/build/lib/controller/BridgeApplicationCommandRequest.js +9 -19
  36. package/build/lib/controller/BridgeApplicationCommandRequest.js.map +1 -1
  37. package/build/lib/controller/Controller.d.ts +12 -2
  38. package/build/lib/controller/Controller.d.ts.map +1 -1
  39. package/build/lib/controller/Controller.js +14 -6
  40. package/build/lib/controller/Controller.js.map +1 -1
  41. package/build/lib/controller/Inclusion.d.ts +1 -1
  42. package/build/lib/controller/SendDataBridgeMessages.d.ts +5 -3
  43. package/build/lib/controller/SendDataBridgeMessages.d.ts.map +1 -1
  44. package/build/lib/controller/SendDataBridgeMessages.js +21 -8
  45. package/build/lib/controller/SendDataBridgeMessages.js.map +1 -1
  46. package/build/lib/controller/SendDataMessages.d.ts +5 -3
  47. package/build/lib/controller/SendDataMessages.d.ts.map +1 -1
  48. package/build/lib/controller/SendDataMessages.js +21 -9
  49. package/build/lib/controller/SendDataMessages.js.map +1 -1
  50. package/build/lib/controller/SendDataShared.d.ts +72 -2
  51. package/build/lib/controller/SendDataShared.d.ts.map +1 -1
  52. package/build/lib/controller/SendDataShared.js +195 -1
  53. package/build/lib/controller/SendDataShared.js.map +1 -1
  54. package/build/lib/driver/CommandQueueMachine.d.ts +7 -3
  55. package/build/lib/driver/CommandQueueMachine.d.ts.map +1 -1
  56. package/build/lib/driver/CommandQueueMachine.js +66 -29
  57. package/build/lib/driver/CommandQueueMachine.js.map +1 -1
  58. package/build/lib/driver/Driver.d.ts +16 -12
  59. package/build/lib/driver/Driver.d.ts.map +1 -1
  60. package/build/lib/driver/Driver.js +178 -163
  61. package/build/lib/driver/Driver.js.map +1 -1
  62. package/build/lib/driver/MessageGenerators.d.ts +26 -0
  63. package/build/lib/driver/MessageGenerators.d.ts.map +1 -0
  64. package/build/lib/driver/MessageGenerators.js +242 -0
  65. package/build/lib/driver/MessageGenerators.js.map +1 -0
  66. package/build/lib/driver/SendThreadMachine.d.ts +24 -53
  67. package/build/lib/driver/SendThreadMachine.d.ts.map +1 -1
  68. package/build/lib/driver/SendThreadMachine.js +160 -618
  69. package/build/lib/driver/SendThreadMachine.js.map +1 -1
  70. package/build/lib/driver/StateMachineShared.d.ts +2 -0
  71. package/build/lib/driver/StateMachineShared.d.ts.map +1 -1
  72. package/build/lib/driver/StateMachineShared.js +21 -10
  73. package/build/lib/driver/StateMachineShared.js.map +1 -1
  74. package/build/lib/driver/Transaction.d.ts +35 -3
  75. package/build/lib/driver/Transaction.d.ts.map +1 -1
  76. package/build/lib/driver/Transaction.js +20 -15
  77. package/build/lib/driver/Transaction.js.map +1 -1
  78. package/build/lib/driver/TransactionMachine.d.ts +30 -0
  79. package/build/lib/driver/TransactionMachine.d.ts.map +1 -0
  80. package/build/lib/driver/TransactionMachine.js +247 -0
  81. package/build/lib/driver/TransactionMachine.js.map +1 -0
  82. package/build/lib/driver/ZWaveOptions.d.ts +0 -2
  83. package/build/lib/driver/ZWaveOptions.d.ts.map +1 -1
  84. package/build/lib/message/Constants.d.ts +8 -9
  85. package/build/lib/message/Constants.d.ts.map +1 -1
  86. package/build/lib/message/Constants.js +9 -12
  87. package/build/lib/message/Constants.js.map +1 -1
  88. package/build/lib/message/Message.d.ts +5 -1
  89. package/build/lib/message/Message.d.ts.map +1 -1
  90. package/build/lib/message/Message.js +11 -0
  91. package/build/lib/message/Message.js.map +1 -1
  92. package/build/lib/node/HealthCheck.d.ts +8 -0
  93. package/build/lib/node/HealthCheck.d.ts.map +1 -0
  94. package/build/lib/node/HealthCheck.js +83 -0
  95. package/build/lib/node/HealthCheck.js.map +1 -0
  96. package/build/lib/node/Node.d.ts +11 -3
  97. package/build/lib/node/Node.d.ts.map +1 -1
  98. package/build/lib/node/Node.js +305 -21
  99. package/build/lib/node/Node.js.map +1 -1
  100. package/build/lib/node/Types.d.ts +133 -2
  101. package/build/lib/node/Types.d.ts.map +1 -1
  102. package/build/lib/node/Types.js.map +1 -1
  103. package/build/lib/serialapi/misc/GetBackgroundRSSIMessages.d.ts +14 -0
  104. package/build/lib/serialapi/misc/GetBackgroundRSSIMessages.d.ts.map +1 -0
  105. package/build/lib/serialapi/misc/GetBackgroundRSSIMessages.js +46 -0
  106. package/build/lib/serialapi/misc/GetBackgroundRSSIMessages.js.map +1 -0
  107. package/package.json +14 -14
@@ -0,0 +1,242 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createMessageGenerator = exports.secureMessageGeneratorS2 = exports.secureMessageGeneratorS0 = exports.simpleMessageGenerator = exports.waitForNodeUpdate = void 0;
4
+ const core_1 = require("@zwave-js/core");
5
+ const deferred_promise_1 = require("alcalzone-shared/deferred-promise");
6
+ const commandclass_1 = require("../commandclass");
7
+ const ICommandClassContainer_1 = require("../commandclass/ICommandClassContainer");
8
+ const SecurityCC_1 = require("../commandclass/SecurityCC");
9
+ const SendDataShared_1 = require("../controller/SendDataShared");
10
+ const StateMachineShared_1 = require("./StateMachineShared");
11
+ async function waitForNodeUpdate(driver, msg) {
12
+ try {
13
+ return await driver.waitForMessage((received) => {
14
+ return msg.isExpectedNodeUpdate(received);
15
+ }, driver.options.timeouts.report);
16
+ }
17
+ catch (e) {
18
+ throw new core_1.ZWaveError(`Timed out while waiting for a response from the node`, core_1.ZWaveErrorCodes.Controller_NodeTimeout);
19
+ }
20
+ }
21
+ exports.waitForNodeUpdate = waitForNodeUpdate;
22
+ /** A simple message generator that simply sends a message, waits for the ACK (and the response if one is expected) */
23
+ const simpleMessageGenerator = async function* (driver, msg, onMessageSent) {
24
+ // Pass this message to the send thread and wait for it to be sent
25
+ let result;
26
+ try {
27
+ // The yield can throw and must be handled here
28
+ result = yield msg;
29
+ onMessageSent(msg, result);
30
+ }
31
+ catch (e) {
32
+ throw e;
33
+ }
34
+ // If the sent message was a SendData message that had a NOK callback,
35
+ // we now need to throw because the callback was passed through so we could inspect it.
36
+ if ((0, SendDataShared_1.isSendData)(msg) &&
37
+ (0, SendDataShared_1.isSendDataTransmitReport)(result) &&
38
+ !result.isOK()) {
39
+ // Throw the message in order to short-circuit all possible generators
40
+ throw result;
41
+ }
42
+ // If the sent message expects an update from the node, wait for it
43
+ if (msg.expectsNodeUpdate()) {
44
+ return waitForNodeUpdate(driver, msg);
45
+ }
46
+ return result;
47
+ };
48
+ exports.simpleMessageGenerator = simpleMessageGenerator;
49
+ /** A simple (internal) generator that simply sends a command, and optionally returns the response command */
50
+ async function* sendCommandGenerator(driver, command, onMessageSent, options) {
51
+ const msg = driver.createSendDataMessage(command, options);
52
+ const resp = yield* (0, exports.simpleMessageGenerator)(driver, msg, onMessageSent);
53
+ if (resp && (0, ICommandClassContainer_1.isCommandClassContainer)(resp)) {
54
+ driver.unwrapCommands(resp);
55
+ return resp.command;
56
+ }
57
+ }
58
+ /** A message generator for security encapsulated messages (S0) */
59
+ const secureMessageGeneratorS0 = async function* (driver, msg, onMessageSent) {
60
+ if (!(0, SendDataShared_1.isSendData)(msg)) {
61
+ throw new core_1.ZWaveError("Cannot use the S0 message generator for a command that's not a SendData message!", core_1.ZWaveErrorCodes.Argument_Invalid);
62
+ }
63
+ else if (typeof msg.command.nodeId !== "number") {
64
+ throw new core_1.ZWaveError("Cannot use the S0 message generator for multicast commands!", core_1.ZWaveErrorCodes.Argument_Invalid);
65
+ }
66
+ else if (!(msg.command instanceof SecurityCC_1.SecurityCCCommandEncapsulation)) {
67
+ throw new core_1.ZWaveError("The S0 message generator can only be used for Security S0 command encapsulation!", core_1.ZWaveErrorCodes.Argument_Invalid);
68
+ }
69
+ // Step 1: Acquire a nonce
70
+ const secMan = driver.securityManager;
71
+ const nodeId = msg.command.nodeId;
72
+ let nonceId;
73
+ // Try to get a free nonce before requesting a new one
74
+ const freeNonce = secMan.getFreeNonce(nodeId);
75
+ if (freeNonce) {
76
+ nonceId = secMan.getNonceId(freeNonce);
77
+ }
78
+ else {
79
+ // No free nonce, request a new one
80
+ const cc = new SecurityCC_1.SecurityCCNonceGet(driver, {
81
+ nodeId: nodeId,
82
+ endpoint: msg.command.endpointIndex,
83
+ });
84
+ const nonceResp = yield* sendCommandGenerator(driver, cc, onMessageSent, {
85
+ // Only try getting a nonce once
86
+ maxSendAttempts: 1,
87
+ });
88
+ if (!nonceResp) {
89
+ throw new core_1.ZWaveError("No nonce received from the node, cannot send secure command!", core_1.ZWaveErrorCodes.SecurityCC_NoNonce);
90
+ }
91
+ const nonce = nonceResp.nonce;
92
+ // and store it
93
+ nonceId = secMan.getNonceId(nonce);
94
+ secMan.setNonce({
95
+ issuer: nodeId,
96
+ nonceId: nonceId,
97
+ }, { nonce, receiver: driver.controller.ownNodeId },
98
+ // The nonce is reserved for this command
99
+ { free: false });
100
+ }
101
+ // Now send the actual secure command
102
+ msg.command.nonceId = nonceId;
103
+ return yield* (0, exports.simpleMessageGenerator)(driver, msg, onMessageSent);
104
+ };
105
+ exports.secureMessageGeneratorS0 = secureMessageGeneratorS0;
106
+ /** A message generator for security encapsulated messages (S2) */
107
+ const secureMessageGeneratorS2 = async function* (driver, msg, onMessageSent) {
108
+ if (!(0, SendDataShared_1.isSendData)(msg)) {
109
+ throw new core_1.ZWaveError("Cannot use the S2 message generator for a command that's not a SendData message!", core_1.ZWaveErrorCodes.Argument_Invalid);
110
+ }
111
+ else if (typeof msg.command.nodeId !== "number") {
112
+ throw new core_1.ZWaveError("Cannot use the S2 message generator for multicast commands!", // (yet)
113
+ core_1.ZWaveErrorCodes.Argument_Invalid);
114
+ }
115
+ else if (!(msg.command instanceof commandclass_1.Security2CCMessageEncapsulation)) {
116
+ throw new core_1.ZWaveError("The S2 message generator can only be used for Security S2 command encapsulation!", core_1.ZWaveErrorCodes.Argument_Invalid);
117
+ }
118
+ const secMan = driver.securityManager2;
119
+ const nodeId = msg.command.nodeId;
120
+ const spanState = secMan.getSPANState(nodeId);
121
+ if (spanState.type === core_1.SPANState.None ||
122
+ spanState.type === core_1.SPANState.LocalEI) {
123
+ // Request a new nonce
124
+ // No free nonce, request a new one
125
+ const cc = new commandclass_1.Security2CCNonceGet(driver, {
126
+ nodeId: nodeId,
127
+ endpoint: msg.command.endpointIndex,
128
+ });
129
+ const nonceResp = yield* sendCommandGenerator(driver, cc, onMessageSent, {
130
+ // Only try getting a nonce once
131
+ maxSendAttempts: 1,
132
+ });
133
+ if (!nonceResp) {
134
+ throw new core_1.ZWaveError("No nonce received from the node, cannot send secure command!", core_1.ZWaveErrorCodes.Security2CC_NoSPAN);
135
+ }
136
+ // Storing the nonce is not necessary, this will be done automatically when the nonce is received
137
+ }
138
+ // Now send the actual secure command
139
+ let response = yield* (0, exports.simpleMessageGenerator)(driver, msg, onMessageSent);
140
+ if ((0, ICommandClassContainer_1.isCommandClassContainer)(response) &&
141
+ response.command instanceof commandclass_1.Security2CCNonceReport) {
142
+ const command = response.command;
143
+ if (command.SOS && command.receiverEI) {
144
+ // The node couldn't decrypt the last command we sent it. Invalidate
145
+ // the shared SPAN, since it did the same
146
+ secMan.storeRemoteEI(nodeId, command.receiverEI);
147
+ }
148
+ driver.controllerLog.logNode(nodeId, {
149
+ message: `failed to decode the message, retrying with SPAN extension...`,
150
+ direction: "none",
151
+ });
152
+ // Prepare the messsage for re-transmission
153
+ msg.callbackId = undefined;
154
+ msg.command.unsetSequenceNumber();
155
+ // Send the message again
156
+ response = yield* (0, exports.simpleMessageGenerator)(driver, msg, onMessageSent);
157
+ if ((0, ICommandClassContainer_1.isCommandClassContainer)(response) &&
158
+ response.command instanceof commandclass_1.Security2CCNonceReport) {
159
+ // No dice
160
+ driver.controllerLog.logNode(nodeId, {
161
+ message: `failed to decode the message after re-transmission with SPAN extension, dropping the message.`,
162
+ direction: "none",
163
+ level: "warn",
164
+ });
165
+ throw new core_1.ZWaveError("The node failed to decode the message.", core_1.ZWaveErrorCodes.Security2CC_CannotDecode);
166
+ }
167
+ }
168
+ return response;
169
+ };
170
+ exports.secureMessageGeneratorS2 = secureMessageGeneratorS2;
171
+ function createMessageGenerator(driver, msg, onMessageSent) {
172
+ const resultPromise = (0, deferred_promise_1.createDeferredPromise)();
173
+ const generator = {
174
+ parent: undefined,
175
+ current: undefined,
176
+ self: undefined,
177
+ start: () => {
178
+ async function* gen() {
179
+ // Determine which message generator implemenation should be used
180
+ let implementation = exports.simpleMessageGenerator;
181
+ if ((0, SendDataShared_1.isSendData)(msg)) {
182
+ if (msg.command instanceof commandclass_1.Security2CCMessageEncapsulation) {
183
+ implementation = exports.secureMessageGeneratorS2;
184
+ }
185
+ else if (msg.command instanceof SecurityCC_1.SecurityCCCommandEncapsulation) {
186
+ implementation = exports.secureMessageGeneratorS0;
187
+ }
188
+ }
189
+ // Step through the generator so we can easily cancel it and don't
190
+ // accidentally forget to unset this.current at the end
191
+ const gen = implementation(driver, msg, onMessageSent);
192
+ let sendResult;
193
+ let result;
194
+ while (true) {
195
+ // This call passes the previous send result (if it exists already) to the generator and saves the
196
+ // generated or returned message in `value`. When `done` is true, `value` contains the returned result of the message generator
197
+ try {
198
+ const { value, done } = await gen.next(sendResult);
199
+ if (done) {
200
+ result = value;
201
+ break;
202
+ }
203
+ // Pass the generated message to the transaction machine and remember the result for the next iteration
204
+ generator.current = value;
205
+ sendResult = yield generator.current;
206
+ }
207
+ catch (e) {
208
+ if (e instanceof Error) {
209
+ // There was an actual error, reject the transaction
210
+ resultPromise.reject(e);
211
+ }
212
+ else if ((0, SendDataShared_1.isSendDataTransmitReport)(e) && !e.isOK()) {
213
+ // The generator was prematurely ended by throwing a NOK transmit report.
214
+ // If this cannot be handled (e.g. by moving the messages to the wakeup queue), we need
215
+ // to treat this as an error
216
+ if (driver.handleMissingNodeACK(generator.parent)) {
217
+ return;
218
+ }
219
+ else {
220
+ resultPromise.reject((0, StateMachineShared_1.sendDataErrorToZWaveError)("callback NOK", generator.parent, e));
221
+ }
222
+ }
223
+ else {
224
+ // The generator was prematurely ended by throwing a Message
225
+ resultPromise.resolve(e);
226
+ }
227
+ break;
228
+ }
229
+ }
230
+ resultPromise.resolve(result);
231
+ generator.current = undefined;
232
+ generator.self = undefined;
233
+ return;
234
+ }
235
+ generator.self = gen();
236
+ return generator.self;
237
+ },
238
+ };
239
+ return { resultPromise, generator };
240
+ }
241
+ exports.createMessageGenerator = createMessageGenerator;
242
+ //# sourceMappingURL=MessageGenerators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageGenerators.js","sourceRoot":"","sources":["../../../src/lib/driver/MessageGenerators.ts"],"names":[],"mappings":";;;AAAA,yCAAwE;AACxE,wEAG2C;AAC3C,kDAKyB;AACzB,mFAAiF;AACjF,2DAIoC;AACpC,iEAGsC;AAGtC,6DAAiE;AAe1D,KAAK,UAAU,iBAAiB,CACtC,MAAc,EACd,GAAY;IAEZ,IAAI;QACH,OAAO,MAAM,MAAM,CAAC,cAAc,CAAI,CAAC,QAAQ,EAAE,EAAE;YAClD,OAAO,GAAG,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QAC3C,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;KACnC;IAAC,OAAO,CAAC,EAAE;QACX,MAAM,IAAI,iBAAU,CACnB,sDAAsD,EACtD,sBAAe,CAAC,sBAAsB,CACtC,CAAC;KACF;AACF,CAAC;AAdD,8CAcC;AAED,sHAAsH;AAC/G,MAAM,sBAAsB,GAClC,KAAK,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa;IAC1C,kEAAkE;IAClE,IAAI,MAAe,CAAC;IACpB,IAAI;QACH,+CAA+C;QAC/C,MAAM,GAAG,MAAM,GAAG,CAAC;QACnB,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;KAC3B;IAAC,OAAO,CAAC,EAAE;QACX,MAAM,CAAC,CAAC;KACR;IAED,sEAAsE;IACtE,uFAAuF;IACvF,IACC,IAAA,2BAAU,EAAC,GAAG,CAAC;QACf,IAAA,yCAAwB,EAAC,MAAM,CAAC;QAChC,CAAC,MAAM,CAAC,IAAI,EAAE,EACb;QACD,sEAAsE;QACtE,MAAM,MAAM,CAAC;KACb;IAED,mEAAmE;IACnE,IAAI,GAAG,CAAC,iBAAiB,EAAE,EAAE;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,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE;4BACpD,yEAAyE;4BACzE,uFAAuF;4BACvF,4BAA4B;4BAC5B,IACC,MAAM,CAAC,oBAAoB,CAC1B,SAAS,CAAC,MAAa,CACvB,EACA;gCACD,OAAO;6BACP;iCAAM;gCACN,aAAa,CAAC,MAAM,CACnB,IAAA,8CAAyB,EACxB,cAAc,EACd,SAAS,CAAC,MAAM,EAChB,CAAC,CACD,CACD,CAAC;6BACF;yBACD;6BAAM;4BACN,4DAA4D;4BAC5D,aAAa,CAAC,OAAO,CAAC,CAAc,CAAC,CAAC;yBACtC;wBACD,MAAM;qBACN;iBACD;gBAED,aAAa,CAAC,OAAO,CAAC,MAAmB,CAAC,CAAC;gBAC3C,SAAS,CAAC,OAAO,GAAG,SAAS,CAAC;gBAC9B,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC;gBAC3B,OAAO;YACR,CAAC;YACD,SAAS,CAAC,IAAI,GAAG,GAAG,EAAE,CAAC;YACvB,OAAO,SAAS,CAAC,IAAI,CAAC;QACvB,CAAC;KACD,CAAC;IACF,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC;AACrC,CAAC;AA1FD,wDA0FC"}
@@ -1,36 +1,14 @@
1
1
  import { ZWaveErrorCodes } from "@zwave-js/core";
2
2
  import { SortedList } from "alcalzone-shared/sorted-list";
3
- import { Interpreter, StateMachine } from "xstate";
4
- import { ApplicationCommandRequest } from "../controller/ApplicationCommandRequest";
5
- import { BridgeApplicationCommandRequest } from "../controller/BridgeApplicationCommandRequest";
3
+ import { ActorRef, ActorRefFrom, Interpreter, StateMachine } from "xstate";
6
4
  import { MessagePriority } from "../message/Constants";
7
5
  import type { Message } from "../message/Message";
8
- import { CommandQueueEvent, CommandQueueInterpreter } from "./CommandQueueMachine";
6
+ import { CommandQueueEvent } from "./CommandQueueMachine";
9
7
  import type { SerialAPICommandDoneData, SerialAPICommandMachineParams } from "./SerialAPICommandMachine";
10
- import { ServiceImplementations } from "./StateMachineShared";
8
+ import type { ServiceImplementations } from "./StateMachineShared";
11
9
  import type { Transaction } from "./Transaction";
10
+ import { TransactionMachine } from "./TransactionMachine";
12
11
  import type { ZWaveOptions } from "./ZWaveOptions";
13
- export interface SendThreadStateSchema {
14
- states: {
15
- init: {};
16
- idle: {};
17
- sending: {
18
- states: {
19
- beforeSend: {};
20
- handshake: {
21
- states: {
22
- waitForCommandResult: {};
23
- waitForHandshakeResponse: {};
24
- };
25
- };
26
- execute: {};
27
- waitForUpdate: {};
28
- retryWait: {};
29
- done: {};
30
- };
31
- };
32
- };
33
- }
34
12
  export declare type SendDataErrorData = (SerialAPICommandDoneData & {
35
13
  type: "failure";
36
14
  }) | {
@@ -38,12 +16,15 @@ export declare type SendDataErrorData = (SerialAPICommandDoneData & {
38
16
  reason: "node timeout";
39
17
  result?: undefined;
40
18
  };
19
+ export interface ActiveTransaction {
20
+ transaction: Transaction;
21
+ machine: ActorRefFrom<TransactionMachine>;
22
+ }
41
23
  export interface SendThreadContext {
42
- commandQueue: CommandQueueInterpreter;
43
24
  queue: SortedList<Transaction>;
44
- currentTransaction?: Transaction;
45
- handshakeTransaction?: Transaction;
46
- sendDataAttempts: number;
25
+ commandQueue: ActorRef<any, any>;
26
+ activeTransactions: Map<string, ActiveTransaction>;
27
+ counter: number;
47
28
  paused: boolean;
48
29
  }
49
30
  export declare type SendThreadEvent = {
@@ -51,12 +32,6 @@ export declare type SendThreadEvent = {
51
32
  transaction: Transaction;
52
33
  } | {
53
34
  type: "trigger";
54
- } | {
55
- type: "nodeUpdate";
56
- result: ApplicationCommandRequest | BridgeApplicationCommandRequest;
57
- } | {
58
- type: "handshakeResponse";
59
- result: ApplicationCommandRequest | BridgeApplicationCommandRequest;
60
35
  } | {
61
36
  type: "unsolicited";
62
37
  message: Message;
@@ -85,23 +60,19 @@ export declare type SendThreadEvent = {
85
60
  type: "command_failure";
86
61
  } | {
87
62
  type: "command_error";
88
- })) | ({
89
- type: "active_command_success";
90
- } & Omit<CommandQueueEvent & {
91
- type: "command_success";
92
- }, "type">) | ({
93
- type: "active_command_failure";
94
- } & Omit<CommandQueueEvent & {
95
- type: "command_failure";
96
- }, "type">) | ({
97
- type: "active_command_error";
98
- } & Omit<CommandQueueEvent & {
99
- type: "command_error";
100
- }, "type">) | {
63
+ })) | {
101
64
  type: "pause" | "unpause";
65
+ } | {
66
+ type: "forward";
67
+ from: string;
68
+ to: string;
69
+ payload: any;
70
+ } | {
71
+ type: "transaction_done";
72
+ id: string;
102
73
  };
103
- export declare type SendThreadMachine = StateMachine<SendThreadContext, SendThreadStateSchema, SendThreadEvent>;
104
- export declare type SendThreadInterpreter = Interpreter<SendThreadContext, SendThreadStateSchema, SendThreadEvent>;
74
+ export declare type SendThreadMachine = StateMachine<SendThreadContext, any, SendThreadEvent>;
75
+ export declare type SendThreadInterpreter = Interpreter<SendThreadContext, any, SendThreadEvent>;
105
76
  export declare type TransactionReducerResult = {
106
77
  type: "drop";
107
78
  } | {
@@ -118,10 +89,10 @@ export declare type TransactionReducerResult = {
118
89
  priority?: MessagePriority;
119
90
  tag?: any;
120
91
  };
121
- export declare type TransactionReducer = (transaction: Transaction, source: "queue" | "current") => TransactionReducerResult;
92
+ export declare type TransactionReducer = (transaction: Transaction, source: "queue" | "active") => TransactionReducerResult;
122
93
  export declare type SendThreadMachineParams = {
123
94
  timeouts: SerialAPICommandMachineParams["timeouts"] & Pick<ZWaveOptions["timeouts"], "report">;
124
- attempts: SerialAPICommandMachineParams["attempts"] & Pick<ZWaveOptions["attempts"], "retryAfterTransmitReport">;
95
+ attempts: SerialAPICommandMachineParams["attempts"];
125
96
  };
126
97
  export declare function createSendThreadMachine(implementations: ServiceImplementations, params: SendThreadMachineParams): SendThreadMachine;
127
98
  //# sourceMappingURL=SendThreadMachine.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SendThreadMachine.d.ts","sourceRoot":"","sources":["../../../src/lib/driver/SendThreadMachine.ts"],"names":[],"mappings":"AAAA,OAAO,EA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