PDA

View Full Version : Vendor and Model Name from USB Devices



NoRulez
17th July 2009, 12:57
Hey @all,

is there a way to get the vendor name and the model of a printer?
If I connect a Printer via USB i see the vendor name and the model in the /var/log/messages. E.g.: Hewlett Packard LaserJet 1600C

Best Regards NoRulez

yogeshgokul
17th July 2009, 13:01
QPrinterInfo::availablePrinters ()

SunnySan
17th July 2009, 17:15
Is there similar command for USB key?

Thanks

NoRulez
17th July 2009, 18:42
Thanks, but what i must do for USB sticks, mouse, keyboard and so on?
The Printer was only an example. Maybe i can do so with QtDBus? And when, how?

Best Regards
NoRulez

wysota
17th July 2009, 20:34
You can detect some things through HAL or you can use the /sys/bus/usb/ interface. Of course there is also libusb and lsusb as an example of its use.

NoRulez
20th July 2009, 06:14
How can I use QtDBUS and HAL or /sys/bus/usb/interface?

I didn't found any examples of doing so.
Could you please provide me a minimal example on how to do this?
I've never worked with QtDBus before.

Thanks in advance

Best Regards
NoRulez

wysota
20th July 2009, 09:01
How can I use QtDBUS and HAL
I don't understand the question. What do you mean "how"?

or /sys/bus/usb/interface?
This is an artificial filesystem tree containing (beside other things) information reported by usb devices (like the device name, vendor, etc.).


I didn't found any examples of doing so.
You probably looked in the wrong place. Did you look here?
http://www.freedesktop.org/wiki/Software/hal


Could you please provide me a minimal example on how to do this?
No, I can't, I don't have time to dig into the structure of HAL.

I've never worked with QtDBus before.

Even the longest journey begins with the single first step. Using dbus is simple, just try the examples.