SWRA751 September 2022
After the packet type (0x04) denoting an Event packet, this is the format for HCI events that are returned by the BT controller to the host:
First Byte | Second Byte | Third Byte | N Byte |
---|---|---|---|
Event Code | Length | Param0 | ParamN |
There are many event packet types and each has a unique event code. The parameters for the command complete event (which has event code of 0x0E) is described as follows:
Param 0 (Byte 1) | Param 1 (Byte 2) | Param 1 (Byte 3) | Param 2 (Byte 4) |
---|---|---|---|
Num_HCI_Command_Packets | Command_Opcode (LSB) | Command_Opcode (MSB) | Return_Parameter(s) |
The Command Complete event is used by the Controller for most commands to transmit return status of a command and the other event parameters that are specified for the issued HCI command. The Num_HCI_Command_Packets parameter tells the number of HCI command packets which are allowed to be sent to the Controller from the Host.
This is an example of a returned event after the HCI_Read_BD_ADDR command is issued to the controller.
Packet Type | Event Packet Code | Length | Num of HCI Commands | Command_Opcode (LSB) | Command_Opcode (MSB) | Status |
BD_ADDR (LSB) |
BD_ADDR(MSB) | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
0x04 | 0x0E | 0x0A | 0x01 | 0x09 | 0x10 | 0x00 | 0x11 | 0xD1 | 0xF8 | 0xA5 | 0x0D | 0xBC |
So from this example, the event packet tells us the event was successful (Status is 0x00) and the BT Device Address is "BC:0D:A5:F8:D1:11"