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

miniterm: implement --reconnect, exit(1) on error #651

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

belm0
Copy link

@belm0 belm0 commented May 15, 2022

  • --reconnect option will silently retry (on the initially connected port)
  • only show received/send backtrace if --develop
  • exit with code 1 when there is an error

Fixes #558

$ python -m serial.tools.miniterm /dev/foo --reconnect
--- Miniterm on /dev/cu.wchusbserial51850172701  115200,8,N,1 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
fps:  65.4,  render:  1.0 ms
fps:  64.9,  render:  1.0 ms
fps:  64.7,  render:  1.0 ms

--- disconnected ---
fps:  64.5,  render:  1.0 ms
fps:  64.5,  render:  1.0 ms
fps:  64.5,  render:  1.0 ms

--- exit ---

  * --reconnect option will silently retry (on the initially
    connected port)

  * exit with code 1 when there is an error

Fixes pyserial#558
self.console.cancel()
raise # XXX handle instead of re-raise?
if not self.quiet:
sys.stderr.write('--- receive exception ---\n')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be "--- received exception ---\n"

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.

Reconnect after connection loss
2 participants