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

linux: support getting usb port info without libudev #220

Merged
merged 6 commits into from
Oct 14, 2024

Conversation

xobs
Copy link
Contributor

@xobs xobs commented Oct 5, 2024

libudev can make cross-compiling difficult, particularly due to its reliance on pkg-config. It is used primarily for enumeration.

Support getting USB port info such as VID and PID when libudev is disabled. This reads this information out of /sys/. If the information cannot be discovered, then the port type will be Unknown.

The method of discovery is based on pySerial, which does something similar.

xobs and others added 6 commits October 14, 2024 12:00
Support getting USB port info such as VID and PID when libudev is
disabled. This reads this information out of /sys/.

The method of discovery was based on pySerial, which does something
similar.

Signed-off-by: Sean Cross <[email protected]>
This helps (at least me) a lot for faster visual navigation through the
output of this example.
@sirhcel sirhcel force-pushed the usb-port-info-without-libudev branch from 24823aa to a017ba4 Compare October 14, 2024 10:35
@sirhcel
Copy link
Contributor

sirhcel commented Oct 14, 2024

This is a great improvement. Looks good and produces the exact same information as device enumeration with libudev in my test setup. Thank you very much for your contribution!

@sirhcel sirhcel merged commit a93db85 into serialport:main Oct 14, 2024
30 checks passed
@xobs xobs deleted the usb-port-info-without-libudev branch October 15, 2024 00:58
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