Java Usb communication Usb4Java (Low Api)

Click here, if you are looking for usb4java high level api

I’m recently developing an application that has to communicate with a POS thermal printer and after a long research and some trials decided best way would be to send commands through usb port. Unfortunately I don’t have a POS printer right now but I managed to claim a USB device (GamePad) with the help of Usb4Java

  • I’m posting their example code because seems to be confusing for some people at first (including me)
  • The code is briefly explained at their website Low Level Api
  • If your device cannot be claimed, install libusb’s own driver with Zadig
  • You will need to find the right end point to communicate, the easiest way is to pop a usb with ubuntu on it, then in terminal use “lsusb” command
  • This will give you a list of usb devices with their vendors and produkt numbers
  • Note the vendor and product number of device you want and use “lsusb -v -d vendor_nr:product_nr” to get your devices endpoint

Recent Posts