zwave-js 11.5.1 → 11.5.2

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.
@@ -52,17 +52,19 @@ export declare class Driver extends TypedEventEmitter<DriverEventCallbacks> impl
52
52
  constructor(port: string | ZWaveSerialPortImplementation, options?: DeepPartial<ZWaveOptions>);
53
53
  /** The serial port instance */
54
54
  private serial;
55
- /** The queue of pending transactions */
56
55
  private queue;
56
+ private immediateQueue;
57
+ private serialAPIQueue;
58
+ /** Gives access to the transaction queues, ordered by priority */
59
+ private get queues();
57
60
  private queuePaused;
58
- /** The transaction that is currently being handled */
59
- private currentTransaction;
60
61
  /** The interpreter for the currently active Serial API command */
61
62
  private serialAPIInterpreter;
62
- private _sendThreadIdle;
63
- /** Whether the Send Thread is currently idle */
64
- get sendThreadIdle(): boolean;
65
- private set sendThreadIdle(value);
63
+ private _queuesBusyFlags;
64
+ private _queueIdle;
65
+ /** Whether the queue is currently idle */
66
+ get queueIdle(): boolean;
67
+ private set queueIdle(value);
66
68
  /** A map of handlers for all sorts of requests */
67
69
  private requestHandlers;
68
70
  /** A list of awaited message headers */
@@ -417,16 +419,20 @@ export declare class Driver extends TypedEventEmitter<DriverEventCallbacks> impl
417
419
  * Gets called whenever any Serial API command succeeded or a SendData command had a negative callback.
418
420
  */
419
421
  private handleSerialAPICommandResult;
420
- private mayStartNextTransaction;
421
- private drainQueueBusy;
422
- private drainQueue;
422
+ private mayStartTransaction;
423
+ private markQueueBusy;
424
+ private drainTransactionQueue;
423
425
  /** Steps through the message generator of a transaction. Throws an error if the transaction should fail. */
424
- private drainTransactionGenerator;
425
- private triggerQueue;
426
+ private executeTransaction;
427
+ /** Handles sequencing of queued Serial API commands */
428
+ private drainSerialAPIQueue;
429
+ private triggerQueues;
430
+ /** Puts a message on the serial API queue and returns or throws the command result */
431
+ private queueSerialAPICommand;
426
432
  private mayRetrySerialAPICommand;
427
433
  /**
428
434
  * Executes a Serial API command and returns or throws the result.
429
- * @param transaction The transaction which contains the message to be executed
435
+ * This method should not be called outside of {@link drainSerialAPIQueue}.
430
436
  */
431
437
  private executeSerialAPICommand;
432
438
  /**
@@ -511,6 +517,7 @@ export declare class Driver extends TypedEventEmitter<DriverEventCallbacks> impl
511
517
  * Unpauses the send queue, allowing commands to be sent to the controller again
512
518
  */
513
519
  private unpauseSendQueue;
520
+ private reduceQueues;
514
521
  private reduceQueue;
515
522
  private cachePurge;
