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

Fixes the PCI-port bug on Raspberry Pi 4 #113

Merged
merged 5 commits into from
Jul 27, 2023
Merged

Conversation

KnorrFG
Copy link
Contributor

@KnorrFG KnorrFG commented Jul 27, 2023

The Bug is caused by the Fact that the USB controller is connected to
the CPU via PCI, which was not the case on the Raspberry Pi 3.
Because of this, the BUS_ID reported by libudev is PCI. However, if it
is an actual USB device, there will be fields containing the neccessary
information to generate a UsbPortInfo. This patch checks whether all
those fields are available, if the BUS_ID is Pci, and if so uses them to
populate an UsbPortInfo and return a SerialPortType::UsbPort

Fixes #110

The Bug is caused by the Fact that the USB controller is connected to
the CPU via PCI, which was not the case on the Raspberry Pi 3.
Because of this, the BUS_ID reported by libudev is PCI. However, if it
is an actual USB device, there will be fields containing the neccessary
information to generate a UsbPortInfo. This patch checks whether all
those fields are available, if the BUS_ID is Pci, and if so uses them to
populate an UsbPortInfo and return a SerialPortType::UsbPort
Copy link
Contributor

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Seems fine to me, thank you!
Could you look into the CI failures?

Copy link
Contributor

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Thanks! Could you add an entry to the changelog as well?

Copy link
Contributor

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Thank you for your work!

@eldruin eldruin merged commit 9d95e5c into serialport:main Jul 27, 2023
@KnorrFG
Copy link
Contributor Author

KnorrFG commented Jul 27, 2023

No problem, I actually need it myself ^^. The sooner it's on crates.io the happier I am :)
And thank you for your library :)

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.

UsbPorts are detected as PciPorts on Raspberry Pi 4b
2 participants