From f9d3427b20829a6bb91eec7db3a31d4128bd69b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=AB=8B=E5=B8=AE?= <3294713004@qq.com> Date: Sun, 26 Oct 2025 19:40:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(core):=20=E4=BF=AE=E5=A4=8D=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E6=83=85=E5=86=B5=E4=B8=8B=E6=9D=BF=E5=8D=A1=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=BF=9B=E5=85=A5waiting=20for=20download=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mixly-modules/web/serial-transport.js | 6 +++++- common/modules/mixly-modules/web/serialport.js | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/common/modules/mixly-modules/web/serial-transport.js b/common/modules/mixly-modules/web/serial-transport.js index 6f4d1726..70ea3e11 100644 --- a/common/modules/mixly-modules/web/serial-transport.js +++ b/common/modules/mixly-modules/web/serial-transport.js @@ -110,7 +110,11 @@ class Transport { async setRTS(state) { await this.serial.setRTS(state); - if (this.tracing) this.trace(`Set RTS = ${state}`); + await this.serial.setDTR(this.serial.getDTR()); + if (this.tracing) { + this.trace(`Set RTS = ${state}`); + this.trace(`Set DTR = ${this.serial.getDTR()}`); + } } async setDTR(state) { diff --git a/common/modules/mixly-modules/web/serialport.js b/common/modules/mixly-modules/web/serialport.js index 2b72d2b8..ebadf309 100644 --- a/common/modules/mixly-modules/web/serialport.js +++ b/common/modules/mixly-modules/web/serialport.js @@ -224,11 +224,23 @@ class WebSerialPort extends Serial { } async setDTR(dtr) { - return this.setDTRAndRTS(dtr, this.getRTS()); + if (!this.isOpened()) { + return; + } + await this.#serialport_.setSignals({ + dataTerminalReady: dtr + }); + super.setDTR(dtr); } async setRTS(rts) { - return this.setDTRAndRTS(this.getDTR(), rts); + if (!this.isOpened()) { + return; + } + await this.#serialport_.setSignals({ + requestToSend: rts + }); + super.setRTS(rts); } getVID() {