-static uint8_t Bluetooth_SendHCICommand(void* Parameters, uint16_t ParameterLength)\r
-{\r
- /* Need to reserve the amount of bytes given in the header for the complete payload */\r
- uint8_t CommandBuffer[sizeof(HCICommandHeader) + HCICommandHeader.ParameterLength];\r
-\r
- USB_ControlRequest = (USB_Request_Header_t)\r
- {\r
- .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_DEVICE),\r
- .bRequest = 0,\r
- .wValue = 0,\r
- .wIndex = 0,\r
- .wLength = sizeof(CommandBuffer)\r
- };\r
-\r
- /* Copy over the HCI command header to the allocated buffer */\r
- memcpy(CommandBuffer, &HCICommandHeader, sizeof(HCICommandHeader));\r
- \r
- /* Zero out the parameter section of the response to ensure that any padding bytes do not expose private RAM contents */\r
- memset(&CommandBuffer[sizeof(HCICommandHeader)], 0x00, HCICommandHeader.ParameterLength);\r
-\r
- /* Copy over the command parameters (if any) to the command buffer - note, the number of actual source parameter bytes\r
- may differ to those in the header; any difference in length is filled with 0x00 padding bytes */\r
- memcpy(&CommandBuffer[sizeof(HCICommandHeader)], Parameters, ParameterLength);\r
- \r
- Pipe_SelectPipe(PIPE_CONTROLPIPE);\r
- return USB_Host_SendControlRequest(CommandBuffer);\r
-}\r
-\r
-void Bluetooth_ProcessHCICommands(void)\r