Skip to content

Commit 4ee3723

Browse files
committed
Set rtscts and dsrdtr to true for HMI serial port if its virtual
Signed-off-by: falkTX <falktx@falktx.com>
1 parent 8a92ab2 commit 4ee3723

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mod/hmi.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,15 @@ def init(self, callback):
122122
ioloop.call_later(1, callback)
123123
return
124124

125+
virtual = self.port.startswith("/dev/ttyHMI")
126+
125127
try:
126128
sp = None
127129
# pylint: disable=unexpected-keyword-arg
128130
try:
129-
sp = serial.Serial(self.port, self.baud_rate, timeout=0, write_timeout=0)
131+
sp = serial.Serial(self.port, self.baud_rate, rtscts=virtual, dsrdtr=virtual, timeout=0, write_timeout=0)
130132
except:
131-
sp = serial.Serial(self.port, self.baud_rate, timeout=0, writeTimeout=0)
133+
sp = serial.Serial(self.port, self.baud_rate, rtscts=virtual, dsrdtr=virtual, timeout=0, writeTimeout=0)
132134
# pylint: enable=unexpected-keyword-arg
133135
sp.flushInput()
134136
sp.flushOutput()

0 commit comments

Comments
 (0)