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

fix: use kUSBProductString and kUSBSerialNumberString as primary on m… #109

Merged
merged 4 commits into from
Jan 25, 2025

Conversation

erkki-silvola
Copy link
Contributor

…acos

@kevinmehall
Copy link
Owner

Hmm, I assume this is because you're not getting the "USB Serial Number" and "USB Product Name" properties? What macOS version and CPU do you have? This is similar to #37, but in his case, it was only missing "USB Interface Name" and for the device strings both properties were present. Could you post your ioreg -p IOUSB -l for reference?

@kevinmehall
Copy link
Owner

We should probably do this for "kUSBVendorString" / "USB Vendor Name" too just in case, even if Apple hasn't removed "USB Vendor Name" yet.

@erkki-silvola
Copy link
Contributor Author

erkki-silvola commented Jan 24, 2025

Hmm, I assume this is because you're not getting the "USB Serial Number" and "USB Product Name" properties? What macOS version and CPU do you have? This is similar to #37, but in his case, it was only missing "USB Interface Name" and for the device strings both properties were present. Could you post your ioreg -p IOUSB -l for reference?

this is mostly related to how apple formats kUSBProductString vs 'USB Product name' on arm Mac(M1 14.4)

"sessionID" = 8094249962374
| "USBSpeed" = 1
| "idProduct" = 4177
| "iManufacturer" = 1
| "bDeviceClass" = 239
| "IOPowerManagement" = {"PowerOverrideOn"=Yes,"DevicePowerState"=2,"CurrentPowerState"=2,"CapabilityFlags"=32768,$
| "bcdDevice" = 256
| "bMaxPacketSize0" = 64
| "iProduct" = 2
| "iSerialNumber" = 3
| "bNumConfigurations" = 1
| "UsbDeviceSignature" = <661351100001303031303530303831343234ef02010202010a0000ffffff080650>
| "USB Product Name" = "J_Link"
| "locationID" = 1048576
| "bDeviceSubClass" = 2
| "bcdUSB" = 512
| "kUSBSerialNumberString" = "001050081424"
| "USB Address" = 1
| "IOCFPlugInTypes" = {"9dc7b780-9ec0-11d4-a54f-000a27052861"="IOUSBHostFamily.kext/Contents/PlugIns/IOUSBLib.bund$
| "kUSBCurrentConfiguration" = 1
| "bDeviceProtocol" = 1
| "USBPortType" = 0
| "IOServiceDEXTEntitlements" = (("com.apple.developer.driverkit.transport.usb"))
| "USB Vendor Name" = "SEGGER"
| "Device Speed" = 1
| "idVendor" = 4966
| "kUSBProductString" = "J-Link"
| "USB Serial Number" = "001050081424"
| "IOGeneralInterest" = "IOCommand is not serializable"
| "kUSBAddress" = 1
| "kUSBVendorString" = "SEGGER"

Also the k... ones should be the primary AFAIK as they are defined in iokit

@erkki-silvola
Copy link
Contributor Author

We should probably do this for "kUSBVendorString" / "USB Vendor Name" too just in case, even if Apple hasn't removed "USB Vendor Name" yet.

yes, like commented in previous

@erkki-silvola
Copy link
Contributor Author

Hmm, I assume this is because you're not getting the "USB Serial Number" and "USB Product Name" properties? What macOS version and CPU do you have? This is similar to #37, but in his case, it was only missing "USB Interface Name" and for the device strings both properties were present. Could you post your ioreg -p IOUSB -l for reference?

Yes, similar, though some general idea for later as apple defines these strings like with interface, could use those later on like

#define kUSBHostInterfacePropertyString "kUSBString"

@kevinmehall kevinmehall merged commit ae59ebf into kevinmehall:main Jan 25, 2025
8 checks passed
@kevinmehall
Copy link
Owner

Thanks!

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.

2 participants