Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "txpacket() randomly gets stuck on Linux" #621

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fujimotos
Copy link

This fixes the issue "Python SDK randomly gets stuck on txpacket()".

  • It turned out that Python SDK calls termios.tcdrain() to clear remaining
    data in the serial port.
  • Since 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 pyserial/pyserial#625 for related discussion in pyserial/pyserial.

It turned out that Python SDK calls termios.tcdrain() to clear remaining data
in the serial port. Since tcdrain() is a blocking operation, it can paralyze
the Python interpreter execution 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.

Signed-off-by: Fujimoto Seiji <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant