Skip to content

Commit

Permalink
usbportinfo: document interface variation
Browse files Browse the repository at this point in the history
Document that the interface number can vary depending on the platform.
This addresses some surprise discovered in serialport#214, as it isn't entirely
clear which interface should be used, but it is definitely clear that
different platforms report differing interface indexes.

Signed-off-by: Sean Cross <[email protected]>
  • Loading branch information
xobs committed Sep 26, 2024
1 parent eca70a7 commit 79d997d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,9 @@ pub struct UsbPortInfo {
pub manufacturer: Option<String>,
/// Product name (arbitrary string)
pub product: Option<String>,
/// Interface (id number for multiplexed devices)
/// The interface index of the USB port. This can be either the interface number of
/// the communication interface (as is the case on Windows and Linux) or the data
/// interface (as is the case on macOS), so you should recognize both interface numbers.
#[cfg(feature = "usbportinfo-interface")]
pub interface: Option<u8>,
}
Expand Down

0 comments on commit 79d997d

Please sign in to comment.