Skip to content

Commit ab64a2b

Browse files
test rtscts
1 parent 0fddf2e commit ab64a2b

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

index.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,12 +1131,24 @@ io.on("connection", function(socket) {
11311131

11321132
if (status.comms.connectionStatus < 1) {
11331133

1134+
1135+
11341136
if (data.type == "usb") {
11351137
console.log("connect", "Connecting to " + data.port + " via " + data.type);
1138+
1139+
// Fix for autoreset getting stuck on MacOS with Silabs Chip
1140+
var allowRtsCts = false
1141+
var allowHupcl = false
1142+
if (process.platform == 'darwin') {
1143+
allowRtsCts = true
1144+
allowHupcl = true
1145+
}
1146+
11361147
port = new SerialPort({
11371148
path: data.port,
11381149
baudRate: parseInt(data.baud),
1139-
//hupcl: false // Don't set DTR - useful for X32 Reset
1150+
rtscts: allowRtsCts,
1151+
hupcl: allowHupcl // Don't set DTR - useful for X32 Reset
11401152
});
11411153
} else if (data.type == "telnet") {
11421154
console.log("connect", "Connecting to " + data.ip + " via " + data.type);
@@ -1180,10 +1192,6 @@ io.on("connection", function(socket) {
11801192
});
11811193

11821194
port.on("open", function(e) {
1183-
port.set({
1184-
dtr: true,
1185-
rts: true
1186-
});
11871195
portOpened(port, data)
11881196
});
11891197

0 commit comments

Comments
 (0)