516
523
  /**
@@ -551,7 +558,7 @@ export declare class Driver extends TypedEventEmitter<DriverEventCallbacks> impl
551
558
  waitForBootloaderChunk<T extends BootloaderChunk>(predicate: (chunk: BootloaderChunk) => boolean, timeout: number): Promise<T>;
552
559
  private pollBackgroundRSSITimer;
553
560
  private lastBackgroundRSSITimestamp;
554
- private handleSendThreadIdleChange;
561
+ private handleQueueIdleChange;
555
562
  }
556
563
  export {};
557
564
  //# sourceMappingURL=Driver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Driver.d.ts","sourceRoot":"","sources":["../../../src/lib/driver/Driver.ts"],"names":[],"mappings":";;AAEA,OAAO,EAiCN,KAAK,YAAY,EAEjB,KAAK,sBAAsB,EAI3B,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,aAAa,EAEb,KAAK,YAAY,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,cAAc,EACd,gBAAgB,EAQhB,aAAa,EACb,eAAe,EACf,gBAAgB,EAchB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,aAAa,EAElB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EAIvB,KAAK,OAAO,EACZ,KAAK,OAAO,EAEZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACX,uBAAuB,EACvB,oBAAoB,EACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEN,YAAY,EACZ,OAAO,EACP,cAAc,EAWd,KAAK,eAAe,EAEpB,KAAK,6BAA6B,E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CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM;IAItC;;;OAGG;IACU,qBAAqB,CACjC,MAAM,GAAE,OAAe,GACrB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAwB9B;;;;;OAKG;IACU,mBAAmB,IAAI,OAAO,CAAC,OAAO,CAAC;IA8CpD,OAAO,CAAC,mBAAmB,CAAkB;IAC7C,OAAO,CAAC,uBAAuB,CAAoC;IAgDnE,OAAO,CAAC,uBAAuB;IAwC/B,OAAO,CAAC,2BAA2B;IAgDnC;;;;OAIG;IACI,sBAAsB,CAAC,CAAC,SAAS,eAAe,EACtD,SAAS,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,EAC9C,OAAO,EAAE,MAAM,GACb,OAAO,CAAC,CAAC,CAAC;IAgCb,OAAO,CAAC,uBAAuB,CAA6B;IAC5D,OAAO,CAAC,2BAA2B,CAAK;IAExC,OAAO,CAAC,qBAAqB;CA8B7B"}
@@ -36,7 +36,6 @@ const serial_1 = require("@zwave-js/serial");
36
36
  const shared_1 = require("@zwave-js/shared");
37
37
  const async_1 = require("alcalzone-shared/async");
38
38
  const deferred_promise_1 = require("alcalzone-shared/deferred-promise");
39
- const sorted_list_1 = require("alcalzone-shared/sorted-list");
40
39
  const typeguards_1 = require("alcalzone-shared/typeguards");
41
40
  const crypto_1 = require("crypto");
42
41
  const fs_extra_1 = __importDefault(require("fs-extra"));
@@ -63,6 +62,7 @@ const statistics_1 = require("../telemetry/statistics");
63
62
  const Bootloader_1 = require("./Bootloader");
64
63
  const MessageGenerators_1 = require("./MessageGenerators");
65
64
  const NetworkCache_1 = require("./NetworkCache");
65
+ const Queue_1 = require("./Queue");
66
66
  const SerialAPICommandMachine_1 = require("./SerialAPICommandMachine");
67
67
  const StateMachineShared_1 = require("./StateMachineShared");
68
68
  const ThrottlePresets_1 = require("./ThrottlePresets");
@@ -191,6 +191,8 @@ class Driver extends shared_1.TypedEventEmitter {
191
191
  super();
192
192
  this.port = port;
193
193
  this.queuePaused = false;
194
+ // Keep track of which queues are currently busy
195
+ this._queuesBusyFlags = 0;
194
196
  /** A map of handlers for all sorts of requests */
195
197
  this.requestHandlers = new Map();
196
198
  /** A list of awaited message headers */
@@ -273,7 +275,6 @@ class Driver extends shared_1.TypedEventEmitter {
273
275
  * Returns the next session ID for Transport Service CC
274
276
  */
275
277
  this.getNextTransportServiceSessionId = (0, shared_1.createWrappingCounter)(core_1.MAX_TRANSPORT_SERVICE_SESSION_ID, true);
276
- this.drainQueueBusy = false;
277
278
  this.sendNodeToSleepTimers = new Map();
278
279
  this._enteringBootloader = false;
279
280
  this.lastBackgroundRSSITimestamp = 0;
@@ -303,17 +304,31 @@ class Driver extends shared_1.TypedEventEmitter {
303
304
  logContainer: this._logContainer,
304
305
  deviceConfigPriorityDir: this._options.storage.deviceConfigPriorityDir,
305
306
  });
306
- this.queue = new sorted_list_1.SortedList();
307
- this._sendThreadIdle = false;
307
+ this.immediateQueue = new Queue_1.TransactionQueue({
308
+ name: "immediate",
309
+ // Messages on the immediate queue may always be sent unless the queue is paused
310
+ mayStartNextTransaction: () => !this.queuePaused,
311
+ });
312
+ this.queue = new Queue_1.TransactionQueue({
313
+ name: "normal",
314
+ mayStartNextTransaction: (t) => this.mayStartTransaction(t),
315
+ });
316
+ this.serialAPIQueue = new shared_1.AsyncQueue();
317
+ this._queueIdle = false;
308
318
  }
