aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-06-18 07:53:51 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-06-18 07:53:51 +0000
commite338cb6f329d6bf948abad88637f81436ee90daf (patch)
tree8363f304c09248929a65f9c3e029340d1dc960b1 /Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
parent2b21a1552d1a5b107120f4ac2e9ac357c999cc34 (diff)
downloadlufa-e338cb6f329d6bf948abad88637f81436ee90daf.tar.gz
lufa-e338cb6f329d6bf948abad88637f81436ee90daf.tar.bz2
lufa-e338cb6f329d6bf948abad88637f81436ee90daf.zip
Added new USB_Host_ClearPipeStall() convenience function to clear a stall condition on an attached device's endpoint.
Added new USB_Host_GetDeviceDescriptor() convenience function to retrieve the attached device's Device descriptor. Make Pipe_ConfigurePipe() mask the given endpoint number against PIPE_EPNUM_MASK to ensure the endpoint IN direction bit is cleared to prevent endpoint type corruption. Fix documentation mentioning Pipe_GetCurrentToken() function when real name is Pipe_GetPipeToken().
Diffstat (limited to 'Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c')
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
index b7d49f609..1aaa8141e 100644
--- a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
+++ b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
@@ -144,22 +144,12 @@ void Bluetooth_Management_Task(void)
}
puts_P(PSTR("Bluetooth Dongle Detected.\r\n"));
-
- /* Standard request to set the device configuration to configuration 1 */
- USB_ControlRequest = (USB_Request_Header_t)
- {
- bmRequestType: (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE),
- bRequest: REQ_SetConfiguration,
- wValue: 1,
- wIndex: 0,
- wLength: 0,
- };
/* Select the control pipe for the request transfer */
Pipe_SelectPipe(PIPE_CONTROLPIPE);
- /* Send the request, display error and wait for device detatch if request fails */
- if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
+ /* Set the device configuration to the first configuration (rarely do devices use multiple configurations) */
+ if ((ErrorCode = USB_Host_SetDeviceConfiguration(1)) != HOST_SENDCONTROL_Successful)
{
puts_P(PSTR("Control Error (Set Configuration).\r\n"));
printf_P(PSTR(" -- Error Code: %d\r\n"), ErrorCode);