From: Xiaofan C. <xia...@gm...> - 2011-05-25 01:42:18
|
On Wed, May 25, 2011 at 5:47 AM, Mark Brooks <mb...@ic...> wrote: > Hi guys, > > Sorry about this question. It might be a little off scope here but lets > see.... > > I have a PIC controller design which is currently not HID and I control it > from Qt using libusb. So far so good. Keep this. > The product i think would be better as HID since then the user would not > need to install all the libusb driver etc. HID is good and bad. The general recommendation from the libusb side is that do not use HID for generic device when using libusb. http://www.libusb.org/wiki/FAQ#CanIcreateadriverlessdeviceusingHIDclass http://www.libusb.org/ticket/33 Originally the libusb-1.0 Windows backend has the HID backend and I was requesting an HID backend for Mac OS X, but due to the above strong opinions from the libusb-1.0 project admins, both ideas were shot down. > I can easily change my firmware > to HID on the PIC (there are examples) and I have done this and have got it > controlled from WinUSB using a Visual Studio GUI application. When I get to > using Qt then i am lost and can not seem to get it to connect to WinUSB > properly. There are issues about linking to the WinUSB DLLs that I get > confused over. This does not make sense. Why would you use WinUSB on HID device? > My ultimate goal is to have it work as HID on different Windows machines > (linux and MacOs would be a bonus) without requiring a driver to be > installed. Nearly plug and play if you like. Then you probably want to use HIDAPI and not libusb. Mac OS X is the problem here. You basically can not use libusb with HID device under Mac OS X with later version of Mac OS X since the old codeless kext does not seem to work any more. > Q1 I guess libusb can also control HID devices. If so, then what needs to > be installed on the machine beforehand. Is there an example one can follow? As of now, you need to use the filter driver if you want to use HID device with libusb-win32. > Q2 If I used libusb and HID how would it really be easier for the user than > what I have it now with using Libusb and a non-HID device. It makes things more difficult as of now since you need to install the filter driver under Windows. It also makes life under Mac OS X more difficult. > Q3 Does anyone know of an example of using Qt working properly with > WinUSB - I dont come across any examples over the web? As mentioned above, you do not want to use WinUSB for HID device. For generic USB device, libusb-win32 is actually better than WinUSB in many aspects, so you also may not want to use WinUSB. > Sorry once a gain for the rather vague questions but I am generally > wondering about the approach to take to make it EASY for the user. It must > be quite a normal consideration. If you keep using generic and libusb-win32, that is probably the easiest solution now. You can make the life easier for the user by writing a driver installer. libwdi can be useful here. Search the mailing list archive for answer about this question. If you really want to use HID for now, probably you may want to look at HIDAPI which is a nice library as well, not as mature as libusb though. http://www.signal11.us/oss/hidapi/ That being said, we probably would like to integrate HID support in the future for libusbk but it will probably take some time. -- Xiaofan |