On 5.2.2013 15.35, "Lars Pötter" <l...@ing-poetter.de> wrote: > >> With JNA to access libusb it was pretty trivial. And now days there are >> a number of ready made implementations available. > >I tried to talk a colleague into libUsb. He was responsible for the PC >application and I was doing the firmware. But he said he tried it but it >was to complicated to set up on Windows. I did a short check and using >libusb on windows seems to be a real pain.
Hmm. I'm no expert on this because AFAIR I did not test this on Windows but surely it cannot be that difficult. The main difficulty is that with USB you always need a driver. In Windows driver installation is often painful and nowdays even more so for the developer as drivers need to be signed and maybe certified, I'm not up to speed with all that. But this applies to ANY USB device on Windows, libusb or not. If your device conforms to USB spec for one of the preinstalled Windows drivers, such as HID,CDC ACM, hard disk, video camera, (sorry I don't remember the right USB terms as I seldom need them), then you and your clients/users don't need to worry with the driver installation. Hence many people 'abuse' CDC ACM or HID for their own needs, me included. Recent Windows versions support some kind of generic driver called WinUSB which I think makes lot of the pain go away for a large class of devices. What libusb does is that it provides or works with a number of 'generic' drivers. Such as WinUSB from Microsoft and provides a platform agnostic API to the raw USB functionality. There are also a few Free generic USB drivers some of which have the signing and certification issue more or less solved. But rather than me, who knows very little specific details and who gets most details wrong, this discussion should be moved to libusb list, so I'm CC:n them, I trust you don't mind . I hang around there too. Please note also that there are (too) many libusb projects around. There is/was libusb 0.1 (still works but not maintained) There is libusb 1.0 project that has stalled for many years because of administrative friction , to put it nicely, and which was recently forked. The for is called libusbx and as far as I understand it is the preferred choice today if Windows support is required and if want to have RERO development. There is also a libusb-win32 which I think is libusb API compatible more or less and works on Windows only. But like I said, let's move this part of the discussion to libusbx (my favorite fork which I hope to become THE fork) so more knowledgable people can correct my miss information. > >That looks like a wrapper around the libUSB API. That's what it is. >Thats all that is >needed. But can that be put into a jar file with libusb for Windows Mac >Linux? That would be a very interesting jar file. I would help(as much >as I can) to make this jar file real. That should not be difficult, I've done something similar with JOGL so it should be doable. But maybe first look around what already exists. With JNA, my code and the libusbx API specs a compilable and testable prototype should be possible within a few hours and running too if you are lucky. Then use 'onejar' to package JNA,libusbx native code and the wrapper into one jar file. I guess the drivers and their installation cannot be packaged into the jar but need an installer or something, unless of course you can use the pre-installed driver. Yes, I agree a one jar libusbx Java library would be great, does not sound like too ambitious and while I don't have the time to actually code or test I'd be interested to help where I can. br Kusti ------------------------------------------------------------------------------ Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb _______________________________________________ libusbx-devel mailing list libusbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusbx-devel