Changed the parameters and behaviour of the USB_GetDeviceConfigDescriptor() function so that it now performs size checks and data validations internally, to simplify user code.

This commit is contained in:
Dean Camera 2009-08-31 07:48:32 +00:00
parent 813e6f0318
commit 7fbb759287
19 changed files with 232 additions and 254 deletions

View file

@ -41,7 +41,8 @@ uint8_t ProcessDeviceDescriptor(void)
/* Validate returned data - ensure the returned data is a device descriptor */
if (DeviceDescriptor.Header.Type != DTYPE_Device)
return InvalidDeviceDataReturned;
/* Validate returned device Class, SubClass and Protocol values against the Bluetooth spec values */
if ((DeviceDescriptor.Class != BLUETOOTH_DEVICE_CLASS) ||
(DeviceDescriptor.SubClass != BLUETOOTH_DEVICE_SUBCLASS) ||
(DeviceDescriptor.Protocol != BLUETOOTH_DEVICE_PROTOCOL))