PDA

View Full Version : USB communication



M. Bashir
29th January 2008, 02:20
Hi all,

My OS: Win32 (win xp)
I want to create a project for transfer files between two PCs by USB cable, so Can I do that by using Qt?

I did some researches about this matter,and I found QextSerialPort (http://sourceforge.net/projects/qextserialport/), but I'm not sure if it suitable for my project :confused:!

can you help me, please:crying:?

seveninches
29th January 2008, 02:56
My OS: Win32 (win xp)
I want to create a project for transfer files between two PCs by USB cable, so Can I do that by using Qt?


This is not possible unless you have a special cable (commonly called "USB link adapter"), which has USB devices in the middle. Although USB standard allows the same device to be both host controller and device at the same time, a USB controller on your PC does not support this feature. And if you have such cable, you do not need any project to transfer the files, since everything (including drivers) is on the provided CD.

Another problem is API; so far I haven't seen any single library to access USB portably from userspace (kernel drivers are outside the scope), thus no Qt class wrapped around it. Obviously QextSerialPort will not work with USB bus.

And yet another problem is that USB programming itself is not simple if you go deep enough. There are devices, device classes, descriptors, control descriptor, states, different types of transfers, etc. In short, this is not an easy task.