π‘ Free Bluetooth Development Course Β· EmbeddedPathashala
Bluetooth development in cΒ Bluetooth Architecture
Understand how Bluetooth is structured β layers, host, controller, HCI, and profiles β all explained simply.
Welcome!
Hello, students! Welcome to this free Bluetooth development course by EmbeddedPathashala, your go-to resource for embedded systems education.
In this lecture we will explore the Bluetooth architecture β what are different layers in bluetooth architecture, what each layer in bluetooth architecture does, and howΒ all layers in bluetooth architeture work together. By the end of this page you will have a clearΒ picture of how Bluetooth is organized inside any device you use every day.
Think of Bluetooth architecture like a building with floors. The ground floor handles the raw radio signals, the middle floors handle how data is packaged and sent, and the top floors are where your apps live. Each floor depends on the one below it. Let’s walk through them one by one!
π Key Terms in This Lecture
1. The Big Picture β Bluetooth Layers
Bluetooth does not work as a single block of code. It is split into several well-defined layers, each responsible for a specific job. At a broad level there are four main pieces: the Controller, the Host (Upper Layers), the Profiles, and the Applications.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β YOUR APPLICATION β β e.g. File Transfer App, Music Player, Find My Device β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ β PROFILES β β GAP Β· A2DP Β· OPP Β· FTP Β· HFP Β· HID Β· AVRCP Β· ... β β (define HOW protocol layers work together for a use-case) β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ β HOST (Upper Layers) β β L2CAP Β· RFCOMM Β· SDP Β· AVDTP Β· AVCTP Β· ... β β (complex features: serial emulation, data chunking β¦) β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ βββ β HCI (Host Controller Interface) β β β UART / USB / SDIO / RS232 β defined by BT Spec β βββ Bridge βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ βββ β CONTROLLER (Lower Layers) β β Baseband Β· Link Manager Β· LE Link Layer Β· Radio β β (lives inside the Bluetooth chip β handles raw radio communication) β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Fig 1. High-Level Bluetooth Architecture β four main pieces stacked on top of each other.
The controller is the low-level workhorse of Bluetooth. It is physically embedded inside the Bluetooth chip (also called a Bluetooth SoC β System on Chip). Everything that requires direct contact with radio signals happens here.
Its responsibilities include:
- Device discovery β scanning the area for nearby Bluetooth devices.
- Establishing connections β setting up a communication link with another device.
- Exchanging data packets β sending and receiving raw data over the air.
- Security β encryption and authentication at the hardware level.
- Low-power modes β putting the radio to sleep when idle to save battery.
The host runs on the application processor β the main CPU of your phone, PC, or microcontroller. It uses the basic services provided by the controller to offer higher-level, more complex features.
Examples of what the host does:
- Serial port emulation β making Bluetooth look like a good old serial cable (RFCOMM).
- Transferring large chunks of data β breaking big data into small packets (segmentation) and reassembling them at the other end.
- Audio streaming β sending high-quality music wirelessly to your earphones (AVDTP is used for this).
Profiles sit on top of the protocol stack. They are not protocols themselves β they are guidelines that describe how multiple protocol layers should work together to implement a specific use-case.
Think of a profile like a recipe. A recipe does not invent new ingredients; it just tells you which existing ingredients to use, in what order, and in what quantities to bake a specific cake. A Bluetooth profile says: “To implement wireless audio, use these protocols in this sequence.”
Bluetooth SIG (the organization that owns the Bluetooth standard) requires that devices from different manufacturers must work together seamlessly. Your laptop may have a Realtek Bluetooth chip, and your earphones may use a MediaTek chip β yet they connect perfectly. That is because both follow the same profile specification.
Applications are the end-user facing software that you interact with directly. They use the functionality exposed by the profiles and protocol stack to do useful things.
Examples:
- Selecting a file and sending it over Bluetooth.
- Searching for nearby Bluetooth devices and showing a list on screen.
- A music app that streams audio to your earphones.
- A fitness app that reads heart rate data from a BLE sensor.
2. Protocol Classification β Core vs. Adopted
Bluetooth defines many protocols. These protocols are grouped into two categories depending on who wrote them:
BLUETOOTH PROTOCOLS β βββββββββββββββββ΄ββββββββββββββββ β β CORE PROTOCOLS ADOPTED PROTOCOLS (written from scratch (borrowed from other by Bluetooth SIG) standard bodies) β β ββββββββ΄βββββββ βββββββββ΄βββββββββ β L2CAP β β RFCOMM β β SDP β β (from ETSI) β β Link Mgr β ββββββββββββββββββ€ β RFCOMM* β β OBEX β β HCI β β (from IrDA) β βββββββββββββββ ββββββββββββββββββ€ β HID β β (from USB HID)β ββββββββββββββββββ
Fig 2. Bluetooth protocol family tree β core protocols on the left, adopted protocols on the right.
| Type | Who Wrote It? | Examples | Why It Exists |
|---|---|---|---|
| Core Protocols | Bluetooth SIG (designed from scratch) | L2CAP, Link Manager, SDP, HCI | Bluetooth-specific needs that no existing standard could meet. |
| Adopted Protocols | Other standards bodies (borrowed and adapted) | RFCOMM (from ETSI), OBEX (from IrDA), HID (from USB) | Re-use proven, well-understood specifications instead of reinventing the wheel. |
3. Key Terminology β Host, Controller, and HCI
You will hear these three terms constantly in Bluetooth development. Let’s define them clearly once and for all.
ββββββββββββββββββββββββββββββββββββββββββββ
β HOST SOFTWARE β
β β’ Runs on the application processor β
β (phone CPU, PC CPU, microcontroller) β
β β’ Contains: L2CAP, RFCOMM, SDP, AVDTP β¦ β
β β’ Contains: Profiles (GAP, A2DP, OPP β¦) β
β β’ Contains: Your Applications β
ββββββββββββββββ¬ββββββββββββββββββββββββββββ
β
ββββββββββββββββͺβββββββββββββββββββββββββββ
β HCI (Host Controller Interface)
β Physical link: UART / USB / SDIO / RS232
ββββββββββββββββͺβββββββββββββββββββββββββββ
β
ββββββββββββββββ΄ββββββββββββββββββββββββββββ
β CONTROLLER (Bluetooth Chip) β
β β’ Embedded in the Bluetooth SoC β
β β’ Contains: Baseband, Link Manager β
β β’ Contains: LE Link Layer, Radio β
β β’ Handles all raw radio operations β
ββββββββββββββββββββββββββββββββββββββββββββ
Fig 3. Host, HCI, and Controller β where each piece lives and how they connect.
The Host refers to all the upper layers of the Bluetooth stack β everything above the HCI line. This includes:
- Protocol layers: L2CAP, RFCOMM, SDP, AVDTP, AVCTP, and more.
- Profiles: GAP, A2DP, OPP, FTP, and so on.
- Your application software.
The host software runs on the main CPU of your device β not on the Bluetooth chip itself.
The Controller is the Bluetooth chip itself (the SoC). It executes all the lower layers of the stack β everything below the HCI line: the Radio, Baseband, and Link Manager. These are implemented in firmware burned into the Bluetooth chip by the chip manufacturer.
HCI is the communication channel between the host and the controller. It is a well-defined protocol β specified by the Bluetooth standard β that describes exactly which commands the host can send to the controller and what responses (events) the controller sends back.
HCI can run on top of several physical transports:
4. Real-World Scenarios
Now that you know what host, controller, and HCI mean, let’s see how they map to real devices you use every day. There are three classic scenarios.
π¦ Scenario 1 β PC + Bluetooth USB Dongle
βββββββββββββββ βββββββββββββββ β PC β β USB Dongle β β β USB β β β HOST βββββββΊβ CONTROLLER β β (Windows / β HCI β (BT chip β β Linux) β β inside) β βββββββββββββββ βββββββββββββββ
- Host: Bluetooth stack on the PC OS (e.g., BlueZ on Linux, Windows BT stack).
- Controller: The Bluetooth chip inside the USB dongle.
- HCI transport: USB interface.
π± Scenario 2 β Smartphone / Tablet
βββββββββββββββββββββββββββββββ β SMARTPHONE β β β β ββββββββββββββββββββββββ β β β Application CPU β β β β (HOST software) β β β ββββββββββββ¬ββββββββββββ β β β UART on PCB β β ββββββββββββ΄ββββββββββββ β β β Bluetooth SoC Chip β β β β (CONTROLLER) β β β ββββββββββββββββββββββββ β βββββββββββββββββββββββββββββββ
- Host: Bluetooth stack on the phone’s application processor (ARM CPU).
- Controller: A separate Bluetooth SoC chip on the phone’s PCB.
- HCI transport: UART connection on the PCB between the two chips.
π±οΈ Scenario 3 β Bluetooth Mouse / Headset
ββββββββββββββββββββββββββββββ β BLUETOOTH MOUSE β β β β ββββββββββββββββββββββββ β β β Single MCU β β β β β β β β HOST + CONTROLLER β β β β (both on same chip) β β β β β β β β No HCI needed β β β β ββββββββββββββββββββββββ β ββββββββββββββββββββββββββββββ
- Host + Controller: Both run on a single microcontroller β no separation.
- HCI: Not needed β upper layers call lower layers directly in the same firmware.
- This design is used in simple, cost-sensitive Bluetooth devices.
5. Single Controller vs. Dual Controller (Bluetooth 3.0+ HS)
Before Bluetooth 3.0, a device was only allowed to have one host and one controller. Bluetooth 3.0+ HS (High Speed) changed this rule.
Before Bluetooth 3.0 Bluetooth 3.0+ HS onwards ββββββββββββββββββββ βββββββββββββββββββββββββββββββββ β HOST β β HOST β ββββββββββ¬ββββββββββ ββββββββββββββββ¬βββββββββββββββββ β HCI β HCI ββββββββββ΄ββββββββββ ββββββββββββββββ΄βββββββββββββββββ β ONE CONTROLLER β β PRIMARY CONTROLLER β β (BR/EDR or LE β β (BR/EDR only, LE only, or β β or BR/EDR+LE) β β BR/EDR + LE combined) β ββββββββββββββββββββ βββββββββββββββββββββββββββββββββ€ β SECONDARY CONTROLLER(s) β β AMP (Alternate MAC/PHY) β β e.g. Wi-Fi chip for 24 Mbps β βββββββββββββββββββββββββββββββββ
Fig 4. Before and after Bluetooth 3.0 β multiple controllers became possible.
Primary Controller β the main Bluetooth controller. It can support:
- BR/EDR only β Classic Bluetooth (e.g., older headsets, file transfer).
- LE only β Bluetooth Low Energy (e.g., fitness trackers, beacons).
- BR/EDR + LE combined β most modern smartphones.
Secondary Controller (AMP) β stands for Alternate MAC/PHY. This is an additional controller (often a Wi-Fi chip) that can be used to boost Bluetooth throughput up to 24 Mbps β much faster than standard Bluetooth. This is why this version is called High Speed (HS).
π― Quick Summary
1Bluetooth has four broad layers: Controller β Host β Profiles β Applications, each layer depending on the one below it.
2Controller = the Bluetooth chip (SoC). Handles radio, baseband, link management β all the low-level stuff.
3Host = software on your main CPU (phone/PC). Provides complex features like serial emulation, audio streaming, etc.
4HCI = the well-defined bridge between host and controller. Runs over UART, USB, SDIO, or RS232. Not needed when both are on the same chip.
5Profiles ensure interoperability β devices from different manufacturers work together because they follow the same profile specification.
6Core protocols are written by Bluetooth SIG from scratch. Adopted protocols are borrowed from other standards (USB, IrDA, ETSI) to save effort.
7Bluetooth 3.0+ HS introduced secondary AMP controllers, enabling throughput up to 24 Mbps via Wi-Fi.
π What’s Next?
In the next lecture, we will learn about the Bluetooth Device Address and Device Name β what they are, how they are assigned, and how devices use them to discover and identify each other. Stay tuned!
Keep Learning β It’s 100% Free!
EmbeddedPathashala offers free, high-quality courses on Embedded Systems, Linux Kernel Programming, and Bluetooth/BLE development. No paywalls, ever.
