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

Add DeviceInfo::port_chain #71

Merged
merged 5 commits into from
Aug 12, 2024
Merged

Add DeviceInfo::port_chain #71

merged 5 commits into from
Aug 12, 2024

Conversation

kevinmehall
Copy link
Owner

@kevinmehall kevinmehall commented Aug 3, 2024

A simplified rewrite of @CCnut's #58

/// Path of port numbers identifying the physical port where the device is
/// connected.
///
/// The first value is the bus number, and subsequent values represent the
/// port used on each hub on the path to this device. The path is expected
/// to remain stable across device insertions or reboots.
///
/// Since USB SuperSpeed is a separate topology from USB 2.0 speeds, a
/// physical port may be identified differently depending on speed.
pub fn port_chain(&self) -> Option<&[u8]>;

I've put the bus number at the beginning of the port chain, because the root hub port numbers are only unique within the bus. This makes it simpler to use as an identifier without getting the bus number separately. However, since the bus number is wrong on Windows and may not be a useful concept anyway, I might remove that. (Removed)

@kevinmehall kevinmehall merged commit 3ec3508 into main Aug 12, 2024
7 checks passed
@kevinmehall kevinmehall deleted the port-chain branch August 12, 2024 05:15
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.

1 participant