Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.


  Search this Thread
Old 01-20-2016, 09:56 PM   #1
Registered: Sep 2014
Posts: 63

Rep: Reputation: Disabled
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 ?
Old 01-22-2016, 01:23 PM   #2
Senior Member
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,279

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
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.
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] need help find my usb device in /dev gvaught Ubuntu 5 06-22-2010 06:01 PM
Telnet to usb device on interface usb0 (and find IP of device) chickenlinux Linux - Networking 4 10-18-2009 12:18 PM
[SOLVED] Cannot find USB device Undermind Slackware 4 10-08-2009 10:40 AM
mapping usb device to device file scerenon Linux - Hardware 12 07-20-2006 05:13 PM
Assign one USB-storage device to one device file Misel Linux - Hardware 1 08-28-2004 04:52 AM > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 05:48 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration