We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,everyone Does the report dexcriptor support negative value.i have checked the keil usb demo of hitex board,the report descriptor is declared as unsigned char. one more question,in the get_descriptor function, case USB_CONFIGURATION_DESCRIPTOR_TYPE: pD = (BYTE *)USB_ConfigDescriptor; for (n = 0; n != SetupPacket.wValue.WB.L; n++) { if (((USB_CONFIGURATION_DESCRIPTOR *)pD)->bLength != 0) { pD += ((USB_CONFIGURATION_DESCRIPTOR *)pD)->wTotalLength; } } what is the wValue.WB.L in the configDescriptor indicate?Why here use the wTotalLength.Thanks!
No, you are wrong. The original code is correct.
USB Manual says the following: bLength - Size of descriptor wTotalLength - Total length of data returned for this configuration. Includes the combined length of all descriptors (configuration, interface, endpoint, and class- or vendor-specific) returned for this configuration.
Since we scan through complete data for one configuration the wTotalLength is correct.