pull/358/head
unknown 2024-04-25 20:48:30 +02:00
rodzic 2fb8abe2a2
commit 0fddf2e638
1 zmienionych plików z 4 dodań i 13 usunięć

Wyświetl plik

@ -1133,24 +1133,11 @@ io.on("connection", function(socket) {
if (data.type == "usb") {
console.log("connect", "Connecting to " + data.port + " via " + data.type);
const defaultSetFlags = {
SetOptions: {
brk: false,
cts: false,
dtr: false,
rts: false,
}
}
port = new SerialPort({
path: data.port,
baudRate: parseInt(data.baud),
autoOpen: false
//hupcl: false // Don't set DTR - useful for X32 Reset
});
port.set(defaultSetFlags)
port.open()
} else if (data.type == "telnet") {
console.log("connect", "Connecting to " + data.ip + " via " + data.type);
port = net.connect(23, data.ip);
@ -1193,6 +1180,10 @@ io.on("connection", function(socket) {
});
port.on("open", function(e) {
port.set({
dtr: true,
rts: true
});
portOpened(port, data)
});