Map /dev/bus/usb node to /sys node on Linux
- by Cody Brocious
I'm using libusb to find and access a USB device, but once I get the information I need from there, I need to map it to a /sys node. This could be to the actual USB bus it's on, the /sys/bus/usb-serial node (which is where I'm going to get eventually), or effectively anywhere else since I can walk the tree from there. I can get to a /dev/bus/usb node easily enough, but I'm a bit lost from there. What would be the best route to perform this mapping?
Alternatively, a way to get the /dev/ttyUSB device node for a /dev/bus/usb node would work as well, since it gets me the same result.