Skip to content

Add DeviceInfo::port_chain#71

Merged
kevinmehall merged 5 commits intomainfrom
port-chain
Aug 12, 2024
Merged

Add DeviceInfo::port_chain#71
kevinmehall merged 5 commits intomainfrom
port-chain

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)

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