> ## 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.

# Verify the functionality of BlueZ stack

<a id="verify-bluetooth-functionality-of-bluez-stack" />

The Qualcomm Linux Bluetooth solution includes the BlueZ stack and sample test applications. These applications interact with the Bluetooth daemon of the BlueZ stack to run different Bluetooth functions. Use them to verify the functionality of the BlueZ stack.

Qualcomm Linux supports the following sample applications that demonstrate Bluetooth profile use cases and test procedures. Each application has profile-specific functions through menu-driven options.

| Sample application | Profile             |
| ------------------ | ------------------- |
| bluetoothctl       | GAP, GATT, A2DP     |
| evtool             | HOGP                |
| obexctl            | OPP, FTP, PBAP, MAP |
| ofono              | HFP                 |

The following workflow shows how to get started with verifying the Bluetooth functionality using a sample application.

<img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Bluetooth/media/qli-bt/get-started-workflow.png?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=b650575f6a293a428fda4e191f6de2c2" alt="" width="1307" height="197" data-path="Technologies/Bluetooth/media/qli-bt/get-started-workflow.png" />

The sequence to complete the workflow is as follows:

1. Set up your infrastructure as described in the <a href="https://dragonwingdocs.qualcomm.com/Key-Documents/Yocto-Guide/build-qualcomm-linux" target="_self"><em>Build Qualcomm Linux using Yocto</em></a>.

2. Set up the device and run the sample application of a profile.

3. Verify the functionality of a Bluetooth profile.

4. If any issues occur, log and debug them as described in <a href="debug-bluetooth-issues" target="_self">Debug Bluetooth issues</a>.

## Set the Bluetooth MAC address

By default, the factory sets the Bluetooth MAC address in the one-time programmable memory. If you want to set the Bluetooth MAC address manually, complete the following procedure.

<Note>
  A manually set Bluetooth MAC address doesn't persist across device reboots.
</Note>

**Prerequisites**

* Enable SSH to access your host device. For instructions, see <a href="https://dragonwingdocs.qualcomm.com/Key-Documents/Flash-Guide/how-to-sign-in-with-ssh" target="_self">Sign in using SSH</a>.

* <a href="perform-bluetooth-gap-functions#disable-bluetooth" target="_self">Switch off Bluetooth on the device.</a>

**Procedure**

1. Run the SSH in command prompt using the following command:

   ```text theme={null}
   ssh root@<device_IP_address>
   ```

   **Example**

   If the IP address of the device is `10.92.160.222`, run the following command:

   ```text theme={null}
   ssh root@10.92.160.222
   ```

2. Connect to the SSH by entering the following password:

   ```text theme={null}
   oelinux123
   ```

3. Open the Bluetooth management tool and set the Bluetooth address by running the following command:

   ```text theme={null}
   btmgmt public-addr <bt_address>
   ```

   For example, to set the Bluetooth address of the device as `22:22:9B:2C:79:1E`, run the following command:

   ```text theme={null}
   btmgmt public-addr 22:22:9B:2C:79:1E
   ```

   **Sample output**

   ```text theme={null}
   sh-5.1# btmgmt public-addr 22:22:9B:2C:79:1E
   hci0 Set Public Address complete, options:
   sh-5.1# hciconfig
   hci0:     Type: Primary Bus: UART    
            BD Address: 22:22:9B:2C:79:1E ACL MTU: 1024:7 SCO MTU: 240:8
            DOWN
            RX bytes: 7763 acl:0 sco:0 events:364 errors:0
            TX bytes: 938685 acl:0 sco:0 commands:4004 errors:0
   ```

## Source code location

The following table lists the source code location of Bluetooth components such as the stack, sample test applications, and drivers.

<table>
  <thead>
    <tr><th>Component</th><th>Source code location</th></tr>
  </thead>

  <tbody>
    <tr><td>bluetoothctl</td><td>[https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/tools](https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/tools)</td></tr>
    <tr><td>obexctl</td><td>[https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/tools](https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/tools)</td></tr>
    <tr><td>ofono</td><td>[https://git.kernel.org/pub/scm/network/ofono/ofono.git](https://git.kernel.org/pub/scm/network/ofono/ofono.git)</td></tr>
    <tr><td>BlueZ stack</td><td><ul><li>The git repository for BlueZ is at: [https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/](https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/)</li><li>You can download the stack at: [https://mirrors.edge.kernel.org/pub/linux/bluetooth/bluez-5.65.tar.gz](https://mirrors.edge.kernel.org/pub/linux/bluetooth/bluez-5.65.tar.gz)</li><li>The git repository for the Bluetooth kernel subsystem is at:<ul><li>[https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git/tree/](https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git/tree/)</li><li>[https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/tree/](https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/tree/)</li></ul></li></ul></td></tr>
    <tr><td>Bluetooth driver</td><td>You can download the Bluetooth driver from the following locations: <ul><li>[https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/tree/drivers/bluetooth/hci\_qca.c](https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/tree/drivers/bluetooth/hci_qca.c) (UART)</li><li>[https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/tree/drivers/bluetooth/btqca.c](https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/tree/drivers/bluetooth/btqca.c) (UART)</li><li>[https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/tree/drivers/bluetooth/btusb.c](https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/tree/drivers/bluetooth/btusb.c) (USB)</li></ul></td></tr>
  </tbody>
</table>

## Next steps

* To set up the device and verify GAP functions, see <a href="verify-gap-functions" target="_self">Verify GAP functions</a>.

* To set up the device and verify GATT functions, see <a href="verify-gatt-functions" target="_self">Verify GATT functions</a>.

* To set up the device and verify HOGP functions, see <a href="verify-hogp-functions" target="_self">Verify HOGP functions</a>.

* To set up the device and verify A2DP functions, see <a href="verify-a2-dp-functions" target="_self">Verify A2DP functions</a>.

* To set up the device and verify HFP functions, see <a href="verify-hfp-functions" target="_self">Verify HFP functions</a>.

* To set up the device and verify OPP functions, see <a href="verify-opp-functions" target="_self">Verify OPP functions</a>.

* To set up the device and verify FTP functions, see <a href="verify-ftp-functions" target="_self">Verify FTP functions</a>.

* To set up the device and verify PBAP functions, see <a href="verify-pbap-functions" target="_self">Verify PBAP functions</a>.

* To set up the device and verify MAP functions, see <a href="verify-map-functions" target="_self">Verify MAP functions</a>.
