LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   find USB device file (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/find-usb-device-file-4175564550/)

hardikgohil1988 01-20-2016 08:56 PM

find USB device file
 
I working on Embedded system board which have two USB interface ports one is OTG.

once I connect the devices to this interfaces device files are created which we can see it manually.

I want to know from the c application the device file belongs to which interface ?

eSelix 01-22-2016 12:23 PM

You need to search "/sys/bus/usb/devices" tree and find there "dev" file which contain values of major and minor numbers of your device. If you get back in tree to directory which contains "port" symlink it point to your USB port.


All times are GMT -5. The time now is 08:52 AM.