From c3cf946c606514167d96eaa021d51073a4e14a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=AB=8B=E5=B8=AE?= <3294713004@qq.com> Date: Mon, 20 Jan 2025 21:30:48 +0800 Subject: [PATCH] =?UTF-8?q?Update:=20=E7=A6=BB=E7=BA=BF=E7=89=88=E4=B8=8B?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=A0=B9=E6=8D=AE=E9=85=8D=E7=BD=AE=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=B8=B2=E5=8F=A3=E5=BC=80=E5=90=AF=E6=97=B6=E7=9A=84?= =?UTF-8?q?rtscts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/modules/mixly-modules/deps.json | 1 + common/modules/mixly-modules/electron/serial.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/common/modules/mixly-modules/deps.json b/common/modules/mixly-modules/deps.json index 2676d792..44e176ca 100644 --- a/common/modules/mixly-modules/deps.json +++ b/common/modules/mixly-modules/deps.json @@ -1452,6 +1452,7 @@ "Mixly.Msg", "Mixly.Debug", "Mixly.MArray", + "Mixly.Config", "Mixly.Electron" ], "provide": [ diff --git a/common/modules/mixly-modules/electron/serial.js b/common/modules/mixly-modules/electron/serial.js index b431abcd..e2ad87fb 100644 --- a/common/modules/mixly-modules/electron/serial.js +++ b/common/modules/mixly-modules/electron/serial.js @@ -5,6 +5,7 @@ goog.require('Mixly.Env'); goog.require('Mixly.Msg'); goog.require('Mixly.Debug'); goog.require('Mixly.MArray'); +goog.require('Mixly.Config'); goog.require('Mixly.Electron'); goog.provide('Mixly.Electron.Serial'); @@ -23,9 +24,12 @@ const { Msg, Debug, MArray, + Config, Electron } = Mixly; +const { BOARD } = Config; + class ElectronSerial extends Serial { static { @@ -137,7 +141,8 @@ class ElectronSerial extends Serial { parity: 'none', // 奇偶校验 stopBits: 1, // 停止位 flowControl: false, - autoOpen: false // 不自动打开 + autoOpen: false, // 不自动打开 + rtscts: BOARD?.serial?.rts ?? false }, false); this.#parserBytes_ = this.#serialport_.pipe(new ByteLengthParser({ length: 1 })); this.#parserLine_ = this.#serialport_.pipe(new ReadlineParser());