Open fujimotos opened 7 months ago
This fixes the issue "Python SDK randomly gets stuck on txpacket()".
termios.tcdrain()
tcdrain()
On the other hand, C/C++ SDK uses tcflush() for the same purpose, so simply dicards the data not transmitted yet. Fix Python SDK to do the same.
tcflush()
Related: See https://github.com/pyserial/pyserial/issues/625 for related discussion in pyserial/pyserial.
This fixes the issue "Python SDK randomly gets stuck on txpacket()".
termios.tcdrain()
to clear remaining data in the serial port.tcdrain()
is a blocking operation, it can paralyze the Python interpreter for a few seconds.On the other hand, C/C++ SDK uses
tcflush()
for the same purpose, so simply dicards the data not transmitted yet. Fix Python SDK to do the same.Related: See https://github.com/pyserial/pyserial/issues/625 for related discussion in pyserial/pyserial.