As we know that we can use the terminal to find the USB ports by commanding lsusb:
$ lsusb
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 5986:02d2 Acer, Inc
Bus 001 Device 005: ID 054c:0688 Sony Corp.
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 034: ID 13fe:4100 Kingston Technology Company Inc. Flash drive
Bus 003 Device 033: ID 2500:0020
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
I also went to the websites and had a lot of suggestions but they are kind of not working as the list which I expected above.
- Getting USB Device path from USB port
- https://unix.stackexchange.com/questions/61484/find-the-information-of-usb-devices-in-c
- https://askubuntu.com/questions/503928/missing-usb-h-file-what-is-it-where-do-i-get-it
- http://www.linux-usb.org/
- http://www.dreamincode.net/forums/topic/148707-introduction-to-using-libusb-10/
.... and so on.
I am trying to understand how to link USB input to the C++ but I am getting confuse and have no ideas with it.