> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bluetooth software architecture

<a id="bt_architecture_overview" />

The Bluetooth software architecture consists of open-source and Qualcomm proprietary software.

The following figure shows how the user space and kernel space components interact through a socket interface. In the user space, the sample test applications interact with the BlueZ Bluetooth daemon to run Bluetooth functions.

<Frame caption="Figure: Bluetooth software architecture and components">
  <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Bluetooth/media/qli-bt/bluez-architecture.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=25dae5e5dda53936c9c3cf3d9a4d0c89" alt="The software architecture and components of Bluetooth solution." width="1070" height="1063" data-path="Technologies/Bluetooth/media/qli-bt/bluez-architecture.png" />
</Frame>

The Bluetooth software architecture consists of the user space, the kernel space, and the Bluetooth controller.

## User space components

The user space comprises the following Bluetooth applications, daemon, and interface layers.

<table>
  <thead>
    <tr><th>Component</th><th>Description</th></tr>
  </thead>

  <tbody>
    <tr><td>Bluetooth daemon (bluetoothd)</td><td><ul><li>A central daemon.</li><li>Comprises data bus (DBUS) interfaces for the user interface and other subsystems.</li><li>Reduces exposure to low-level details.</li><li>Extends with plugins.</li></ul></td></tr>
    <tr><td>bluetoothctl</td><td><ul><li>A test tool to verify Bluetooth functionality.</li><li>Provides options to verify using a command-line interface (CLI).</li></ul></td></tr>
    <tr><td>mpris-proxy</td><td><ul><li>A proxy DBUS service for Media Player Remote Interfacing Specification (MPRIS).</li></ul></td></tr>
    <tr><td>obexctl</td><td><ul><li>A test tool to verify Object Exchange Protocol (OBEX) functionality.</li></ul></td></tr>
    <tr><td>OBEX daemon (obexd)</td><td><ul><li>A daemon for the OBEX profile.</li><li>Comprises DBUS interfaces for the user interface.</li></ul></td></tr>
    <tr><td>ofono</td><td><ul><li>Provides a test application for HFP.</li><li>Searches for modem and then enables the HFP audio gateway role.</li></ul></td></tr>
    <tr><td>ofono-tests</td><td>Provides options to perform the following functions: <ul><li>Dial</li><li>Answer</li><li>Create multiparty</li><li>Hold and answer</li><li>Swap</li><li>Release calls</li></ul></td></tr>
    <tr><td>PipeWire</td><td><ul><li>A sound server for portable operating system interface (POSIX).</li><li>Facilitates advanced operations on sound data that passes between the applications and hardware.</li></ul></td></tr>
  </tbody>
</table>

## Kernel space components

The kernel space comprises the following core components and drivers.

<table>
  <thead>
    <tr><th>Component</th><th>Description</th></tr>
  </thead>

  <tbody>
    <tr><td>Bluetooth management (btmgmt)</td><td><ul><li>Enables user space to control kernel operations.</li><li>Supports GAP functionalities such as adapter settings, device discovery, and device pairing.</li></ul></td></tr>
    <tr><td>BlueZ Host Control Interface (HCI) core</td><td><ul><li>Sends and receives HCI commands/events from the user space HCI component to the Qualcomm Bluetooth driver through the raw socket.</li></ul></td></tr>
    <tr><td>HCI</td><td><ul><li>A layer in the Bluetooth protocol stack.</li><li>Defines how the host and the Bluetooth radio controller must interact.</li></ul></td></tr>
    <tr><td>Logical Link Control and Adaptation Protocol (L2CAP)</td><td><ul><li>Breaks large data packets into smaller frames for transmission. The destined component re-assembles the frames.</li><li>Handles quality-of-service (QoS) requirements.</li></ul></td></tr>
    <tr><td>Qualcomm Bluetooth driver</td><td><ul><li>Handles the Bluetooth general-purpose input/output (GPIO) configurations.</li><li>Enables or disables the regulators to turn the chip on or off.</li><li>Handles the download of Bluetooth patch and nonvolatile data during the Bluetooth on sequence.</li></ul></td></tr>
    <tr><td>Radio Frequency Communication (RFCOMM)</td><td><ul><li>Creates reliable and stream-based channels.</li><li>Has 30 ports. In contrast, the Transmission Control Protocol (TCP) has 65,535 ports.</li><li>An L2CAP connection encapsulates each RFCOMM connection.</li></ul></td></tr>
    <tr><td>Session Description Protocol (SDP)</td><td><ul><li>Provides the means for client applications to discover the existing services provided by server applications.</li><li>Provides the attributes of services, which include the type or class of service offered, and the mechanism or protocol information required to use the service.</li></ul></td></tr>
    <tr><td>SLIMbus Bluetooth driver</td><td><ul><li>Configures, opens, and closes the SLIMbus ports for Bluetooth audio use cases.</li></ul></td></tr>
    <tr><td>Synchronous Connection Oriented (SCO)</td><td><ul><li>A type of data link in Bluetooth.</li><li>Provides links that are point-to-point connections between a central device and a single peripheral device.</li></ul></td></tr>
    <tr><td>Universal asynchronous receiver/transmitter (UART) serial driver</td><td><ul><li>A teletype (TTY) serial driver facilitates communication with the Bluetooth controller.</li></ul></td></tr>
  </tbody>
</table>

## Bluetooth controller components

The Bluetooth controller components include the Link Manager Protocol (LMP), link controller, baseband, and RF system of the connectivity chipset.
