- print extra descriptors as hex array
git-svn-id: https://svn.code.sf.net/p/libusbjava/code/trunk@244 94ad28fe-ef68-46b1-9651-e7ae4fcf1c4c
This commit is contained in:
@@ -309,7 +309,7 @@ public class UsbTreeModel implements TreeModel, TreeSelectionListener {
|
|||||||
+ confDesc.getMaxPower() + ")\n");
|
+ confDesc.getMaxPower() + ")\n");
|
||||||
sb.append("\textralen: 0x"
|
sb.append("\textralen: 0x"
|
||||||
+ Integer.toHexString(confDesc.getExtralen()) + "\n");
|
+ Integer.toHexString(confDesc.getExtralen()) + "\n");
|
||||||
sb.append("\textra: " + confDesc.getExtra() + "\n");
|
sb.append("\textra: " + extraDescriptorToString(confDesc.getExtra()) + "\n");
|
||||||
// get device handle to retrieve string descriptors
|
// get device handle to retrieve string descriptors
|
||||||
Usb_Bus bus = rootBus;
|
Usb_Bus bus = rootBus;
|
||||||
while (bus != null) {
|
while (bus != null) {
|
||||||
@@ -382,7 +382,7 @@ public class UsbTreeModel implements TreeModel, TreeSelectionListener {
|
|||||||
+ Integer.toHexString(intDesc.getIInterface()) + "\n");
|
+ Integer.toHexString(intDesc.getIInterface()) + "\n");
|
||||||
sb.append("\textralen: 0x"
|
sb.append("\textralen: 0x"
|
||||||
+ Integer.toHexString(intDesc.getExtralen()) + "\n");
|
+ Integer.toHexString(intDesc.getExtralen()) + "\n");
|
||||||
sb.append("\textra: " + intDesc.getExtra() + "\n");
|
sb.append("\textra: " + extraDescriptorToString(intDesc.getExtra()) + "\n");
|
||||||
// get device handle to retrieve string descriptors
|
// get device handle to retrieve string descriptors
|
||||||
Usb_Bus bus = rootBus;
|
Usb_Bus bus = rootBus;
|
||||||
while (bus != null) {
|
while (bus != null) {
|
||||||
@@ -446,8 +446,21 @@ public class UsbTreeModel implements TreeModel, TreeSelectionListener {
|
|||||||
+ Integer.toHexString(epDesc.getBSynchAddress()) + "\n");
|
+ Integer.toHexString(epDesc.getBSynchAddress()) + "\n");
|
||||||
sb.append("\textralen: 0x"
|
sb.append("\textralen: 0x"
|
||||||
+ Integer.toHexString(epDesc.getExtralen()) + "\n");
|
+ Integer.toHexString(epDesc.getExtralen()) + "\n");
|
||||||
sb.append("\textra: " + epDesc.getExtra() + "\n");
|
sb.append("\textra: " + extraDescriptorToString(epDesc.getExtra()) + "\n");
|
||||||
textArea.setText(sb.toString());
|
textArea.setText(sb.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String extraDescriptorToString(byte[] extra) {
|
||||||
|
if (extra != null) {
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
for (int i = 0; i < extra.length; i++) {
|
||||||
|
sb.append("0x");
|
||||||
|
sb.append(Integer.toHexString(extra[i] & 0xff));
|
||||||
|
sb.append(' ');
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -402,10 +402,8 @@ public class UsbView extends JFrame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void expandAll(JTree tree) {
|
void expandAll(JTree tree) {
|
||||||
int row = 0;
|
for (int row = 0; row < tree.getRowCount(); row++) {
|
||||||
while (row < tree.getRowCount()) {
|
|
||||||
tree.expandRow(row);
|
tree.expandRow(row);
|
||||||
row++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#Thu Aug 24 14:28:28 CEST 2006
|
#Thu Aug 24 14:28:28 CEST 2006
|
||||||
version.major=0
|
version.major=0
|
||||||
version.minor=5
|
version.minor=5
|
||||||
version.release=2
|
version.release=3
|
||||||
|
|||||||
Reference in New Issue
Block a user