tools/pyboard: ProcessPtyToTerminal: Add workaround for PySerial bug.

When working with a "virtual" port, like PTY. The issue described in
http://stackoverflow.com/questions/34831131/pyserial-does-not-play-well-with-virtual-port
pull/2285/merge
Paul Sokolovsky 2017-04-05 12:30:39 +03:00
rodzic d46899626e
commit 2cbe997834
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -179,7 +179,9 @@ class ProcessPtyToTerminal:
self.close()
sys.exit(1)
pty = m.group()
self.ser = serial.Serial(pty, interCharTimeout=1)
# rtscts, dsrdtr params are to workaround pyserial bug:
# http://stackoverflow.com/questions/34831131/pyserial-does-not-play-well-with-virtual-port
self.ser = serial.Serial(pty, interCharTimeout=1, rtscts=True, dsrdtr=True)
def close(self):
import signal