+ Bluetooth_State.NextHCIState = Bluetooth_Init_ReadBufferSize;\r
+ Bluetooth_State.CurrentHCIState = Bluetooth_ProcessEvents;\r
+ break;\r
+ case Bluetooth_Init_ReadBufferSize:\r
+ BT_HCI_DEBUG(1, "# Read Buffer Size");\r
+ \r
+ HCICommandHeader = (BT_HCICommand_Header_t)\r
+ {\r
+ OpCode: (OGF_CTRLR_INFORMATIONAL | OCF_CTRLR_INFORMATIONAL_READBUFFERSIZE),\r
+ ParameterLength: 0,\r
+ };\r
+\r
+ /* Send the command to read the bluetooth buffer size (mandatory before device sends any data) */\r
+ Bluetooth_SendHCICommand(&HCICommandHeader, NULL, 0);\r
+\r
+ Bluetooth_State.NextHCIState = Bluetooth_Init_GetBDADDR;\r
+ Bluetooth_State.CurrentHCIState = Bluetooth_ProcessEvents;\r
+ break;\r
+ case Bluetooth_Init_GetBDADDR:\r
+ BT_HCI_DEBUG(1, "# Get BDADDR");\r
+ \r
+ HCICommandHeader = (BT_HCICommand_Header_t)\r
+ {\r
+ OpCode: (OGF_CTRLR_INFORMATIONAL | OCF_CTRLR_INFORMATIONAL_READBDADDR),\r
+ ParameterLength: 0,\r
+ };\r
+\r
+ /* Send the command to retrieve the BDADDR of the inserted bluetooth dongle */\r
+ Bluetooth_SendHCICommand(&HCICommandHeader, NULL, 0);\r
+\r
+ Bluetooth_State.NextHCIState = Bluetooth_Init_SetLocalName;\r
+ Bluetooth_State.CurrentHCIState = Bluetooth_ProcessEvents;\r