Skip to content

Managing a simultaneous bi-directional device communication. #493

Closed Answered by bjgillet
bjgillet asked this question in Q&A
Discussion options

You must be logged in to vote

As committed I confirm previous did the thing.
Due to limitations in python multi-threading, I had to implement an in-class pause/resume/stop mechanism through Event instances. (discovering python for something else than just basic scripting + total newbie vs. USB... Cool.)
Also, setting read timeout to 0 was not good option. Just catch timeout error and pass, check events, and act accordingly.
Don't forget to flush input streams between two cmd in/out thread switches for coherency when the paused will be waken up.
Then it works pretty well.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bjgillet
Comment options

Answer selected by mcuee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant