In This Article
Every BR/EDR Bluetooth controller has a globally unique 48-bit Bluetooth address called the BD_ADDR (Bluetooth Device Address). This address helps identify the device on a Bluetooth network — similar to how a MAC address works in Ethernet.
The BD_ADDR is organized and assigned by the IEEE (Institute of Electrical and Electronics Engineers), just like Ethernet MAC addresses.
BD_ADDR Structure
The 48-bit BD_ADDR is split into two equal parts of 24 bits each:
Bit 47 Bit 0 ┌──────────────────────────────┬──────────────────────────────────┐ │ OUI — Company ID (24 bits) │ Company Assigned Address │ │ Assigned by IEEE │ (24 bits) — Assigned by vendor │ │ Most Significant Bits │ Least Significant Bits │ └──────────────────────────────┴──────────────────────────────────┘
| Field | Bits | Assigned By | Also Called |
|---|---|---|---|
| OUI (Company ID) | Bits 47–24 (MSB) | IEEE | Organizationally Unique Identifier |
| Device Address | Bits 23–0 (LSB) | Bluetooth chip manufacturer | Company-assigned portion |
Bluetooth Device Name
In addition to the BD_ADDR, every Bluetooth device also has a Bluetooth device name. Unlike the BD_ADDR, the device name is a friendly, human-readable name (for example: “John’s Phone” or “My Headset”).
Key points about the device name:
- It can be changed by the user at any time, unlike the fixed BD_ADDR.
- It helps users identify their device when multiple Bluetooth devices are visible nearby.
- It is sent during the Bluetooth discovery process so other devices can show it in a readable format.
The Class of Device (CoD) is a 24-bit value that a Bluetooth device broadcasts to tell nearby devices about its type and capabilities. Think of it as a small label the device wears that answers: “What kind of device am I, and what can I do?”
When you scan for Bluetooth devices, the CoD is returned as one of the parameters in the scan results — that is how your phone knows to show a headset icon instead of a phone icon when a headset is detected nearby.
CoD Bit Layout (24 Bits)
Bit 23 Bit 0 ┌────────────────────┬───────────────┬─────────────────┬─────────┐ │ Service Class │ Major Device │ Minor Device │ Reserved│ │ (11 bits) │ Class (5 bits)│ Class (6 bits) │ (2 bits)│ │ Bits 23–13 │ Bits 12–8 │ Bits 7–2 │ Bits 1–0│ └────────────────────┴───────────────┴─────────────────┴─────────┘
| Field | Bits | Size | Purpose |
|---|---|---|---|
| Service Class | 23 – 13 | 11 bits | What services the device supports (Audio, Telephony, File Transfer, etc.) |
| Major Device Class | 12 – 8 | 5 bits | Big category — Phone, Computer, Audio/Video, Peripheral, etc. |
| Minor Device Class | 7 – 2 | 6 bits | Specific type within major class — Laptop, Desktop, Headset, Speaker, etc. |
| Reserved | 1 – 0 | 2 bits | Always set to 00 — reserved for future use |
The Three Sections Explained
1. Major Device Class — The Big Category
This tells you the main type of device. For example:
Phone Computer Audio / Video Peripheral (Keyboard, Mouse) Imaging (Printer, Scanner) Networking Wearable Toy
2. Minor Device Class — The Exact Type
This provides more detail within the major class:
Computer → Laptop or Desktop Audio → Headset or Speaker Phone → Smartphone or Cordless
3. Service Class — What It Can Do
This tells you which services the device supports:
Audio Output Telephony File Transfer Networking Information
Real-World Example: Bluetooth Headset
┌─────────────────────────────────────────────────────────────────┐ │ Class of Device — Bluetooth Headset │ ├──────────────────┬──────────────────┬───────────────────────────┤ │ Major Class │ Minor Class │ Service Class │ │ Audio / Video │ Headset │ Audio + Telephony │ ├──────────────────┴──────────────────┴───────────────────────────┤ │ Result: Your phone recognizes the device as a Headset │ │ and shows the headset icon when it is connected. │ └─────────────────────────────────────────────────────────────────┘
Bluetooth in my laptop give below output
raviteja@raviteja-Inspiron-15-3511:~/Downloads/linux-6.19-rc5$ bluetoothctl show Controller 10:6F:D9:0D:0B:DA (public) Name: raviteja-Inspiron-15-3511 Alias: raviteja-Inspiron-15-3511 Class: 0x006c010c Powered: yes Discoverable: no DiscoverableTimeout: 0x000000b4 Pairable: no UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb) UUID: Handsfree Audio Gateway (0000111f-0000-1000-8000-00805f9b34fb) UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb) UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb) UUID: Headset (00001108-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb) UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb) UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb) UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb) UUID: Device Information (0000180a-0000-1000-8000-00805f9b34fb) Modalias: usb:v1D6Bp0246d0555 Discovering: no Roles: central Roles: peripheral Advertising Features: ActiveInstances: 0x00 (0) SupportedInstances: 0x05 (5) SupportedIncludes: tx-power SupportedIncludes: appearance SupportedIncludes: local-name SupportedCapabilities Key: MaxAdvLen SupportedCapabilities Value: 0x1f (31) SupportedCapabilities Key: MaxScnRspLen SupportedCapabilities Value: 0x1f (31) | Service Class (11 bits) | Major Class (5 bits) | Minor Class (6 bits) | Format (2 bits) | MAJOR DEVICE CLASS From 0x010c 👉 Major class = 0x01 ✔ 0x01 = Computer MINOR DEVICE CLASS From 0x010c 👉 Minor = 0x0C ✔ 0x0C = Laptop SERVICE CLASS From 0x006c0000 👉 0x6c = binary → 0110 1100 This means multiple services enabled: ✔ Networking ✔ Rendering ✔ Capturing ✔ Object Transfer
The Bluetooth clock is the native clock of a Bluetooth device. It is derived from the normal system clock running on the device. Every Bluetooth controller has its own independent clock that starts running as soon as the device is powered on.
Why Is the Bluetooth Clock Important?
Since Bluetooth devices need to communicate with each other in a time-synchronized way (for frequency hopping, slot timing, etc.), they need a common time reference. The problem is — each device starts its own clock independently, so the clock values will be different on each device.
Device A Device B
┌───────────────┐ ┌───────────────┐
│ Native Clock │ │ Native Clock │
│ value: X │ │ value: Y │
└───────┬───────┘ └───────┬───────┘
│ │
│ Exchange Clock Offset │
│◄──────── Offset = (X - Y) ────────►│
│ │
▼ ▼
┌─────────────────────────────────────────────────────┐
│ Synchronized Clock = Native Clock + Clock Offset │
│ Both devices now operate on the same time reference │
└─────────────────────────────────────────────────────┘
Instead of trying to match the absolute clock values (which is impossible since they start at different times), Bluetooth uses clock offset values for synchronization. When the offset is added to the native clock, both devices arrive at a mutually synchronized clock.
The term Protocol Data Unit (PDU) is commonly heard in Bluetooth development. A PDU is a small, formatted packet of data that Bluetooth uses to send and receive information between two devices.
Bluetooth is divided into layers (like a stack), and each layer adds its own header and defines how data should look before passing it to the next layer. The formatted unit of data at each layer is called a PDU.
Device A Device B ┌──────────────────────────┐ ┌──────────────────────────┐ │ Application Layer │ │ Application Layer │ ├──────────────────────────┤ ├──────────────────────────┤ │ L2CAP Layer │◄── L2CAP PDU ───►│ L2CAP Layer │ │ (Breaks data into chunks │ │ (Reassembles chunks, │ │ routes to channels) │ │ routes to channels) │ ├──────────────────────────┤ ├──────────────────────────┤ │ Link Layer │◄── LL PDU ─────►│ Link Layer │ │ ADV_IND / SCAN_REQ / │ │ ADV_IND / SCAN_REQ / │ │ CONNECT_IND ... │ │ CONNECT_IND ... │ └──────────────────────────┘ └──────────────────────────┘
Common PDU Types
Understanding data rates is very important when working on Bluetooth development. Bluetooth data rates have evolved significantly over the years.
─────────────────────────────────────────────────────────────────────► Bluetooth 1.x Bluetooth 2.0 + EDR Bluetooth 3.0 + HS (Before v2.0) (From v2.0 onwards) (From v3.0 onwards) ┌──────────────┐ ┌──────────────────┐ ┌──────────────────┐ │ Basic Rate │ ───►│ Enhanced Data │ ───►│ High Speed (HS) │ │ BR │ │ Rate (EDR) │ │ via Alt. MAC │ │ ≤ 721 kbps │ │ up to 2.1 Mbps │ │ up to 24 Mbps │ └──────────────┘ └──────────────────┘ └──────────────────┘
| Bluetooth Version | Mode | Max Data Rate | Notes |
|---|---|---|---|
| Before v2.0 | Basic Rate (BR) | Up to 721.2 kbps | Original Bluetooth data rate |
| v2.0 + EDR | Enhanced Data Rate (EDR) | Up to 2.1 Mbps | Uses π/4-DQPSK and 8DPSK modulation |
| v3.0 + HS | High Speed (via Alternate MAC/PHY) | Up to 24 Mbps | Uses Wi-Fi radio for high-speed bursts |
| v4.0 onwards | Bluetooth Low Energy (BLE) | Up to ~2 Mbps (LE 2M PHY) | Separate from BR/EDR — discussed in BLE section |
Now that you know about BD_ADDR, Class of Device, and data rates, let us see how two Bluetooth devices actually find each other and connect.
Step-by-Step Connection Flow
Device A (Initiator) Device B (Target) ───────────────────── ───────────────────── 1. INQUIRY ──────────────────────────────────► (Listening for inquiry) ◄──────── INQUIRY RESPONSE 2. PAGE ──────────────────────────────────► (Uses BD_ADDR found during inquiry) ◄──────── PAGE RESPONSE 3. CONNECTION ESTABLISHED ◄────────────────────────────────────────────────────────── A = Master B = Slave 4. DATA PACKETS ◄──────────────────────────────────────────────────────────► (Both can send and receive) 5. DISCONNECT ◄────────────────────────────────────────────────────────── (Either master or slave can disconnect)
Bluetooth defines two main communication topologies: Piconet and Scatternet.
Piconet
A Piconet is the smallest unit of a Bluetooth network. It contains exactly one master and up to seven active slaves. All slaves communicate only with the master — not directly with each other.
Scatternet
A Scatternet is formed when two or more piconets are connected together through a shared/bridge device. The bridge device is a slave in both piconets simultaneously.
┌─────────────────────────────────────────────────────────────────┐ │ SCATTERNET │ │ │ │ PICONET 1 PICONET 2 │ │ ┌────────────────────┐ ┌─────────────────────────┐ │ │ │ Master (M1) │ │ Master (M2) │ │ │ │ / | \ │ │ | \ │ │ │ │ S1 S2 [S3] │◄──────►│ [S3] S4 │ │ │ │ (Bridge Device) │ │ (Bridge Device) │ │ │ └────────────────────┘ └─────────────────────────┘ │ │ │ │ Bridge device (S3) is: │ │ → Slave in Piconet 1 (communicates with M1) │ │ → Slave in Piconet 2 (communicates with M2) │ └─────────────────────────────────────────────────────────────────┘
Quick Comparison
| Feature | Piconet | Scatternet |
|---|---|---|
| Number of masters | 1 | More than 1 (one per piconet) |
| Number of slaves | Up to 7 active slaves | Many (across all piconets) |
| How formed | Single master initiates connections | Two or more piconets share a bridge device |
| Bridge device role | Not applicable | A device that is a slave in multiple piconets |
| Used for | Local device clusters (e.g., phone + headset + keyboard) | Extended range networks, IoT mesh-like setups |
Summary — What You Learned
In this bluetooth development tutorial you covered all the foundational Bluetooth concepts needed before diving into the protocol stack:
In the next lecture, we will go deeper into the Bluetooth lower layers — starting with the physical layer and the link controller. so please follow our bluetooth development tutorials.
Keep Learning — It’s Free!
EmbeddedPathashala offers free Bluetooth development, BLE development, and Linux Embedded Systems tutorials for all engineers.
