- mcdp renamed to java

git-svn-id: https://svn.code.sf.net/p/libusbjava/code/trunk@144 94ad28fe-ef68-46b1-9651-e7ae4fcf1c4c
This commit is contained in:
schlaepfer
2006-05-05 08:43:29 +00:00
parent 1468369ac7
commit 86ac913d63
23 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
package ch.ntb.usb;
public class Utils {
public static void logUsb(Usb_Bus bus) {
while (bus != null) {
System.out.println(bus.toString());
Usb_Device dev = bus.devices;
while (dev != null) {
System.out.println("\t" + dev.toString());
// Usb_Device_Descriptor
Usb_Device_Descriptor defDesc = dev.descriptor;
System.out.println("\t" + defDesc.toString());
// Usb_Config_Descriptor
Usb_Config_Descriptor[] confDesc = dev.config;
for (int i = 0; i < confDesc.length; i++) {
System.out.println("\t" + confDesc[i].toString());
Usb_Interface[] int_ = confDesc[i].interface_;
if (int_ != null) {
for (int j = 0; j < int_.length; j++) {
System.out.println("\t" + int_[j].toString());
Usb_Interface_Descriptor[] intDesc = int_[j].altsetting;
if (intDesc != null) {
for (int k = 0; k < intDesc.length; k++) {
System.out.println("\t"
+ intDesc[k].toString());
Usb_Endpoint_Descriptor[] epDesc = intDesc[k].endpoint;
if (epDesc != null) {
for (int e = 0; e < epDesc.length; e++) {
System.out.println("\t"
+ epDesc[e].toString());
}
}
}
}
}
}
}
dev = dev.next;
}
bus = bus.next;
}
}
}