Re: Obtaining USB vendor/product ID in C language given a modem file path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2015-11-18 at 18:56 -0800, ToddA wrote:
> Hi,
> 
> If this isn't the correct mailing list for this question, do let me
> know 
> if there's a better one where I could ask.
> 
> I have a C language program that talks to modems and these days it is
> almost always a USB modem. For diagnostic purposes, I would like to
> be 
> able to pass the modem's file path and get back the vendor and
> product 
> ID info (at least), and if I could also get the vendor name, that
> would 
> be great. Portable code would be the best so I can compile it on
> Ubuntu, 
> Fedora, Raspbian, etc.
> 
> For example, given the modem is at /dev/ttyACM0 and lsusb gives:
> 
>       Bus 001 Device 004: ID 0572:1329 Conexant Systems (Rockwell),
> Inc.

cat /sys/class/tty/ttyACM0/device/../idVendor
cat /sys/class/tty/ttyACM0/device/../idProduct

Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux