}\r
\r
Pipe_Read_Stream_LE(&HCIEventHeader, sizeof(HCIEventHeader));\r
- \r
Pipe_Freeze();\r
\r
return true;\r
static void Bluetooth_DiscardRemainingHCIEventParameters(void)\r
{\r
Pipe_SelectPipe(BLUETOOTH_EVENTS_PIPE);\r
- \r
Pipe_Unfreeze();\r
+\r
Pipe_Discard_Stream(HCIEventHeader.ParameterLength);\r
Pipe_ClearIN();\r
+\r
Pipe_Freeze();\r
+ \r
+ HCIEventHeader.ParameterLength = 0;\r
}\r
\r
void Bluetooth_ProcessHCICommands(void)\r
\r
Bluetooth_HCIProcessingState = Bluetooth_Conn_SendPINCode;\r
}\r
+ else if (HCIEventHeader.EventCode == EVENT_COMMAND_COMPLETE)\r
+ {\r
+ BT_DEBUG("(HCI) >> Command Complete", NULL);\r
+ }\r
\r
BT_DEBUG("(HCI) -- Unread Event Param Length: %d", HCIEventHeader.ParameterLength);\r
\r
sizeof(Bluetooth_DeviceConfiguration.PINCode));\r
\r
Bluetooth_SendHCICommand(&PINCodeRequestParams, sizeof(PINCodeRequestParams));\r
- \r
- do\r
- {\r
- while (!(Bluetooth_GetNextHCIEventHeader()))\r
- { \r
- if (USB_HostState == HOST_STATE_Unattached)\r
- return;\r
- }\r
-\r
- Bluetooth_DiscardRemainingHCIEventParameters();\r
- } while (HCIEventHeader.EventCode != EVENT_COMMAND_COMPLETE);\r
\r
Bluetooth_HCIProcessingState = Bluetooth_PrepareToProcessEvents;\r
break;\r