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

GetSerialNumber on Mac throws an exception... #23

Open
jbizios opened this issue Jun 7, 2023 · 0 comments
Open

GetSerialNumber on Mac throws an exception... #23

jbizios opened this issue Jun 7, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@jbizios
Copy link

jbizios commented Jun 7, 2023

Hi all - Reported this on the James' support forum few years back but never got any resolution, so I thought I'd try again here as well.

The following code hitting a specific vendor's UPS devices:

var devices = DeviceList.Local.GetHidDevices(4271).ToList();
var serialNumber = devices[0].GetSerialNumber();

Throws a DeviceIoException ("Serial Number Not Found") on MacOS, but works fine on Windows and Linux using the same device.

I built the latest source locally on the Mac to try and step through it, but didn't get very far. The call:

d._serialNumber = NativeMethods.IORegistryEntryGetCFProperty_String(service, NativeMethods.kIOHIDSerialNumberKey)

returns NULL.

Is this a known issue? Are there any suggested work arounds?

Thanks in advance!

@benedekkupper benedekkupper added the bug Something isn't working label Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants