Skip to content

MacOS: empty path for devices in long USB chain #236

Closed
@todbot

Description

Problem: Plug two 8-port USB hubs in a chain, add a HID device to second hub: hidapi returns empty string for path.

This was an old signal11 issue signal11/hidapi#301 and I think we still have it. Over in node-hid land (node-hid/node-hid#417), someone was experiencing this problem and had a good test showing both hidapitester and node-hid being able to get a path when the device is plugged in at one leaf of the USB tree but not at the other.

I think the issue happens at Line 464 of hidapi/mac/hid.c and I think it's because io_string_t is 512 characters and MacOS USB paths are already > 200 chars if you have just a single external USB hub.

I'm looking into finding definitions of io_string_t and IORegistryEntryGetPath() to see what our options are.

(The reason why I specify 8-port hubs above is those are implemented as two 4-port hubs, meaning the external USB tree look can look like: hub->hub->hub->hub->device, depending on where you plug what into what)

Metadata

Assignees

Labels

bugSomething isn't workingmacOSRelated to macOS backend

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions