LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 01-20-2016, 08:56 PM   #1
hardikgohil1988
Member
 
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, 12:23 PM   #2
eSelix
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.
  


Reply


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 05:01 PM
Telnet to usb device on interface usb0 (and find IP of device) chickenlinux Linux - Networking 4 10-18-2009 11:18 AM
[SOLVED] Cannot find USB device Undermind Slackware 4 10-08-2009 09:40 AM
mapping usb device to device file scerenon Linux - Hardware 12 07-20-2006 04:13 PM
Assign one USB-storage device to one device file Misel Linux - Hardware 1 08-28-2004 03:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 01:04 AM.

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