SWRA751 September 2022
Most of the HCI packets consist of command packets. The host sends these command packets according to the structure detailed in the tables below and the controller sends responses through event packets back to the host. Command packets are used to configure many aspects of the Bluetooth system ranging from the link layer to the baseband layer.
You can also refer to the Core 4.1 Specification Volume 2, Part E, for the format of these HCI packets.
After the first byte,the remaining bytes depends on what type of packet it is. Of these two packet types, the structure of the HCI command packet is:
First Last |
||
---|---|---|
16 bit Opcode | 8 bit Length | Parameters(0,1,3,...,N) |
Here is a description of the above HCI command packet structure:
Fields | Descriptions |
---|---|
Opcode | 16 bit unique Opcode for HCI command |
Length | Length of parameters in bytes |
Parameters | Specific parameters associated with each command |
Taking the command HCI_Read_BD_ADDR, this is an example of a command packet consisting of outgoing data to the controller:
Packet Type | Opcode | Opcode | Length |
---|---|---|---|
0x01 | 0x09 | 0x10 | 0x00 |
In this case, the length is zero so no parameters follows afterwards.