How to get a USB device's path like /dev/ttyACM0 or /dev/ttyUSB0 according to its idVedor and idProduct? The subsequent function needs this path instead of its idVendor and idProduct.
Notice: by C/C++ code, not by Command.
I am using Qt and CentOS.
How to get a USB device's path like /dev/ttyACM0 or /dev/ttyUSB0 according to its idVedor and idProduct? The subsequent function needs this path instead of its idVendor and idProduct.
Notice: by C/C++ code, not by Command.
I am using Qt and CentOS.
You can use libusbp, a USB abstraction library, to do that.  See the port_name example that comes with libusbp.  This will definitely work for USB CDC ACM devices (e.g. /dev/ttyACM0) but I'm not sure if it will work for devices that use a different driver.  If you try it, please post a comment here about whether it worked.