X-Git-Url: http://git.linex4red.de/pub/lufa.git/blobdiff_plain/ac70ddd0a1c412bb54def48e53caaebd0b5c9c61..23f3c3deee8bd153d59f2ac4e659c71ee75915f7:/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c diff --git a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c index b7d49f609..b8e87cb60 100644 --- a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c +++ b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c @@ -50,7 +50,6 @@ int main(void) LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); - /* Startup message */ puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY "Bluetooth Host Demo running.\r\n" ESC_INVERSE_OFF)); @@ -111,6 +110,7 @@ void EVENT_USB_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode) { puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n")); printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode); + printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode); printf_P(PSTR(" -- In State %d\r\n"), USB_HostState); LEDs_SetAllLEDs(LEDMASK_USB_ERROR); @@ -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);