HCI (Host Controller Interface)
The Bluetooth host and Bluetooth controller communicate with the help of the HCI. It contains drivers that abstract and transfer data between the Bluetooth host and the Bluetooth controller. These drivers implement communication between the Bluetooth host and the Bluetooth controller with a small set of functions that send and receive commands, data packets and events.
Communication between the host and the controller is done through HCI packets, of which there are four types. Command packet: These packets are generated from the host and are sent to the controller or Bluetooth adapter to control the adapter. They can be used to start a device enquiry, connect to a remote device, etc. Event packet: These packets are sent from the Bluetooth adapter to the host. These packets are sent whenever an event occurs such as sending information about a local Bluetooth adapter, connecting to a remote device, etc. ACL data packet: ACL data packets are encapsulated by the HCI layer and transport to the Bluetooth adapter; however, the HCI headers are removed and the bare ACL packet is transmitted over the air and re-wrapped after being received. Synchronous data packet: These packets are also encapsulated at the HCI layer and pass to the Bluetooth adapter. Then, after unwrapping the HCI header, they are sent out, but are also re-wrapped after being received.