From ab64a2b1381f730c08202de805ef7a36ef1a7396 Mon Sep 17 00:00:00 2001
From: unknown
Date: Thu, 25 Apr 2024 22:12:14 +0200
Subject: [PATCH] test rtscts
---
index.js | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/index.js b/index.js
index eb977a8..ea9879f 100644
--- a/index.js
+++ b/index.js
@@ -1131,12 +1131,24 @@ io.on("connection", function(socket) {
if (status.comms.connectionStatus < 1) {
+
+
if (data.type == "usb") {
console.log("connect", "Connecting to " + data.port + " via " + data.type);
+
+ // Fix for autoreset getting stuck on MacOS with Silabs Chip
+ var allowRtsCts = false
+ var allowHupcl = false
+ if (process.platform == 'darwin') {
+ allowRtsCts = true
+ allowHupcl = true
+ }
+
port = new SerialPort({
path: data.port,
baudRate: parseInt(data.baud),
- //hupcl: false // Don't set DTR - useful for X32 Reset
+ rtscts: allowRtsCts,
+ hupcl: allowHupcl // Don't set DTR - useful for X32 Reset
});
} else if (data.type == "telnet") {
console.log("connect", "Connecting to " + data.ip + " via " + data.type);
@@ -1180,10 +1192,6 @@ io.on("connection", function(socket) {
});
port.on("open", function(e) {
- port.set({
- dtr: true,
- rts: true
- });
portOpened(port, data)
});