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 serial port handling #1510

Merged

Conversation

benoit-pierre
Copy link
Member

@benoit-pierre benoit-pierre commented Mar 20, 2022

Summary of changes

For the configuration widget of serial machines, use a custom item delegate for the serial combo box to show detailed information for each device (when available).

Additionally, use a platform specific helper for improving the serial ports information returned by pyserial:

  • on Linux: patch device paths to use device-by-id links:
    2022-03-19-160356_557x442_scrot
  • on Windows however, because most USB serial devices will use the generic CDC/ACM driver, their manufacturer is erroneously reported as Microsoft, so that information is stripped (if the vendor ID does not match) to avoid this mess (plugged: a Preonic keyboard and an Arduino):
    2022-03-19-160820_1440x949_scrot
  • on macOS: untested, the information returned by pyserial is used as-is.

I looked at improving the situation on Windows, and trying to use PyUSB does not work (I think because of a concurrent access issue with the serial driver), and the only other thing that I can think of is to embed a list of USB IDs, such as the one provided by the USB ID Repository.

Note this PR includes #1509.

Closes #789.

Pull Request Checklist

- [ ] Changes have tests

Too much trouble to maintain.
To `suppress`, in preparation for output plugins / locking keys support.
To avoid calling the capture' `suppress` method when it has not yet been started.
In preparations for changing `KeyboardCapture` to inherit from
a base capture class: use composition instead of inheriting from
`threading.Thread`.
In preparations for changing `KeyboardCapture` to inherit from
a base capture class: use composition instead of inheriting from
`threading.Thread`.
In preparations for changing `KeyboardCapture` to inherit from
a base capture class: use composition instead of inheriting from
`threading.Thread`.
To become the basis for 2 new plugin types.
Add platform specific sub-packages.
Add platform specific implementations of `patch_ports_info`:
- on Linux: patch device paths to use device-by-id links
- on Windows: fix erroneous manufacturer information
Use a custom item delegate for the combo box to show
detailed information for each device (when available).
@benoit-pierre benoit-pierre force-pushed the improve_serial_port_handling branch from 447a506 to 0e12688 Compare May 14, 2022 23:10
@benoit-pierre benoit-pierre merged commit 900c04b into openstenoproject:master May 15, 2022
@benoit-pierre benoit-pierre deleted the improve_serial_port_handling branch May 15, 2022 18:13
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.

Scan machine port to /dev/serial/by-id/whatever if available (eg on Linux)
1 participant