PDA

View Full Version : Is there any way to detect USB state?



Kode.Cooper
14th December 2009, 09:46
Hi, there, FYI.

Is there any way to dectect the USB state(insert/eject), I want to find such sample,
and it's most probably running under win32/unix/macos.

Thanks.

fullmetalcoder
14th December 2009, 11:05
Qt does not offer any way to do that. You'll have to rely on other libraries to achieve what you want (e.g libusb).

Kode.Cooper
14th December 2009, 11:20
Qt does not offer any way to do that. You'll have to rely on other libraries to achieve what you want (e.g libusb).

Thanks fullmetalcoder, but I found some Extended interface of QT,
such as QUsbStorageGadget, QUsbManager etc. for Embeded Linux,
Could we use these modules for our purpose?

lyuts
14th December 2009, 13:41
Where did you find those usb modules? Share the link, if you can.

squidge
14th December 2009, 14:46
QtExtended supports USB, but it's only for Embedded Linux, not Win32 or MacOS.

Kode.Cooper
15th December 2009, 01:34
Where did you find those usb modules? Share the link, if you can.

hi , lyuts, i found it in there:http://doc.trolltech.com/qtextended4.4/tut-usbgadgetprovider.html

BR.

Kode.Cooper
15th December 2009, 01:39
I'm subclassing the WinHost, and to receive the WM_DEVICECHANGE message to detect the state of USB. but on my XP machine, i can not receive the message. :(

for other platform, i want to use libusb.

Is there any other good suggestion? Thansk.