Giter VIP home page Giter VIP logo

Comments (1)

median1st avatar median1st commented on July 24, 2024

UPDATE:

The bug is not in the library, but in the user program. The method LibUSB.getDeviceList() returns the number of devices copied to the DeviceList, in my case fourteen devices - that's why I got result == 14. Changed the test to (result < 0) and now I'm getting the whole list without problems.
The constructor of LibUSBException changes the errorCode sign, which makes the exception message to appear as USB Error: -14. The negative number led me to a wrong conclusion that there had been an error.

Previous comment:
I can confirm this behavior on Fedora 33 (stock kernel 5.14.18-100.fc33.x86_64), OpenJDK Runtime Environment (build 1.8.0_312-b07), libusb version 1.0.24.11584, usb4java version 1.3.0 from Maven central. Even tried to compile the libusb4java.so from sources (successfully) and replace it within the classpath, but to no success. The error code returned by LibUSB.getDeviceList is -14 and the debugging output is

[ 0.004276] [001d0eff] libusb: debug [libusb_get_device_list]  
[ 0.004286] [001d0eff] libusb: debug [discovered_devs_append] need to increase capacity
Exception in thread "main" org.usb4java.LibUsbException: USB error -14: Other error

I succeeded to get the device list using the same libusb in a simple C program.

from usb4java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.