Skip to content

GetSerialNumber on Mac throws an exception... #23

@jbizios

Description

@jbizios

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions