# General Access Profile

Bluetooth Low Energy GAP is an extension of the existing BR/EDR GAP.

To perform Bluetooth GAP functions, you must first complete the steps in the following procedure.

## Set up device for Bluetooth GAP functions

**Prerequisites**

- Enable SSH to access your host device. For instructions, see [Sign in using SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-254/how_to.html#use-ssh).
- Place the DUT and the remote device in the Bluetooth vicinity.

**Procedure**

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

ssh root@<device_IP_address>
        Copy to clipboard

    **Example**

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

ssh root@10.92.160.222
        Copy to clipboard
2. Connect to the SSH by entering the following password:

oelinux123
        Copy to clipboard
3. Set a unique Bluetooth MAC address.

    - By default, the Bluetooth MAC address of all devices is `00:00:00:00:5a:ad`.
    - If your device has the default Bluetooth MAC address, set a unique address.
    - If your device doesn’t have the default Bluetooth MAC address, then it’s a one-time program (OTP) setting. You don’t need to change it.

    **Example**

    To set the Bluetooth MAC address as `11:22:33:44:55:66`, run the following commands:

mount -o remount rw /
        Copy to clipboard

cd /var/bluetooth
        Copy to clipboard

python3 BtNvmUtility.py --BDA 11:22:33:44:55:66
        Copy to clipboard

    **Sample output**

sh-5.1#
        sh-5.1# mount -o remount rw /
        sh-5.1# cd /var/bluetooth
        sh-5.1# python3 BtNvmUtility.py --BDA 11:22:33:44:55:66
        ----------------------------------------------------------------------------
        *********************BD_Address updated successfully !!*********************
        ----------------------------------------------------------------------------
        Copy to clipboard
4. Open the Bluetooth test application by running the following command:

btapp
        Copy to clipboard

    **Sample output**

sh-5.1# btapp
        get_ap_interface
        :: get_ap_interface
        
        ***************** Menu *******************
                 gap_menu
                 test_menu
                 a2dp_sink_menu
                 hfp_client_menu
                 gattctest_menu
                 gattstest_menu
                 hogp_menu
                 hfp_ag_menu
                 a2dp_source_menu
                 spp_client_menu
                 spp_server_menu
                 eslap_menu
                 exit
        ******************************************
        Copy to clipboard
5. Go to the **GAP Menu** by running the following command:

gap_menu
        Copy to clipboard

    The `gap_menu` consists of generic Bluetooth functions. To perform these functions, see [Perform Bluetooth GAP functions](https://docs.qualcomm.com/doc/80-70018-13/topic/gap_commands.html#gap-commands).

    **Sample output**

sh-5.1# btapp
        get_ap_interface
        :: get_ap_interface
        
        ***************** Menu *******************
                 gap_menu
                 test_menu
                 a2dp_sink_menu
                 hfp_client_menu
                 gattctest_menu
                 gattstest_menu
                 hogp_menu
                 hfp_ag_menu
                 a2dp_source_menu
                 spp_client_menu
                 spp_server_menu
                 eslap_menu
                 exit
        ******************************************
        gap_menu
        
        ***************** Menu *******************
                 enable
                 disable
                 inquiry
                 cancel_inquiry
                 get_role_req<space><bt_address>     eg. get_role_req 00:11:22:33:44:55
                 pair<space><bt_address><space><transport>     eg. pair 00:11:22:33:44:55 0(auto)/1(BREDR)/2(BLE)
                 unpair<space><bt_address>     eg. unpair 00:11:22:33:44:55
                 inquiry_list
                 bonded_list
                 get_state
                 get_bt_name
                 get_bt_address
                 set_bt_name<space><bt name>     eg. set_bt_name MDM_Fluoride
                 set_scan_mode<space><scan mode value (range 0-2)>     eg. set_scan_mode 0 --0-BT_SCAN_MODE_NONE,1- BT_SCAN_MODE_CONNECTABLE,2-BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE
                 set_afh<space><AFH_Host_Channel_Classification>     eg. set_afh 112233445566778899f0
                 send_hci_cmd<space><hci_cmd>     eg. send_hci_cmd 01,04,05,33,8b,9e,0a,00 - For Inquiry
                 read_clock<space><which_clock range(0-1)><space><bt_address>     eg. read_clock 0(local)/1(acl connection) 00:11:22:33:44:55
                 main_menu
                 switch_role_req<bt_address><space><new_role>     eg. switch_role_req 00:11:22:33:44:55 0 or get_role_req 00:11:22:33:44:55 1
        ******************************************
        Copy to clipboard

**Next steps**

- [Perform Bluetooth GAP functions](https://docs.qualcomm.com/doc/80-70018-13/topic/gap_commands.html)
You can perform various Bluetooth GAP functions using the generic `gap_menu` options.

Last Published: Apr 02, 2025

[Previous Topic
Verify functionality of Fluoride stack](https://docs.qualcomm.com/bundle/publicresource/80-70018-13/topics/bluetooth_usecases.md) [Next Topic
Perform Bluetooth GAP functions](https://docs.qualcomm.com/bundle/publicresource/80-70018-13/topics/gap_commands.md)