sb.append("\tnum_altsetting: 0x"
+ Integer.toHexString(int_.getNumAltsetting()) + "\n");
sb.append("\taltsetting: " + int_.getAltsetting() + "\n");
textArea.setText(sb.toString());
} else if (component instanceof Usb_Interface_Descriptor) {
Usb_Interface_Descriptor intDesc = (Usb_Interface_Descriptor) component;
StringBuffer sb = new StringBuffer("Usb_Interface_Descriptor\n");
sb.append("\tblenght: 0x"
+ Integer.toHexString(intDesc.getBLength() & 0xFF) + "\n");
sb.append("\tbDescriptorType: 0x"
+ Integer.toHexString(intDesc.getBDescriptorType() & 0xFF)
+ "\n");
sb.append("\tbInterfaceNumber: 0x"
+ Integer.toHexString(intDesc.getBInterfaceNumber() & 0xFF)
+ "\n");
sb.append("\tbAlternateSetting: 0x"
+ Integer.toHexString(intDesc.getBAlternateSetting() & 0xFF)
+ "\n");
sb.append("\tbNumEndpoints: 0x"
+ Integer.toHexString(intDesc.getBNumEndpoints() & 0xFF)
+ "\n");
sb.append("\tbInterfaceClass: 0x"
+ Integer.toHexString(intDesc.getBInterfaceClass() & 0xFF)
+ "\n");
sb.append("\tbInterfaceSubClass: 0x"
+ Integer.toHexString(intDesc.getBInterfaceSubClass() & 0xFF)
+ "\n");
sb.append("\tbInterfaceProtocol: 0x"
+ Integer.toHexString(intDesc.getBInterfaceProtocol() & 0xFF)
+ "\n");
sb.append("\tiInterface: 0x"
+ Integer.toHexString(intDesc.getIInterface()) + "\n");
sb.append("\textralen: 0x"
+ Integer.toHexString(intDesc.getExtralen()) + "\n");
sb.append("\textra: " + extraDescriptorToString(intDesc.getExtra())
+ "\n");
// get device handle to retrieve string descriptors
Usb_Bus bus = rootBus;
while (bus != null) {
Usb_Device dev = bus.getDevices();
while (dev != null) {
try {
long handle = LibusbJava1.libusb_open(dev);
Usb_Config_Descriptor[] confDescs = dev.getConfig();
for (int i = 0; i < confDescs.length; i++) {
Usb_Interface[] ints = confDescs[i].getInterface();
for (int j = 0; j < ints.length; j++) {
Usb_Interface_Descriptor[] tmpIntDescs = ints[j]
.getAltsetting();
for (int k = 0; k < ints.length; k++) {
if (i < tmpIntDescs.length
&& tmpIntDescs[i].equals(intDesc)
&& (intDesc.getIInterface() > 0)) {
sb.append("\nString descriptors\n");
try {
String interface_ = LibusbJava1
.libusb_get_string_descriptor_ascii(
handle,
intDesc.getIInterface(),
255);
if (interface_ == null)
interface_ = "unable to fetch interface string";
sb.append("\tiInterface: "
+ interface_ + "\n");