From 1c0d56685411bf7bcb6e7a3f981dd676b0688304 Mon Sep 17 00:00:00 2001 From: Charles Strahan Date: Wed, 31 Jan 2024 07:19:55 -0600 Subject: [PATCH 1/2] Fix interface string on macOS --- src/platform/macos_iokit/enumeration.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/macos_iokit/enumeration.rs b/src/platform/macos_iokit/enumeration.rs index af2cb2f..76d33a3 100644 --- a/src/platform/macos_iokit/enumeration.rs +++ b/src/platform/macos_iokit/enumeration.rs @@ -72,7 +72,7 @@ fn probe_device(device: IoService) -> Option { class: get_integer_property(&child, "bInterfaceClass")?, subclass: get_integer_property(&child, "bInterfaceSubClass")?, protocol: get_integer_property(&child, "bInterfaceProtocol")?, - interface_string: get_string_property(&child, "USB Interface Name"), + interface_string: get_string_property(&child, "kUSBString"), }) }) .collect() From b7cb0b6ef03e398c3e7e980255805cb0d4831190 Mon Sep 17 00:00:00 2001 From: Kevin Mehall Date: Wed, 31 Jan 2024 07:54:54 -0800 Subject: [PATCH 2/2] macos: try both "kUSBString" and "USB Interface Name" --- src/platform/macos_iokit/enumeration.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/macos_iokit/enumeration.rs b/src/platform/macos_iokit/enumeration.rs index 76d33a3..cc4e483 100644 --- a/src/platform/macos_iokit/enumeration.rs +++ b/src/platform/macos_iokit/enumeration.rs @@ -72,7 +72,8 @@ fn probe_device(device: IoService) -> Option { class: get_integer_property(&child, "bInterfaceClass")?, subclass: get_integer_property(&child, "bInterfaceSubClass")?, protocol: get_integer_property(&child, "bInterfaceProtocol")?, - interface_string: get_string_property(&child, "kUSBString"), + interface_string: get_string_property(&child, "kUSBString") + .or_else(|| get_string_property(&child, "USB Interface Name")), }) }) .collect()