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

Improve Gemini PR, Passport, and Procat support #866

Merged
merged 4 commits into from
Dec 3, 2017

Conversation

benoit-pierre
Copy link
Member

Add an _iter_packets(packets_size) helper to SerialStenotypeBase: yield packets of packets_size bytes until the machine is stopped. To workaround the fact that the Toshiba Bluetooth stack on Windows does not correctly handle the read timeout setting (returning immediately if some data is already available):

  • the effective timeout is re-configured to timeout/packet_size
  • multiple reads are done (until a packet is complete)
  • an incomplete packet will only be discarded if one of those reads return no data (but not on short read)

Update the Gemini PR code to use this new method and reject invalid packets. Fix #846.

Note: the Procat code should probably be updated to do the same.

- use base class helper for reading packets
- discard invalid packets
@benoit-pierre
Copy link
Member Author

And the Passport code should probably do the same as the Tx Bolt, i.e.:

raw = self.serial_port.read(max(1, self.serial_port.inWaiting()))

- use base class helper for reading packets
- discard invalid packets
Do not hog the CPU constantly trying to read 0 bytes of
data from the serial port when no data is available....
@benoit-pierre benoit-pierre changed the title Fix Gemini PR sync problems Improve Gemini PR, Passport, and Procat support Dec 3, 2017
@benoit-pierre
Copy link
Member Author

Updated to improve support for the following machines:

  • Procat: use the new method for getting packets, discard invalid packets
  • Passport: do not hog the CPU constantly trying to read 0 bytes of data from the serial port when no data is available....

@morinted morinted merged commit c89bd7e into openstenoproject:master Dec 3, 2017
@benoit-pierre benoit-pierre deleted the gemini_sync branch December 3, 2017 21:42
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.

2 participants