aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/Incomplete/BluetoothHost/DeviceDescriptor.c
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/Host/Incomplete/BluetoothHost/DeviceDescriptor.c')
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/DeviceDescriptor.c17
1 files changed, 15 insertions, 2 deletions
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;