X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/d4ca7fb44c7d326b96cf391f0275dc323dbe24de..fa1a092901319b3b41bf09e0c4cb9cbbec470d6b:/Demos/Host/Incomplete/BluetoothHost/DeviceDescriptor.c diff --git a/Demos/Host/Incomplete/BluetoothHost/DeviceDescriptor.c b/Demos/Host/Incomplete/BluetoothHost/DeviceDescriptor.c index 2138c17b1..65d5b3311 100644 --- a/Demos/Host/Incomplete/BluetoothHost/DeviceDescriptor.c +++ b/Demos/Host/Incomplete/BluetoothHost/DeviceDescriptor.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2009. + Copyright (C) Dean Camera, 2010. dean [at] fourwalledcubicle [dot] com www.fourwalledcubicle.com */ /* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -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;