Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UsbDeviceDescriptor.bDeviceClass() method not working on Linux #22

Open
philipp-michelfeit opened this issue Nov 30, 2024 · 0 comments
Open

Comments

@philipp-michelfeit
Copy link

UsbDeviceDescriptor.bDeviceClass() method not working !

Example code:

private String dumpName(final UsbDevice device)
            throws UnsupportedEncodingException, UsbException {
        // Read the string descriptor indices from the device descriptor.
        // If they are missing then ignore the device.
        final UsbDeviceDescriptor desc = device.getUsbDeviceDescriptor();
        final byte iManufacturer = desc.iManufacturer();
        final byte iProduct = desc.iProduct();
        final byte deviceClass = desc.bDeviceClass();
        
        if (iProduct == 0 && iManufacturer == 0) {
            return null;
        }

        // Dump the device name
        return device.getString(iManufacturer) + " " + device.getString(iProduct) + " (" + device.getString(deviceClass) + ")";
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant