From bdd9b032f5d831721cdf525443e7207b5d7393a0 Mon Sep 17 00:00:00 2001 From: Sergey Polyakov Date: Thu, 3 Aug 2023 12:50:21 +0200 Subject: [PATCH] Don't send vendor requests when opening a device in DFU mode --- src/device-base.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/device-base.js b/src/device-base.js index 87d74c04..3fd99b2b 100644 --- a/src/device-base.js +++ b/src/device-base.js @@ -150,7 +150,9 @@ class DeviceBase extends EventEmitter { }).then(() => { this._log.trace('Device is open'); this._maxActiveReqs = options.concurrentRequests; - this._resetAllReqs = true; // Reset all requests remaining from a previous session + if (!this._dfu) { + this._resetAllReqs = true; // Reset all requests remaining from a previous session + } this._state = DeviceState.OPEN; this.emit('open'); this._process(); @@ -636,6 +638,7 @@ class DeviceBase extends EventEmitter { this._state = DeviceState.CLOSED; this._wantClose = false; this._maxActiveReqs = null; + this._dfu = null; this._fwVer = null; this._id = null; if (emitEvent) {