309
- /** Whether the Send Thread is currently idle */
310
- get sendThreadIdle() {
311
- return this._sendThreadIdle;
319
+ /** Gives access to the transaction queues, ordered by priority */
320
+ get queues() {
321
+ return [this.immediateQueue, this.queue];
312
322
  }
313
- set sendThreadIdle(value) {
314
- if (this._sendThreadIdle !== value) {
315
- this._sendThreadIdle = value;
316
- this.handleSendThreadIdleChange(value);
323
+ /** Whether the queue is currently idle */
324
+ get queueIdle() {
325
+ return this._queueIdle;
326
+ }
327
+ set queueIdle(value) {
328
+ if (this._queueIdle !== value) {
329
+ this.driverLog.print(`all queues ${value ? "idle" : "busy"}`);
330
+ this._queueIdle = value;
331
+ this.handleQueueIdleChange(value);
317
332
  }
318
333
  }
319
334
  ensureNodeSessions(nodeId) {
@@ -619,6 +634,12 @@ class Driver extends shared_1.TypedEventEmitter {
619
634
  this.driverLog.print("serial port opened");
620
635
  this._isOpen = true;
621
636
  spOpenPromise.resolve();
637
+ // Start draining the queues
638
+ for (const queue of this.queues) {
639
+ void this.drainTransactionQueue(queue);
640
+ }
641
+ // Start the serial API queue
642
+ void this.drainSerialAPIQueue();
622
643
  if (typeof this._options.testingHooks?.onSerialPortOpen ===
623
644
  "function") {
624
645
  await this._options.testingHooks.onSerialPortOpen(this.serial);
@@ -963,7 +984,7 @@ class Driver extends shared_1.TypedEventEmitter {
963
984
  // If we only have sleeping nodes or a controller-only network, the send
964
985
  // thread is idle before the driver gets marked ready, the idle tasks won't be triggered.
965
986
  // So do it manually.
966
- this.handleSendThreadIdleChange(this.sendThreadIdle);
987
+ this.handleQueueIdleChange(this.queueIdle);
967
988
  }
968
989
  }
969
990
  /**
@@ -1082,7 +1103,7 @@ class Driver extends shared_1.TypedEventEmitter {
1082
1103
  this.controllerLog.logNode(node.id, `The node is ${oldStatus === _Types_1.NodeStatus.Unknown ? "" : "now "}awake.`);
1083
1104
  // Make sure to handle the pending messages as quickly as possible
1084
1105
  if (oldStatus === _Types_1.NodeStatus.Asleep) {
1085
- this.reduceQueue(({ message }) => {
1106
+ this.reduceQueues(({ message }) => {
1086
1107
  // Ignore messages that are not for this node
1087
1108
  if (message.getNodeId() !== node.id)
1088
1109
  return { type: "keep" };
@@ -1433,10 +1454,7 @@ class Driver extends shared_1.TypedEventEmitter {
1433
1454
  hasPendingTransactions(predicate) {
1434
1455
  if (!!this.queue.find((t) => predicate(t)))
1435
1456
  return true;
1436
- if (this.currentTransaction && predicate(this.currentTransaction)) {
1437
- return true;
1438
- }
1439
- return false;
1457
+ return this.queues.some((q) => q.currentTransaction && predicate(q.currentTransaction));
1440
1458
  }
1441
1459
  /**
1442
1460
  * Retrieves the maximum version of a command class the given endpoint supports.
@@ -1802,7 +1820,11 @@ class Driver extends shared_1.TypedEventEmitter {
1802
1820
  return this._destroyPromise;
1803
1821
  this._destroyPromise = (0, deferred_promise_1.createDeferredPromise)();
1804
1822
  this.driverLog.print("destroying driver instance...");
1805
- // First stop the send thread machine and close the serial port, so nothing happens anymore
1823
+ // First stop all queues and close the serial port, so nothing happens anymore
1824
+ this.serialAPIQueue.abort();
1825
+ for (const queue of this.queues) {
1826
+ queue.abort();
1827
+ }
1806
1828
  if (this.serialAPIInterpreter?.status === xstate_1.InterpreterStatus.Running) {
1807
1829
  this.serialAPIInterpreter.stop();
1808
1830
  }
@@ -2455,7 +2477,7 @@ class Driver extends shared_1.TypedEventEmitter {
2455
2477
  });
2456
2478
  await this.sendCommand(cc, {
2457
2479
  maxSendAttempts: 1,
2458
- priority: core_1.MessagePriority.Nonce,
2480
+ priority: core_1.MessagePriority.Immediate,
2459
2481
  });
2460
2482
  },
2461
2483
  sendSegmentsComplete: async () => {
@@ -2470,7 +2492,7 @@ class Driver extends shared_1.TypedEventEmitter {
2470
2492
  });
2471
2493
  await this.sendCommand(cc, {
2472
2494
  maxSendAttempts: 1,
2473
- priority: core_1.MessagePriority.Nonce,
2495
+ priority: core_1.MessagePriority.Immediate,
2474
2496
  });
2475
2497
  },
2476
2498
  }, {
@@ -2514,7 +2536,7 @@ class Driver extends shared_1.TypedEventEmitter {
2514
2536
  });
2515
2537
  await this.sendCommand(cc, {
2516
2538
  maxSendAttempts: 1,
2517
- priority: core_1.MessagePriority.Nonce,
2539
+ priority: core_1.MessagePriority.Immediate,
2518
2540
  });
2519
2541
  }
2520
2542
  }
@@ -2708,7 +2730,7 @@ ${handlers.length} left`);
2708
2730
  }
2709
2731
  // It could also be that this is the node's response for a CC that we sent, but where the ACK is delayed
2710
2732
  if ((0, cc_1.isCommandClassContainer)(msg)) {
2711
- const currentMessage = this.currentTransaction?.getCurrentMessage();
2733
+ const currentMessage = this.queue.currentTransaction?.getCurrentMessage();
2712
2734
  if (currentMessage &&
2713
2735
  currentMessage.expectsNodeUpdate() &&
2714
2736
  currentMessage.isExpectedNodeUpdate(msg)) {
@@ -3001,9 +3023,8 @@ ${handlers.length} left`);
3001
3023
  // Track and potentially update the status of the node when communication succeeds
3002
3024
  if (success) {
3003
3025
  if (node.canSleep) {
3004
- // Do not update the node status when we only responded to a nonce request
3005
- if (options.priority !== core_1.MessagePriority.Nonce &&
3006
- options.priority !== core_1.MessagePriority.Supervision) {
3026
+ // Do not update the node status when we only responded to a nonce/supervision request
3027
+ if (options.priority !== core_1.MessagePriority.Immediate) {
3007
3028
  // If the node is not meant to be kept awake, try to send it back to sleep
3008
3029
  if (!node.keepAwake) {
3009
3030
  setImmediate(() => this.debounceSendNodeToSleep(node));
@@ -3022,15 +3043,11 @@ ${handlers.length} left`);
3022
3043
  this._controller?.incrementStatistics("messagesTX");
3023
3044
  }
3024
3045
  }
3025
- mayStartNextTransaction() {
3046
+ mayStartTransaction(transaction) {
3026
3047
  // We may not send anything if the send thread is paused
3027
3048
  if (this.queuePaused)
3028
3049
  return false;
3029
- const nextTransaction = this.queue.peekStart();
3030
- // We can't send anything if the queue is empty
3031
- if (!nextTransaction)
3032
- return false;
3033
- const message = nextTransaction.message;
3050
+ const message = transaction.message;
3034
3051
  const targetNode = message.getNodeUnsafe(this);
3035
3052
  // The transaction queue is sorted automatically. If the first message is for a sleeping node, all messages in the queue are.
3036
3053
  // There are a few exceptions:
@@ -3039,26 +3056,8 @@ ${handlers.length} left`);
3039
3056
  // If we don't send them, they block the send queue
3040
3057
  // 3. Nodes that can sleep but do not support wakeup: https://github.com/zwave-js/node-zwave-js/discussions/1537
3041
3058
  // We need to try and send messages to them even if they are asleep, because we might never hear from them
3042
- // // While the queue is busy, we may not start any transaction, except nonce responses to the node we're currently communicating with
3043
- // if (meta.state.matches("busy")) {
3044
- // if (nextTransaction.priority === MessagePriority.Nonce) {
3045
- // for (const active of ctx.activeTransactions.values()) {
3046
- // if (
3047
- // active.transaction.message.getNodeId() ===
3048
- // nextTransaction.message.getNodeId()
3049
- // ) {
3050
- // return true;
3051
- // }
3052
- // }
3053
- // }
3054
- // return false;
3055
- // }
3056
- // Replies to nonce requests and Supervision Get requests must always be allowed
3057
- if (nextTransaction.priority === core_1.MessagePriority.Nonce ||
3058
- nextTransaction.priority === core_1.MessagePriority.Supervision) {
3059
- return true;
3060
- }
3061
- // Same for pings
3059
+ // 2. is handled by putting the message into the immediate queue
3060
+ // Pings may always be sent
3062
3061
  if ((0, cc_1.messageIsPing)(message))
3063
3062
  return true;
3064
3063
  // Or messages to the controller
@@ -3068,62 +3067,59 @@ ${handlers.length} left`);
3068
3067
  (!targetNode.supportsCC(core_1.CommandClasses["Wake Up"]) &&
3069
3068
  targetNode.interviewStage >= _Types_1.InterviewStage.NodeInfo));
3070
3069
  }
3071
- async drainQueue() {
3072
- // Don't execute more than once at a time
3073
- if (this.drainQueueBusy)
3074
- return;
3075
- this.drainQueueBusy = true;
3076
- try {
3077
- while (this.mayStartNextTransaction()) {
3078
- const transaction = (this.currentTransaction =
3079
- this.queue.shift());
3080
- // We have something to send, so not idle
3081
- this.sendThreadIdle = false;
3082
- let error;
3083
- try {
3084
- await this.drainTransactionGenerator(transaction);
3085
- }
3086
- catch (e) {
3087
- error = e;
3088
- }
3089
- finally {
3090
- this.currentTransaction = undefined;
3091
- }
3092
- // Handle errors after clearing the current transaction.
3093
- // Otherwise, it will get considered the active transaction and cause an unnecessary SendDataAbort
3094
- if (error) {
3095
- this.rejectTransaction(transaction, error);
3096
- }
3097
- }
3070
+ markQueueBusy(queue, busy) {
3071
+ const index = this.queues.indexOf(queue);
3072
+ if (busy) {
3073
+ this._queuesBusyFlags |= 1 << index;
3098
3074
  }
3099
- finally {
3100
- this.drainQueueBusy = false;
3101
- this.sendThreadIdle = true;
3075
+ else {
3076
+ this._queuesBusyFlags &= ~(1 << index);
3077
+ }
3078
+ this.queueIdle = this._queuesBusyFlags === 0;
3079
+ }
3080
+ async drainTransactionQueue(queue) {
3081
+ let setIdleTimer;
3082
+ for await (const transaction of queue) {
3083
+ if (setIdleTimer) {
3084
+ clearImmediate(setIdleTimer);
3085
+ setIdleTimer = undefined;
3086
+ }
3087
+ this.markQueueBusy(queue, true);
3088
+ let error;
3089
+ try {
3090
+ await this.executeTransaction(transaction);
3091
+ }
3092
+ catch (e) {
3093
+ error = e;
3094
+ }
3095
+ finally {
3096
+ queue.finalizeTransaction();
3097
+ }
3098
+ // Handle errors after clearing the current transaction.
3099
+ // Otherwise, it will get considered the active transaction and cause an unnecessary SendDataAbort
3100
+ if (error) {
3101
+ this.rejectTransaction(transaction, error);
3102
+ }
3103
+ setIdleTimer = setImmediate(() => {
3104
+ this.markQueueBusy(queue, false);
3105
+ });
3102
3106
  }
3103
- // Avoid a deadlock when a transaction was added after the advanceQueue call,
3104
- // but before setting the busy flag back to false
3105
- if (this.mayStartNextTransaction())
3106
- this.triggerQueue();
3107
3107
  }
3108
3108
  /** Steps through the message generator of a transaction. Throws an error if the transaction should fail. */
3109
- async drainTransactionGenerator(transaction) {
3110
- transaction.parts.start();
3111
- // .self is now guaranteed to be defined
3109
+ async executeTransaction(transaction) {
3112
3110
  let prevResult;
3111
+ let msg;
3112
+ transaction.start();
3113
3113
  // Step through the transaction as long as it gives us a next message
3114
- while (!(await transaction.parts.self.next(prevResult)).done) {
3115
- // The .current property of the current transactions's message generator
3116
- // now contains the next message to send
3117
- const msg = transaction.getCurrentMessage();
3114
+ while ((msg = await transaction.generateNextMessage(prevResult))) {
3118
3115
  // TODO: refactor this nested loop or make it part of executeSerialAPICommand
3119
3116
  attemptMessage: for (let attemptNumber = 1;; attemptNumber++) {
3120
3117
  try {
3121
- prevResult = await this.executeSerialAPICommand(msg, transaction.stack);
3118
+ prevResult = await this.queueSerialAPICommand(msg, transaction.stack);
3122
3119
  if ((0, SendDataShared_1.isTransmitReport)(prevResult) && !prevResult.isOK()) {
3123
3120
  // The node did not acknowledge the command. Convert this into an
3124
- // error so it can be handled.
3125
- // First throw into the generator, so it can be reset
3126
- transaction.parts.self.throw(prevResult).catch(shared_1.noop);
3121
+ // error so it can be handled and abort the generator so it can be reset
3122
+ transaction.abort(prevResult);
3127
3123
  throw new core_1.ZWaveError("The node did not acknowledge the command", core_1.ZWaveErrorCodes.Controller_CallbackNOK, prevResult, transaction.stack);
3128
3124
  }
3129
3125
  // We got a result - it will be passed to the next iteration
@@ -3165,8 +3161,33 @@ ${handlers.length} left`);
3165
3161
  }
3166
3162
  // This transaction is finished, try the next one
3167
3163
  }
3168
- triggerQueue() {
3169
- process.nextTick(() => this.drainQueue());
3164
+ /** Handles sequencing of queued Serial API commands */
3165
+ async drainSerialAPIQueue() {
3166
+ for await (const item of this.serialAPIQueue) {
3167
+ const { msg, transactionSource, result } = item;
3168
+ try {
3169
+ const ret = await this.executeSerialAPICommand(msg, transactionSource);
3170
+ result.resolve(ret);
3171
+ }
3172
+ catch (e) {
3173
+ result.reject(e);
3174
+ }
3175
+ }
3176
+ }
3177
+ triggerQueues() {
3178
+ for (const queue of this.queues) {
3179
+ queue.trigger();
3180
+ }
3181
+ }
3182
+ /** Puts a message on the serial API queue and returns or throws the command result */
3183
+ queueSerialAPICommand(msg, transactionSource) {
3184
+ const result = (0, deferred_promise_1.createDeferredPromise)();
3185
+ this.serialAPIQueue.add({
3186
+ msg,
3187
+ transactionSource,
3188
+ result,
3189
+ });
3190
+ return result;
3170
3191
  }
3171
3192
  mayRetrySerialAPICommand(msg, attemptNumber, errorCode) {
3172
3193
  if (!(0, SendDataShared_1.isSendData)(msg))
@@ -3183,7 +3204,7 @@ ${handlers.length} left`);
3183
3204
  }
3184
3205
  /**
3185
3206
  * Executes a Serial API command and returns or throws the result.
3186
- * @param transaction The transaction which contains the message to be executed
3207
+ * This method should not be called outside of {@link drainSerialAPIQueue}.
3187
3208
  */
3188
3209
  async executeSerialAPICommand(msg, transactionSource) {
3189
3210
  const machine = (0, SerialAPICommandMachine_1.createSerialAPICommandMachine)(msg, {
@@ -3318,8 +3339,7 @@ ${handlers.length} left`);
3318
3339
  !(msg instanceof SendDataMessages_1.SendDataMulticastRequest) &&
3319
3340
  !(msg instanceof SendDataBridgeMessages_1.SendDataMulticastBridgeRequest) &&
3320
3341
  // Nonces and responses to Supervision Get have to be sent immediately
3321
- options.priority !== core_1.MessagePriority.Nonce &&
3322
- options.priority !== core_1.MessagePriority.Supervision) {
3342
+ options.priority !== core_1.MessagePriority.Immediate) {
3323
3343
  if (options.priority === core_1.MessagePriority.NodeQuery) {
3324
3344
  // Remember that this transaction was part of an interview
3325
3345
  options.tag = "interview";
@@ -3347,13 +3367,17 @@ ${handlers.length} left`);
3347
3367
  transaction.requestWakeUpOnDemand = !!options.requestWakeUpOnDemand;
3348
3368
  transaction.tag = options.tag;
3349
3369
  // And queue it
3350
- this.queue.add(transaction);
3351
- this.triggerQueue();
3370
+ if (transaction.priority === core_1.MessagePriority.Immediate) {
3371
+ this.immediateQueue.add(transaction);
3372
+ }
3373
+ else {
3374
+ this.queue.add(transaction);
3375
+ }
3352
3376
  // If the transaction should expire, start the timeout
3353
3377
  let expirationTimeout;
3354
3378
  if (options.expire) {
3355
3379
  expirationTimeout = setTimeout(() => {
3356
- this.reduceQueue((t, _source) => {
3380
+ this.reduceQueues((t, _source) => {
3357
3381
  if (t === transaction)
3358
3382
  return {
3359
3383
  type: "reject",
@@ -3371,8 +3395,7 @@ ${handlers.length} left`);
3371
3395
  if ((0, SendDataShared_1.isSendData)(msg)) {
3372
3396
  // For SendData messages, make sure the message is not a nonce
3373
3397
  maybeSendToSleep =
3374
- options.priority !== core_1.MessagePriority.Nonce &&
3375
- options.priority !== core_1.MessagePriority.Supervision &&
3398
+ options.priority !== core_1.MessagePriority.Immediate &&
3376
3399
  // And that the result is either a response from the node
3377
3400
  // or a transmit report indicating success
3378
3401
  result &&
@@ -3749,24 +3772,10 @@ ${handlers.length} left`);
3749
3772
  if (this.handleMissingNodeACK(transaction))
3750
3773
  return;
3751
3774
  }
3752
- // If the transaction was already started, we need to throw the error into the message generator
3753
- // so it correctly gets ended. Otherwise just reject the result promise
3754
- if (transaction.parts.self) {
3755
- transaction.parts.self.throw(error).catch(shared_1.noop);
3756
- }
3757
- else {
3758
- transaction.promise.reject(error);
3759
- }
3775
+ transaction.abort(error);
3760
3776
  }
3761
3777
  resolveTransaction(transaction, result) {
3762
- // If the transaction was already started, we need to end the message generator early by throwing
3763
- // the result. Otherwise just resolve the result promise
3764
- if (transaction.parts.self) {
3765
- transaction.parts.self.throw(result).catch(shared_1.noop);
3766
- }
3767
- else {
3768
- transaction.promise.resolve(result);
3769
- }
3778
+ transaction.abort(result);
3770
3779
  }
3771
3780
  /** Checks if a message is allowed to go into the wakeup queue */
3772
3781
  mayMoveToWakeupQueue(transaction) {
@@ -3774,8 +3783,7 @@ ${handlers.length} left`);
3774
3783
  switch (true) {
3775
3784
  // Pings, nonces and Supervision Reports will block the send queue until wakeup, so they must be dropped
3776
3785
  case (0, cc_1.messageIsPing)(msg):
3777
- case transaction.priority === core_1.MessagePriority.Nonce:
3778
- case transaction.priority === core_1.MessagePriority.Supervision:
3786
+ case transaction.priority === core_1.MessagePriority.Immediate:
3779
3787
  // We also don't want to immediately send the node to sleep when it wakes up
3780
3788
  case (0, cc_1.isCommandClassContainer)(msg) &&
3781
3789
  msg.command instanceof cc_1.WakeUpCCNoMoreInformation:
@@ -3800,7 +3808,7 @@ ${handlers.length} left`);
3800
3808
  ...requeue,
3801
3809
  tag: "interview",
3802
3810
  };
3803
- this.reduceQueue((transaction, _source) => {
3811
+ this.reduceQueues((transaction, _source) => {
3804
3812
  const msg = transaction.message;
3805
3813
  if (msg.getNodeId() !== nodeId)
3806
3814
  return { type: "keep" };
@@ -3818,7 +3826,7 @@ ${handlers.length} left`);
3818
3826
  * Rejects all pending transactions that match a predicate and removes them from the send queue
3819
3827
  */
3820
3828
  rejectTransactions(predicate, errorMsg = `The message has been removed from the queue`, errorCode = core_1.ZWaveErrorCodes.Controller_MessageDropped) {
3821
- this.reduceQueue((transaction, _source) => {
3829
+ this.reduceQueues((transaction, _source) => {
3822
3830
  if (predicate(transaction)) {
3823
3831
  return {
3824
3832
  type: "reject",
@@ -3849,9 +3857,14 @@ ${handlers.length} left`);
3849
3857
  */
3850
3858
  unpauseSendQueue() {
3851
3859
  this.queuePaused = false;
3852
- this.triggerQueue();
3860
+ this.triggerQueues();
3853
3861
  }
3854
- reduceQueue(reducer) {
3862
+ reduceQueues(reducer) {
3863
+ for (const queue of this.queues) {
3864
+ this.reduceQueue(queue, reducer);
3865
+ }
3866
+ }
3867
+ reduceQueue(queue, reducer) {
3855
3868
  const dropQueued = [];
3856
3869
  let stopActive;
3857
3870
  const requeue = [];
@@ -3897,30 +3910,32 @@ ${handlers.length} left`);
3897
3910
  break;
3898
3911
  }
3899
3912
  };
3900
- for (const transaction of this.queue) {
3913
+ for (const transaction of queue.transactions) {
3901
3914
  reduceTransaction(transaction, "queue");
3902
3915
  }
3903
- if (this.currentTransaction) {
3904
- reduceTransaction(this.currentTransaction, "active");
3916
+ if (queue.currentTransaction) {
3917
+ reduceTransaction(queue.currentTransaction, "active");
3905
3918
  }
3906
3919
  // Now we know what to do with the transactions
3907
- this.queue.remove(...dropQueued, ...requeue);
3908
- this.queue.add(...requeue.map((t) => t.clone()));
3920
+ queue.remove(...dropQueued, ...requeue);
3921
+ queue.add(...requeue.map((t) => t.clone()));
3909
3922
  // Abort ongoing SendData messages that should be dropped
3910
3923
  if ((0, SendDataShared_1.isSendData)(stopActive?.message)) {
3911
3924
  void this.abortSendData();
3912
3925
  }
3913
- // Continue sending
3914
- this.triggerQueue();
3915
3926
  }
3916
3927
  /** @internal */
3917
3928
  resolvePendingPings(nodeId) {
3918
3929
  // When a previously sleeping node sends a NIF after a ping was sent to it, but not acknowledged yet,
3919
3930
  // the node is awake, but the ping would fail. Resolve pending pings, so communication can continue.
3920
- const msg = this.currentTransaction?.parts.current;
3921
- if (!!msg && (0, cc_1.messageIsPing)(msg) && msg.getNodeId() === nodeId) {
3922
- // The pending transaction is a ping. Short-circuit its message generator by throwing something that's not an error
3923
- this.currentTransaction?.parts.self.throw(undefined).catch(shared_1.noop);
3931
+ for (const { currentTransaction } of this.queues) {
3932
+ if (!currentTransaction)
3933
+ continue;
3934
+ const msg = currentTransaction.parts.current;
3935
+ if (!!msg && (0, cc_1.messageIsPing)(msg) && msg.getNodeId() === nodeId) {
3936
+ // The pending transaction is a ping. Short-circuit its message generator by throwing something that's not an error
3937
+ currentTransaction.abort(undefined);
3938
+ }
3924
3939
  }
3925
3940
  }
3926
3941
  /**
@@ -4255,7 +4270,7 @@ ${handlers.length} left`);
4255
4270
  });
4256
4271
  });
4257
4272
  }
4258
- handleSendThreadIdleChange(idle) {
4273
+ handleQueueIdleChange(idle) {
4259
4274
  if (!this.ready)
4260
4275
  return;
4261
4276
  if (this.controller.isFunctionSupported(serial_1.FunctionType.GetBackgroundRSSI)) {