Hi Danny and Graham,
Thanks for replying.
I think I might not have explained myself clearly enough 😀
I would like to have a standard like JSR-80 that only contains specification, no implementation. It would contain classes or interfaces like `UsbDevice`, `Pipe`, etc.
Then, other projects could implement support for that spec for a specific platform. Usb4java (or similar) could be that project for Linux, using native libraries. Or perhaps it could be supported directly in the JVM. Google could support it on their Android platform. And so on. (It's a bit like for example the Jakarta JPA spec, which according to Wikipedia has multiple vendors / implementations.)
What you would end up with is 1 specification to which you can program, and a wide range of implementations that would "just work". In my case (configuring the USB piano) I could create 1 Java library for communicating with the device. Then I could have a desktop application and an Android application. On Windows the desktop application would use the Windows implementation for the JSR-80 (or similar) spec; on Linux it might use Usb4java. If Google would support the spec, then on Android I can re-use my Java library again.
To me it seems that JSR-80 was very much (or exactly) the spec I'm
talking about. I was wondering why it didn't take off? Did it have
shortcomings?
So to answer the questions:
- Is there additional features or capabilities that you thinking about?
No, Usb4java seems very complete. At least for what I want to do (just bulk transfers). It's just cross-platform support that I'd like to achieve.
- And then how is a pure Java USB library going to be faster than the underlying C libusb natives?
I don't think it would be faster. I did not meant to say I want a pure Java USB library. On platforms where libusb is available, the spec-in-question could be implemented as a wrapper around it. Just like Usb4java is now. (So Usb4java could be a candidate. But the ultimate goal would be to have support for the spec-in-question directly inside the JVMs. Then, no native libraries would have to be shipped with your application, and your application would run everywhere where the JVM runs.)
With kind regards,
Jurrie