Skip to content

Commit d29109f

Browse files
Copilotjyong15
andcommitted
Add explicit DTR/RTS signal control after port configuration on MacOS
Co-authored-by: jyong15 <26561407+jyong15@users.noreply.github.com>
1 parent c4ba7e0 commit d29109f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

ShimmerDriverPC/src/main/java/com/shimmerresearch/pcSerialPort/SerialPortCommJssc.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,16 @@ public void connect() throws ShimmerException {
112112
} catch (SerialPortException e) {
113113
consolePrintLn("MacOS: Warning - failed to purge buffers: " + e.getMessage());
114114
}
115+
116+
// Explicitly set DTR and RTS signals after port configuration
117+
// Setting them in setParams() may not be sufficient on MacOS
118+
try {
119+
mSerialPort.setRTS(true);
120+
mSerialPort.setDTR(true);
121+
consolePrintLn("MacOS: Explicitly set RTS=true and DTR=true");
122+
} catch (SerialPortException e) {
123+
consolePrintLn("MacOS: Warning - failed to set DTR/RTS: " + e.getMessage());
124+
}
115125
}
116126

117127
// On MacOS, serial ports need a brief settling time after opening

0 commit comments

Comments
 (0)