Usb4java and Windows 7 64 bit OS I get USB error 8 or 12

2.6k views Asked by At

I am trying to get usb4java package to work. I get the basic connection, but when I try to get the product, Serial Number, or Manufacturer, I get USB error 12 or 8. I think I may have the libraries messed up.

I am using Win 7 Pro 64 bit OS Service Pack 1. Eclipse Version: Luna Service Release 2 (4.4.2) Build id: 20150219-0600.
The following are the libraries I have:

Libraries Referenced:

The Code:

` import java.io.; import java.util.; import javax.usb.*;

public class PrettyUSBDeviceLister 
{
    public static void main(String[] args) throws UnsupportedEncodingException,  UsbException
    {
        UsbServices services = UsbHostManager.getUsbServices();
        UsbHub root = services.getRootUsbHub();
        System.out.println(" USB Root Hub: ");
        listDevices(root);
    } // main

    public static void listDevices(UsbHub hub) 

    {
        String prod = "";
        String sn   = "";
        String man  = "";

        List<UsbDevice> devices = hub.getAttachedUsbDevices();
    Iterator<UsbDevice> iterator = devices.iterator();
        while ( iterator.hasNext())
        {
            UsbDevice device = iterator.next();

        if((device.isUsbHub())) 
            {
            System.out.println("HUB: ");
                listDevices((UsbHub)device);            
            }

            try {
                prod = device.getProductString();
            } catch (UnsupportedEncodingException e) {
                prod = "UEE";
            } catch (UsbException e) {
                String ts = e.getLocalizedMessage();
                System.out.println(" USB e L msg = "+ts);
                prod = "UsbException\n " + e.toString();
            } catch (UsbDisconnectedException e) {
                prod = "USBdis";
            }

            System.out.println("Product : "+prod);

            try {
                sn = device.getSerialNumberString();
            --similar to the above--
            }

            System.out.println("Serial #: "+sn);

            try {
                man = device.getManufacturerString();
            --similar to the above--
            }

            System.out.println("Manufact: "+man);
            System.out.println();
        }
        System.out.println(" ... end Hub ....");
    } // static void listdevices(UsbHub root)
} // class PrettyUSBDeviceLister 

` I have include one of eacn of the errors below. I get error 8, 13, or NULL for all the calls to get the Product, Serial Number, or Manufacturer,

Program output:

USB Root Hub: 

USB e L msg = USB error 12: Can't open device Bus 008 Device 002: ID 1058:1078: Operation not supported or unimplemented on this platform Product : UsbException USB error 12 Serial #: UsbException USB error 12 javax.usb.UsbPlatformException: USB error 12: Can't open device Bus 008 Device 002: ID 1058:1078: Operation not supported or unimplemented on this platform at org.usb4java.javax.ExceptionUtils.createPlatformException(ExceptionUtils.java:39) at org.usb4java.javax.AbstractDevice.open(AbstractDevice.java:226) at org.usb4java.javax.AbstractDevice.getLanguages(AbstractDevice.java:538) at org.usb4java.javax.AbstractDevice.getUsbStringDescriptor(AbstractDevice.java:507) at org.usb4java.javax.AbstractDevice.getString(AbstractDevice.java:526) at org.usb4java.javax.AbstractDevice.getManufacturerString(AbstractDevice.java:304) at PrettyUSBDeviceLister.listDevices(PrettyUSBDeviceLister.java:65) at PrettyUSBDeviceLister.main(PrettyUSBDeviceLister.java:17) Manufact: UsbException USB error 12

USB e L msg = USB error 8: Unable to get string descriptor languages: Overflow Product : UsbException USB error 8: Serial #: null javax.usb.UsbPlatformException: USB error 8: Unable to get string descriptor languages: Overflow at org.usb4java.javax.ExceptionUtils.createPlatformException(ExceptionUtils.java:39) at org.usb4java.javax.AbstractDevice.getLanguages(AbstractDevice.java:544) at org.usb4java.javax.AbstractDevice.getUsbStringDescriptor(AbstractDevice.java:507) at org.usb4java.javax.AbstractDevice.getString(AbstractDevice.java:526) at org.usb4java.javax.AbstractDevice.getManufacturerString(AbstractDevice.java:304) at PrettyUSBDeviceLister.listDevices(PrettyUSBDeviceLister.java:65) at PrettyUSBDeviceLister.main(PrettyUSBDeviceLister.java:17) Manufact: UsbException USB error 8:

How can I avoid this and get the read data?
Thank you for your help Cliff

0

There are 0 answers