X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/a2e6d54336144f7fa3cc1d77f887cc9e20631771..fd96b288824caaa3ee4e5e03887f016de9df80cf:/Demos/Host/Incomplete/BluetoothHost/DeviceDescriptor.c?ds=inline diff --git a/Demos/Host/Incomplete/BluetoothHost/DeviceDescriptor.c b/Demos/Host/Incomplete/BluetoothHost/DeviceDescriptor.c index 877684013..65d5b3311 100644 --- a/Demos/Host/Incomplete/BluetoothHost/DeviceDescriptor.c +++ b/Demos/Host/Incomplete/BluetoothHost/DeviceDescriptor.c @@ -28,15 +28,28 @@ this software. */ +/** \file + * + * USB Device Descriptor processing routines, to determine the overall device parameters. Descriptors are special + * computer-readable structures which the host requests upon device enumeration, to determine information about + * the attached device. + */ + #include "DeviceDescriptor.h" +/** Reads and processes an attached device's Device Descriptor, to determine compatibility + * + * This routine checks to ensure that the attached device's class codes match those for Bluetooth devices. + * + * \return An error code from the \ref BluetoothHost_GetDeviceDescriptorDataCodes_t enum. + */ uint8_t ProcessDeviceDescriptor(void) { USB_Descriptor_Device_t DeviceDescriptor; /* Send the request to retrieve the device descriptor */ if (USB_Host_GetDeviceDescriptor(&DeviceDescriptor) != HOST_SENDCONTROL_Successful) - return ControlErrorDuringDeviceRead; + return DevControlError; /* Validate returned data - ensure the returned data is a device descriptor */ if (DeviceDescriptor.Header.Type != DTYPE_Device) @@ -47,7 +60,7 @@ uint8_t ProcessDeviceDescriptor(void) (DeviceDescriptor.SubClass != BLUETOOTH_DEVICE_SUBCLASS) || (DeviceDescriptor.Protocol != BLUETOOTH_DEVICE_PROTOCOL)) { - return IncorrectDevice; + return IncorrectBTDevice; } return SuccessfulDeviceRead;