From 79d997d307613a23efb0632f437927544d2fa5e8 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 26 Sep 2024 23:21:14 +0800 Subject: [PATCH] usbportinfo: document interface variation Document that the interface number can vary depending on the platform. This addresses some surprise discovered in #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 --- src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 15e0457e..8671c6a0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -787,7 +787,9 @@ pub struct UsbPortInfo { pub manufacturer: Option, /// Product name (arbitrary string) pub product: Option, - /// 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, }