From 488f8c84b61068921cce40dbaf4bfab90b63bcfa Mon Sep 17 00:00:00 2001 From: schlaepfer Date: Wed, 9 Aug 2006 13:51:18 +0000 Subject: [PATCH] - show some values as hex and decimal numbers git-svn-id: https://svn.code.sf.net/p/libusbjava/code/trunk@157 94ad28fe-ef68-46b1-9651-e7ae4fcf1c4c --- java/src/ch/ntb/usb/usbView/UsbTreeModel.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/java/src/ch/ntb/usb/usbView/UsbTreeModel.java b/java/src/ch/ntb/usb/usbView/UsbTreeModel.java index 09372f8..806aee0 100644 --- a/java/src/ch/ntb/usb/usbView/UsbTreeModel.java +++ b/java/src/ch/ntb/usb/usbView/UsbTreeModel.java @@ -174,15 +174,19 @@ public class UsbTreeModel implements TreeModel, TreeSelectionListener { + "\n"); sb.append("\tbDescriptorType: 0x" + Integer.toHexString(devDesc.bDescriptorType) + "\n"); - sb.append("\tbcdUSB: 0x" + Integer.toHexString(devDesc.bcdUSB) - + "\n"); + sb.append("\tbcdUSB: 0x" + + Integer.toHexString(devDesc.bcdUSB & 0xFFFF) + "\n"); sb.append("\tbDeviceClass: 0x" - + Integer.toHexString(devDesc.bDeviceClass) + "\n"); + + Integer.toHexString(devDesc.bDeviceClass & 0xFF) + "\n"); sb.append("\tbDeviceSubClass: 0x" - + Integer.toHexString(devDesc.bDeviceSubClass) + "\n"); + + Integer.toHexString(devDesc.bDeviceSubClass & 0xFF) + + "\n"); sb.append("\tbDeviceProtocol: 0x" - + Integer.toHexString(devDesc.bDeviceProtocol) + "\n"); - sb.append("\tbMaxPacketSize0: " + devDesc.bMaxPacketSize0 + "\n"); + + Integer.toHexString(devDesc.bDeviceProtocol & 0xFF) + + "\n"); + sb.append("\tbMaxPacketSize0: 0x" + + Integer.toHexString(devDesc.bMaxPacketSize0 & 0xFF) + + " (" + devDesc.bMaxPacketSize0 + ")\n"); sb.append("\tidVendor: 0x" + Integer.toHexString(devDesc.idVendor & 0xFFFF) + "\n"); sb.append("\tidProduct: 0x" @@ -263,7 +267,8 @@ public class UsbTreeModel implements TreeModel, TreeSelectionListener { sb.append("\tbmAttributes: 0x" + Integer.toHexString(confDesc.bmAttributes & 0xFF) + "\n"); sb.append("\tMaxPower [mA]: 0x" - + Integer.toHexString(confDesc.MaxPower) + "\n"); + + Integer.toHexString(confDesc.MaxPower & 0xFF) + " (" + + confDesc.MaxPower + ")\n"); sb.append("\textralen: 0x" + Integer.toHexString(confDesc.extralen) + "\n"); sb.append("\textra: " + confDesc.extra + "\n"); @@ -383,7 +388,8 @@ public class UsbTreeModel implements TreeModel, TreeSelectionListener { sb.append("\tbmAttributes: 0x" + Integer.toHexString(epDesc.bmAttributes & 0xFF) + "\n"); sb.append("\twMaxPacketSize: 0x" - + Integer.toHexString(epDesc.wMaxPacketSize) + "\n"); + + Integer.toHexString(epDesc.wMaxPacketSize & 0xFFFF) + " (" + + epDesc.wMaxPacketSize + ")\n"); sb.append("\tbInterval: 0x" + Integer.toHexString(epDesc.bInterval) + "\n"); sb.append("\tbRefresh: 0x" + Integer.toHexString(epDesc.bRefresh)