- reset updated
- hex log instead of decimal git-svn-id: https://svn.code.sf.net/p/libusbjava/code/trunk@40 94ad28fe-ef68-46b1-9651-e7ae4fcf1c4c
This commit is contained in:
@@ -11,7 +11,7 @@ public class USB {
|
|||||||
|
|
||||||
private static final int TIMEOUT_ERROR_CODE = -116;
|
private static final int TIMEOUT_ERROR_CODE = -116;
|
||||||
|
|
||||||
private static final boolean DEBUG_ON = false;
|
private static final boolean DEBUG_ON = true;
|
||||||
|
|
||||||
private static Usb_Bus bus;
|
private static Usb_Bus bus;
|
||||||
|
|
||||||
@@ -84,8 +84,9 @@ public class USB {
|
|||||||
bus = bus.next;
|
bus = bus.next;
|
||||||
}
|
}
|
||||||
if (usb_dev_handle <= 0) {
|
if (usb_dev_handle <= 0) {
|
||||||
throw new USBException("UsbDevice with idVendor " + IdVendor
|
throw new USBException("UsbDevice with idVendor 0x"
|
||||||
+ " and idProduct " + IdProduct + " not found");
|
+ Integer.toHexString(IdVendor & 0xFFFF) + " and idProduct 0x"
|
||||||
|
+ Integer.toHexString(IdProduct & 0xFFFF) + " not found");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
claim_interface(usb_dev_handle, Configuration, Interface, Altinterface);
|
claim_interface(usb_dev_handle, Configuration, Interface, Altinterface);
|
||||||
@@ -107,11 +108,12 @@ public class USB {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void resetUsbDevie() throws USBException {
|
public static void resetUsbDevice() throws USBException {
|
||||||
if (LibusbWin.usb_reset(usb_dev_handle) < 0) {
|
if (LibusbWin.usb_reset(usb_dev_handle) < 0) {
|
||||||
throw new USBException("LibusbWin.usb_reset: "
|
throw new USBException("LibusbWin.usb_reset: "
|
||||||
+ LibusbWin.usb_strerror());
|
+ LibusbWin.usb_strerror());
|
||||||
}
|
}
|
||||||
|
usb_dev_handle = 0;
|
||||||
|
|
||||||
if (DEBUG_ON) {
|
if (DEBUG_ON) {
|
||||||
System.out.println("resetUsbDevie done");
|
System.out.println("resetUsbDevie done");
|
||||||
|
|||||||
Reference in New Issue
Block a user