From 1acb5202705f1cf80adf28c5d822195a898ec069 Mon Sep 17 00:00:00 2001 From: schlaepfer Date: Thu, 10 Nov 2005 07:33:46 +0000 Subject: [PATCH] - 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 --- mcdp/src/ch/ntb/usb/USB.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mcdp/src/ch/ntb/usb/USB.java b/mcdp/src/ch/ntb/usb/USB.java index bc1d8eb..c400c53 100644 --- a/mcdp/src/ch/ntb/usb/USB.java +++ b/mcdp/src/ch/ntb/usb/USB.java @@ -11,7 +11,7 @@ public class USB { 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; @@ -84,8 +84,9 @@ public class USB { bus = bus.next; } if (usb_dev_handle <= 0) { - throw new USBException("UsbDevice with idVendor " + IdVendor - + " and idProduct " + IdProduct + " not found"); + throw new USBException("UsbDevice with idVendor 0x" + + Integer.toHexString(IdVendor & 0xFFFF) + " and idProduct 0x" + + Integer.toHexString(IdProduct & 0xFFFF) + " not found"); } } 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) { throw new USBException("LibusbWin.usb_reset: " + LibusbWin.usb_strerror()); } + usb_dev_handle = 0; if (DEBUG_ON) { System.out.println("resetUsbDevie done");