Questions tagged [usb4java]

usb4java is a Java library to access USB devices.

usb4java is a Java library to access USB devices. It is based on the native libusb 1.0 library and uses Java NIO buffers for data exchange between libusb and Java. usb4java also supports the javax-usb standard (JSR-80) through the usb4java-javax extension.

Supported platforms are Linux (x86 32/64 bit, ARM 32 bit), OS X (x86 32/64 bit) and Windows (x86 32/64 bit). But other platforms may work as well (as long as they have at least Java 6 and are supported by libusb) by compiling the JNI library manually.

Source: http://usb4java.org/

69 questions
1
vote
1 answer

Usb4Java usage in Android

I want to use usb4java for my project. I'm giving dependencies for usb4java on gradle. I can import usb4java classes but when I want to run code on android device I'm getting "Native library not found in classpath:…
bzkrtmurat
  • 189
  • 1
  • 3
  • 15
1
vote
1 answer

usb4java on windows 10

I want to code a USB-Locker for any OS using usb4java. I can list all my devices, but if I want to use the HotPlug class made by Klaus Reimer I get the informaion: "libusb doesn't support hotplug on this system" Is there an alternitiv class, or an…
DodoProgramms
  • 11
  • 1
  • 7
1
vote
1 answer

usb4java Error while sending message: USB error 1: Control transfer failed: Input/Output Error

I try to send a message with the usb4java api to a ir read and write element with this code: public static void sendData(DeviceHandle handle, int timeout) { ByteBuffer buffer = ByteBuffer.allocateDirect(12); buffer.put(new byte[]{1, 2,…
1
vote
1 answer

Error overflow reading serial number of USB device

I'm trying to read the serial number of a device using javax usb library, and I'm getting this error : [javax.usb.UsbPlatformException: USB error 8: Unable to get string descriptor languages: Overflow] The line is simply : …
Romain
  • 151
  • 1
  • 12
1
vote
0 answers

Reading data from USB Barcode Scanner using Javax USB package

I'm trying to read data form a USB hand held barcode scanner using Javax package,and USB util in java. I'm able to detect the device,and able to read the barcode. However the result is a byte array which is in below format. It is showing one…
Siva Munipalli
  • 31
  • 1
  • 1
  • 5
1
vote
3 answers

Usb4java library, error while claiming an interface

Here I use the library usb4java to access to my usb device. The problem is I have an error while I try to claim an interface of my usb device. The error is on this line: int msg = LibUsb.claimInterface(deviceHandler, 1); error: USB error 3: Unable…
1
vote
1 answer

Device Handling in usb4java

I'm using libusb for communicating with usb device in java. My operating system is linux. But I have problem about open device. DeviceHandle handle = LibUsb.openDeviceWithVidPid(null, VENDOR_ID, PRODUCT_ID_1); if(handle == null){ …
bzkrtmurat
  • 189
  • 1
  • 3
  • 15
1
vote
0 answers

Linux, Java and USB

Kind of a followup to this question, I have been able to: Find the device for with which I am working, disconnect it from the kernel, and claim the (single) interface. . . and that's about as far as I can get. When I try to write to the device…
Will
  • 3,413
  • 7
  • 50
  • 107
1
vote
1 answer

Reading continuously incoming data (usb4java)

I have spent a considerable amount of time trying to figure out the best way of reading continuously a large amount of data using the Low-level functions of usb4java (Libusb). The amount of data I need to read is 640kbyte/s in a Full Speed device,…
Camilo Guevara
  • 165
  • 1
  • 12
1
vote
0 answers

Java: Get USB Mass Storage Device Information

is there a possibility to get USB mass storage information like the serial of an USB device in Java on Windows? I tried to achieve that with USB4Java (low and high-level API) and it works, but the problem is that I have to install a customized…
user3422749
  • 62
  • 1
  • 9
0
votes
0 answers

Why transfer callback is not called second time in same session in usb4java

I'm reading binary data from the device using usb4java asynchronous method . My application receives input from other application when client send start reading binary data 1st time everything works fine. What when the client sends stop and calling…
jasmi
  • 1
  • 3
0
votes
1 answer

Executing .jar file does not write a file every time... could it be a memory leak?

I am using this application to get a weight from a scale to be read into another application. long story short once the file exists, the other application reads it then deletes the file. If I try and run this multiple times in a row, it does not get…
0
votes
1 answer

file.listRoots not working for a portable USB drive in Java

file.listRoots() works fine for internal file drive information, but is not getting USB and portable file info. Here is my code: File[] paths; try { // returns pathnames for files and directory paths = File.listRoots(); for (File path :…
Harish Rawal
  • 226
  • 2
  • 15
0
votes
1 answer

how i get string path of device with usb4java?

I want to get the name or path of the USB disk for Linux, Windows and Mac using usb4java 1.3.0. Does anyone know how to get this path?
tyler
  • 13
  • 6
0
votes
1 answer

How to get button press event from camera

I've got a dental camera and iam try to get windows to press space when the camera button is pressed I have the OEM software and driver installed, it works perfect, gets the feed and makes a snapshot when camera button is pressed. I need to use…
Kirill.bpp
  • 13
  • 3