Am 05.02.2013 15:24, schrieb Kustaa Nyholm:
>> 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.

> The main difficulty is that with USB you always need a driver.

That exactly is the Problem.

I Do firmware and I will not do Windows Driver Development. So right my
options are:
1.) Don't use USB.
I either have a RS232 port on the device and connect to the Serial port
of a PC. As the serial Ports are now getting rare I can alternatively
put an FTDI USB-Serial Chip on the Board. With Rxtx I'm fine on Linux,
Mac and Windows.

2.) Use an USB as CDC ACM.
This is basically the same as 1 with the FTDI replaced by Software. On
Windows I will still need the MS_is_stupid.inf file, but that can be put
on a faked mass storage making my device a composite device.

Both solutions have two problems:
1.) inflexible.
I can only do serial communication. So no events, only one channel not
independent channels.

2.) complicated for user.
The user has to figure out which serial port Identifier(com1, com5,
/dev/ttyUSBACM0 or /dev/ttyS0) has been assigned by the OS to the Device
and give that to my PC Software.

So the better solution would be to really use USB. On the Firmware I
would put a VID:PID in and the device Name in the descriptors and would
also describe the Endpoints I use but would declare them as Vendor
defined format.
This sames me software effort in the firmware for the CDC Report
Descriptors and stuff. And it would also give me the flexibility to use
all the extra features of USB.
On the PC side I would need a single library that does not need to be
installed(and the PC rebooted) but just works and lets me check if my
device is attached and if it is attached talk to it.

>> 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.

I don't think that it is that easy. On Linux this pretty much works
IIRC. But if the Windows Side needs a driver to be installed then this
would put me back in the position to write a Windows Driver and I will
not do that. I then would prefer to live with the limitations of CDC ACM
and Rxtx.

So the question is if it is possible to create a single jar file that
includes everything needed to provide the libusbx API to a Java program
and let it speak to USB Devices on Linux, Windows and Mac without a
Driver installed ?

If the answer is no then forget this discussion. If the answer is yes
then lets do it ! (Or give me the link if this already exists)

Regards,

Lars

------------------------------------------------------------------------------
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

Reply via email to