# Perform Bluetooth HFP audio gateway functions

Source: [https://docs.qualcomm.com/doc/80-70017-13/topic/perform-bluetooth-hfp-ag-functions.html](https://docs.qualcomm.com/doc/80-70017-13/topic/perform-bluetooth-hfp-ag-functions.html)

You can perform HFP audio gateway functions using the `hfp_ag_menu`
        options.

Before you begin, set up the device and go to the HFP audio gateway menu as described
                in [Set up the device for HFP functions](https://docs.qualcomm.com/doc/80-70017-13/topic/set-up-hfp.html#hfp-set-up__section_w52_kvd_lcc_navyanka_08-19-24-1310-42-670).

## Connect to an audio gateway

To connect to an audio gateway, run the following
                command:

    connect <bt_address>Copy to clipboard

**Parameters**

`<bt_address>` is the Bluetooth address of the remote device.

**Example**

To connect to a remote device with the Bluetooth address
                    `20:19:d8:36:90:40`, run the following command:

    connect 20:19:d8:36:90:40Copy to clipboard

**Sample output**

connect 20:19:d8:36:90:40
    HandleHfpAGConnand cnd_id = 22
     BtHfpAgMsgHandler event = 687
     AG: Processing event = 687
    state_disconnected_handler Processing event 687
    connecting with device 28:19:d8:36:90:40 BtHfpAgMsgHandler event = 629 
     AG: Processing event = 629
    state_pending_handler Processing event 629
    connected with device 20:19:d8:36:90:48 wbs_callback
     BtHfpAgMsgHandler event = 654
     AG: Processing event = 654
    state_connected_handler Processing event = 65Wat_cind_callback
     BtHfpAgMsgHandler event = 657
     AG: Processing event = 657
    state_connected_handler Processing event = 657Sending CIND resp to device 20:19:d8:36:90:40 
     BtHfpAgMsgHandler event = 630
     AG: Processing event = 630
    state_connected_handler Processing event = 630SLC connected with device 28:19:d8:36:90:40 noice_reduction_callback 
     BtHfpAgMsgHandler event = 653 
     AG: Processing event = 653
    state_connected_handler Processing event = 653volune_control_callback : speaker volume is 12
     BtHfpAgMsgHandler event = 650
     AG: Processing event = 650
    state_connected_handler Processing event = 650unknown_at_callback
     BtHfpAgMsgHandler event = 660
     AG: Processing event = 660
    state_connected_handler Processing event = 660unknown_at_callback
     BtHfpAgMsgHandler event = 668
     AG: Processing event = 668
    state_connected_handler Processing event = 668at_clcc_callback
     BtHfpAgMsgHandler event = 659
     AG: Processing event = 659
    state_connected_handler Processing event = 659Sending CLCC resp to device 20:19:d8: 36:90:40unknown_at_callback
     BtHfpAgMsgHandler event = 660
     AG: Processing event = 660Copy to clipboard

## Disconnect an audio gateway

To disconnect an audio gateway, run the following
                command:

    disconnect <bt_address>Copy to clipboard

**Parameters**

`<bt_address>` is the Bluetooth address of the remote device.

**Example**

To disconnect a remote device with the Bluetooth address
                    `20:19:d8:36:90:40`, run the following command:

    disconnect 20:19:d8:36:90:40Copy to clipboard

**Sample output**

disconnect 20:19:d8:36:90:40
    HandleHfpAGComnand cnd_id = 23
     BtHfpAgMsgHandler event = 688
     AG: Processing event = 608
    state_connected_handler Processing event = 688Disconnecting with device 20:19:d8:36:90:40 BtHfpAgMsgHandler event = 632
     AG: Processing event = 632
    state_pending_handler Processing event 632
    
    Disconnected from or Unable to connect with device 20:19:d8:36:90:40 Wrong option selectedCopy to clipboard

**Parent Topic:** [Hands-Free Profile](https://docs.qualcomm.com/doc/80-70017-13/topic/set-up-hfp.html)

Last Published: Dec 26, 2024

[Previous Topic
Perform Bluetooth HFP client functions](https://docs.qualcomm.com/bundle/publicresource/80-70017-13/topics/perform-bluetooth-hfp-client-functions.md) [Next Topic
Debug](https://docs.qualcomm.com/bundle/publicresource/80-70017-13/topics/bt_debugging.md)