+ /* set MaxPacketSize */
+
+ u8 address = usb_next_address();
+ ret = usb_set_address(dev, address);
+ dev->address = address;
+#ifdef _DU_CORE_ADD
+ printf("set address to %d\n", dev->address);
+#endif
+
+ ret = usb_get_desc_dev(dev);
+
+ char *man, *prod, *serial;
+ if(dev->iManufacturer) {
+ man = usb_get_string_simple(dev, dev->iManufacturer);
+ } else {
+ man = (char*) malloc(11);
+ memset(man, '\0', sizeof(man));
+ strlcpy(man, "no String", 10);
+ }
+ if(dev->iProduct) {
+ prod = usb_get_string_simple(dev, dev->iProduct);
+ } else {
+ prod = (char*) malloc(11);
+ memset(prod, '\0', sizeof(prod));
+ strlcpy(prod, "no String", 10);
+ }
+ if(dev->iSerialNumber) {
+ serial = usb_get_string_simple(dev, dev->iSerialNumber);
+ } else {
+ serial = (char*) malloc(11);
+ memset(serial, '\0', sizeof(serial));
+ strlcpy(serial, "no String", 10);
+ }
+
+ printf( "bLength 0x%02X\n"
+ "bDescriptorType 0x%02X\n"
+ "bcdUSB 0x%02X\n"
+ "bDeviceClass 0x%02X\n"
+ "bDeviceSubClass 0x%02X\n"
+ "bDeviceProtocoll 0x%02X\n"
+ "idVendor 0x%04X\n"
+ "idProduct 0x%04X\n"
+ "bcdDevice 0x%04X\n"
+ "iManufacturer(0x%02X): \"%s\"\n"
+ "iProduct(0x%02X): \"%s\"\n"
+ "iSerialNumber(0x%02X): \"%s\"\n"
+ "bNumConfigurations 0x%02X\n", dev->bLength, dev->bDeviceClass,
+ dev->bcdUSB, dev->bDescriptorType, dev->bDeviceSubClass,
+ dev->bDeviceProtocoll, dev->idVendor, dev->idProduct, dev->bcdDevice,
+ dev->iManufacturer, man,
+ dev->iProduct, prod,
+ dev->iSerialNumber, serial,
+ dev->bNumConfigurations);
+
+ /* in the most cases usb devices have just one configuration descriptor */
+ ret = usb_get_desc_config_ext(dev, 0);
+
+ /* select configuration */
+ ret = usb_set_configuration(dev, dev->conf->bConfigurationValue);
+ printf("=============\nusb_set_configuration(ret: %d) %d\n", ret, dev->conf->bConfigurationValue);