# Perform Bluetooth Low Energy GATT client functions

You can perform Bluetooth Low Energy GATT client functions using the
`gattctest_menu` options.

Before you begin, set up the device and go to the GATT client menu as described in [Set up device for Bluetooth Low Energy GATT functions](https://docs.qualcomm.com/doc/80-70018-13/topic/set_up_ble_gatt.html#context-o3z-5dt-s1c).

## Initialize Bluetooth Low Energy GATT client

To initialize the GATT client test, run the following command:

gattctest_init
    Copy to clipboard

**Sample output**

gattctest_menu
    
    ***************** Menu *******************
             gattctest_init (only for Init time)
             gattctest_scanset<space><scan_type><space><value>         eg: scanType: 0-NO_SET,1-SCAN_MODE,2-CB_Type,3-RESULT_TYPE,4-PHY,5-LEGACY,6-REPORT_DELAY,7-NUM_RESPONSE
             gattctest_scanFilter<space><filter_type><space><filter_Value>         eg: filterType: 0-NO_FILT,1-FILT_BD_ADDR,2-FILT_DEV_NAME,3-FILT_SRVC_UUID
             gattctest_scanFilter_manData<space><manuId><space><ManuData><space><ManuMask>
             gattctest_start_scan
             gattctest_stop_scan
             gattctest_batch_scan  0-FULL MODE 1- TRUNCATED MODE
             main_menu
             gattctest_conn_params<space><isAuto><space><phy><space><isOppur>         eg: isAuto(0/1);phy (0-255 (0 bit:1M(1); 1bit:2M(2); 2bit:Coded(4); or any combination); isOppur(0/1))
             gattctest_connect<space><bt_address><space><transport>         eg. gattctest_connect 00:11:22:33:44:55 0(Auto)/1(BREDR)/2(LE)
             gattctest_disconnect<space><bt_address>           eg.gattctest_connect 00:11:22:33:44:55
             gattctest_discsrvc<space><bdaddr>  discovering services
             gattctest_rdchar_uuid<space><bdaddr><space><uuid>         eg: reading char by uuid
             gattctest_readPhy<space><bt_address>
             gattctest_readrssi<space><bt_address>
             gattctest_reqMtu<space><bt_address><space><value>
             gattctest_refresh<space><bt_address>
             gattctest_setphy<space>          <TxValue(0-255,(0 bit:1M(1); 1bit:2M(2); 2bit:Coded(4); or any combination))><space><RxValue(0-255)><space><PhyOpt(0:no pref,1:s2,2:s8)><space><bt_address>
             gattctest_getservices<space><bt_address>
             gattctest_reqconn_pri<space><bt_address><space><priority 0/1/2>
             gattctest_getcharid<space><bt_address><space><instanceid>
             gattctest_reliablewrite<space><bt_address><space><instanceid>
             gattctest_getdescid<space><bt_address><space><instanceid>
             gattctest_getsrvc<space><bt_address><space><UUID><space><INSTANCEID>
             gattctest_RdWrDesc<space><bt_address><space><R-2/W-1><space><value><space><INSTANCEID><space><value length>
             gattctest_RdWrchar<space><bt_address><space><R-2/W-1><space><value><space><INSTANCEID><space><value length>
             gattctest_conn_dev
             gattctest_register_notifications<space><bt_address><space><CHARINSTANCEID><space><DESCINSTANCEID><space><E-1/D-0>
    ******************************************
    gattctest_init
    BtCmdHandler GATTC_TEST_MENUENABLE GATTCTEST
    gattctest not initialized
    EnableGATTCTEST done
    Copy to clipboard

## Configure Bluetooth Low Energy GATT client scan settings

To apply Bluetooth Low Energy GATT scan settings such as scan mode, PHY, and legacy options before scanning, run the following command:

gattctest_scanset <scan_type> <value>
    Copy to clipboard

**Parameters**

- `<scan_type>` is the type of scan.
- `<value>` is the mode of scan.

Note

For more information about scan types and their values, see [Scan settings](https://docs.qualcomm.com/doc/80-70018-13/topic/gatt_config_params.html#section-mk4-b21-kbc-navyanka-05-14-24-1212-32-304).

If scan settings aren’t configured, then the scan is initiated with default settings.

**Example**

To set `<scan_type>` and `<value>` as `<1>` and `<1>`, respectively, run the following command:

gattctest_scanset 1 1
    Copy to clipboard

**Sample output**

gattctest_scanset 1 1
    BtCmdHandler GATTC_TEST_MENUScan settings
    Do scan settings
    scanSettings Type : 1
    SCAN_MODE value : 1
    Copy to clipboard

## Configure Bluetooth Low Energy GATT client scan filter

To apply specific Bluetooth Low Energy GATT scan filters before scanning, run the following command:

gattctest_scanFilter <filter_type> <filter_Value>
    Copy to clipboard

**Parameters**

- `<filter_type>` is the type of filter.
- `<filter_Value>` is the device name.

If scan settings aren’t configured, then the scan is initiated with default settings.

**Example**

To set `<filer_type>` as `<2>` for a Bluetooth device named `QIPL_BT`, run the following command:

gattctest_scanFilter 2 QIPL_BT
    Copy to clipboard

**Sample output**

gattctest_scanFilter 2 QIPL_BT
    BtCmdHandler GATTC_TEST_MENUScan filter
    Do scan filtering
    FilterType 2
    FILTER_DEVICE_NAME
    Dev_Name is QIPL_BT
    Copy to clipboard

## Start Bluetooth Low Energy GATT client scan

To start the Bluetooth Low Energy GATT scan, run the following command:

gattctest_start_scan
    Copy to clipboard

If the scan settings are configured, the scan is initiated based on the specified settings and filters. If the scan settings aren’t configured, the scan is initiated with default settings.

Note

To get the scan results, the remote device must advertise using any Bluetooth Low Energy application.

**Sample output**

gattctest_start_scan
    BtCmdHandler GATTC_TEST_MENUtrying to start scan
    starting scan
    [INFO:gatt_api.cc(949)] GATT_Register37d79a07-e02f-f98a-21e9-af96b7f9e01f
    INFO:gatt_api.cc(969)] allocated gatt_if=5
    VERBOSE1:gatt_api.cc(1077)]_GATT_StartIf gatt_if=+
    VERBOSE1:gatt_utils.cc(264)] gatt_find_the_connected_bda start_idx=0
    [VERBOSE1:gatt_utils.cc(276)] found=0 found_idx=7
    VERBOSE1:btm_ble_gap. cc(1952)] btm_ble_process_adv_addr: bda=1e:44:9c:50:13:5a
    [VERBOSE1:btm_inq.cc(1019)] BTM_InqDbRead: bd addr 1e:44:9c:50:13:5a
    The scanned device is 1e:44:9c:50:13:5a
    The scanned device is
    [VERBOSE1:btm_ble_gap.cc(1952)] btm_ble_process_adv_addr: bda=3d: f0:ba:09:2b:35
    [VERBOSE1:btm_inq.cc(1019)] BTM_InqDbRead: bd addr 3d: f0:ba:09:2b:35
    The scanned device is 3d: f0:ba: 09:2b:35
    The scanned device is
    [VERBOSE1:btm_ble_gap.cc(1952)] btm_ble_process_adv_addr: bda=22:fe:78:cc:32:f9
    [VERBOSE1:btm_inq.cc(1019)] BTM_InqDbRead: bd addr 22:fe:78:cc:32:f9
    The scanned device is 22:fe:78:cc:32:f9
    The scanned device is
    [VERBOSE1:btm_ble_gap.cc(1952)] btm_ble_process_adv_addr: bda=8c: fd: f0:Of:29:de
    [VERBOSE1:btm_inq.cc(1019)] BTM_InqDbRead: bd addr 8c:fd: f0:Of:29:de
    The scanned device is 8c:fd:f0:Of:29:de
    The scanned device is
    [VERBOSE1:btm_ble_gap.cc(1952)] btm_ble_process_adv_addr: bda=3c: 12:87: 58:0c:97
    [VERBOSE1:btm_inq.cc(1019)] BTM_InqDbRead: bd addr 3c:12:87:58:0c:97
    The scanned device is 3c:12:87:58:0c:97
    The scanned device is
    [VERBOSE1:btm_ble_gap.cc(1952)] btm_ble_process_adv_addr: bda=23:32:b0:bd: a6:28
    [VERBOSE1:btm_inq.cc(1019)] BTM_InqDbRead: bd addr 23:32:b0:bd: a6:28
    [VERBOSE1:btm_ble_gap.cc(1952)] btm_ble_process_adv_addr: bda=3b: a0:94:d1:16:2a
    [VERBOSE1:btm_inq.cc(1019)] BTM_InqDbRead: bd addr 3b: a0:94:d1:16:2a
    The scanned device is 23:32:b0:bd:a6:28
    The scanned device is
    The scanned device is 3b:a0:94:d1:16:2a
    Copy to clipboard

## Stop Bluetooth Low Energy GATT client scan

To stop the Bluetooth Low Energy GATT scan, run the following command:

gattctest_stop_scan
    Copy to clipboard

**Sample output**

gattctest_stop_scan
    BtCmdHandler GATTC_TEST_MENUstopping scan
    stopping scan results
    [VERBOSE1:gatt_api.cc(992)] GATT_Deregister gatt_if=5
    Copy to clipboard

## Connect Bluetooth Low Energy GATT client

To start a GATT connection to the remote device, run the following command:

gattctest_connect <bt_address> <transport>
    Copy to clipboard

**Parameters**

- `<bt_address>` is the address of the remote device.
- `<transport>` is the radio for pairing. The value of the `<transport>` parameter can be:

    - `0`: Auto selection
    - `1`: BR/EDR
    - `2`: Bluetooth Low Energy

**Example**

The address of the remote device is `44:c8:f4:b6:af:00` and the `<transport>` type is `2`. To connect to the remote device, run the following command:

gattctest_connect 44:c8:f4:b6:af:00 2
    Copy to clipboard

**Sample output**

gattctest_connect 44:c8:f4:b6:af:00 2
    BtCmdHandler GATTC_TEST_MENUconnecting
    [INFO:gatt_api.cc(949)] GATT_Register82462309-bb44-a4a7-db81-b204201f49dd
    [INFO:gatt_api.cc(969)] allocated gatt_if=5
    VERBOSE1:gatt_api.cc(1077)] GATT_StartIf gatt_if=+
    VERBOSE1:gatt_utils.cc(264)] gatt_find_the_connected_bda start_idx=0
    VERBOSE1:gatt_utils.cc(276)] found=0 found_idx=7
    [VERBOSE1:btm_inq.cc(1019)] BTM_InqDbRead: bd addr 44:c8:f4:b6:af:00
    INFO:gatt_api.cc(1122)] GATT_Connectgatt_if=5 44:c8:f4:b6:af:00
    [VERBOSE1:gatt_main.cc(1217)] gatt_get_ch_state: ch_state=0
    [VERBOSE1:gatt_main.cc(1200)] gatt_set_ch_state: old=0 new=o
    [VERBOSE1: 12c_api.cc(1673)] L2CA_ConnectFixedChnl BDA: 44:c8:f4:b6:af:00CID: 0x0004
    [VERBOSE1:btm_inq.cc(1019)] BTM_InqDbRead: bd addr 44:c8:f4:b6:af:00
    [VERBOSE1:gatt_main.cc(334)] gatt_update_app_use_link_flag: is_add=1 chk_link=1
    [VERBOSE1:gatt_main.cc(300)] gatt_update_app_hold_link_status
    [VERBOSE1:gatt_main.cc(304)] added gatt_if=5
    Copy to clipboard

## Read Bluetooth Low Energy GATT client current transmitter PHY

To read the Tx and Rx PHY parameters of the GATT connection, run the following command:

gattctest_readPhy <bt_address>
    Copy to clipboard

**Parameters**

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

**Example**

The address of the remote device is `66:6b:26:88:df:83`. To read the PHY parameters of the connection, run the following command:

gattctest_readPhy 66:6b:26:88:df:83
    Copy to clipboard

**Sample output**

gattctest_readphy 66:6b:26:88:df:83
    BtCmdHandler GATTC_TEST_MENUReading PHY
    Readphy Setting initiated
    [VERBOSE1:btm_ble.cc(889)] read_phy_cb Received read_phy_cb
    Txphy is 1 and RxPhy is 1
    Copy to clipboard

## Set Bluetooth Low Energy GATT client current transmitter PHY

To set the Tx and Rx PHY parameters of the GATT connection, run the following command:

gattctest_setphy <tx value> <rx value> <Phy option> <bt_address>
    Copy to clipboard

**Parameters**

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

Note

For more information about PHY parameters, see GATT configuration parameters.

**Example**

The address of the remote device is `4e:0f:49:d9:85:0c`. To set the Tx PHY, Rx PHY, and PHY option of the connection as `1`, `1`, and `0`, respectively, run the following command:

gattctest_setphy 1 1 0 4e:0f:49:d9:85:0c
    Copy to clipboard

**Sample output**

gattctest_setphy 1 1 0 4e:0f:49:d9:85:0c
    BtCmdHandler GATTC_TEST_MENUSetting PHY
    Txphy is 1 and RxPhy is 1
    Copy to clipboard

Note

The Tx and Rx PHY values are updated according to the negotiated remote values. These values can vary from the PHY values provided by you while running the `gattctest_setphy` command.

## Read the remote device RSSI

To read the RSSI of a remote device, run the following command:

gattctest_readrssi <bt_address>
    Copy to clipboard

**Parameters**

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

**Example**

The address of the remote device is `66:6b:26:88:df:83`. To read the RSSI of the device, run the following command:

gattctest_readrssi 66:6b:26:88:df:83
    Copy to clipboard

**Sample output**

gattctest_readrssi 66:6b:26:88:df:83
    BtCmdHandler GATTC_TEST_MENUReading RSSI
    gattReadRemoteRssi Initiated Success
    [VERBOSE1:btm_inq.cc(1019)] BTM_InqDbRead: bd addr 66:6b:26:88:df:83
    onReadRemoteRssi RSSI: -51
    Copy to clipboard

## Discover remote device services

To discover the services of the remote device, run the following command:

gattctest_discsrvc <bdaddr>
    Copy to clipboard

**Parameters**

`<bdaddr>` is the address of the connected remote device.

**Example**

The address of the remote device is `66:6b:26:88:df:83`. To discover the services of the device, run the following command:

gattctest_discsrvc 66:6b:26:88:df:83
    Copy to clipboard

**Sample output**

gattctest_discsrvc 66:6b:26:88:df:83
    BtCmdHandler GATTC_TEST_MENUDiscovering services
    ===============================
    === The service type is 0 InstaceId 1
    == SERVICE uuid is 00001801-0000-1000-8000-00805f9b34fb
    The no of Characteristics for thisservice: 1
    == == CHAR uuid is 00002a05-0000-1000-8000-00805f9b34fb InstanceID 3
    == == Properties 32 ; permissions 0; writeType 2
    The no of descriptors for thischar 0
    ===============================
    === The service type is 0 InstaceId 20
    == SERVICE uuid is 00001800-0000-1000-8000-00805f9b34fb
    The no of Characteristics for thisservice: 3
    == == CHAR uuid is 00002a00-0000-1000-8000-00805f9b34fb InstanceID 22
    == == Properties 2 ; permissions 0; writeType 2
    The no of descriptors for thischar 0
    == == CHAR uuid is 00002a01-0000-1000-8000-00805f9b34fb InstanceID 24
    == == Properties 2 ; permissions 0; writeType 2
    The no of descriptors for thischar 0
    == == CHAR uuid is 00002aa6-0000-1000-8000-00805f9b34fb InstanceID 26
    == == Properties 2 ; permissions 0; writeType 2
    The no of descriptors for thischar 0
    ===============================
    === The service type is 0 InstaceId 40
    == SERVICE uuid is 0000180d-0000-1000-8000-00805f9b34fb
    The no of Characteristics for thisservice: 3
    == == CHAR uuid is 00002a37-0000-1000-8000-00805f9b34fb InstanceID 42
    == == Properties 16 ; permissions 0; writeType 2
    The no of descriptors for thischar 1
    == == CHAR uuid is 00002a38-0000-1000-8000-00805f9b34fb InstanceID 45
    == == Properties 2 ; permissions 0; writeType 2
    The no of descriptors for thischar 0
    == == CHAR uuid is 00002a39-0000-1000-8000-00805f9b34fb InstanceID 47
    == == Properties 8 ; permissions 0; writeType 2
    The no of descriptors for thischar 0
    Copy to clipboard

## Get remote device services

To get the list of services of a remote device, run the following command:

gattctest_getservices <bt_address>
    Copy to clipboard

**Parameters**

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

**Example**

The address of the remote device is `66:6b:26:88:df:83`. To get the list of services of the device, run the following command:

gattctest_getservices 66:6b:26:88:df:83
    Copy to clipboard

**Sample output**

gattctest_getservices 66:6b:26:88:df:83
    BtCmdHandler GATTC_TEST_MENUgetting services
    ==============================================
    === The service type is 0 Instance ID is1
    == SERVICE uuid is 00001801-0000-1000-8000-00805f9b34fb
    The no of Characteristics for this service:1
    == == == CHAR uuid is 00002a05-0000-1000-8000-00805f9b34fb InstanceId : 3
    == == == Properties 32 ; permissions 0;writeType 2
    ==============================================
    === The service type is 0 Instance ID is20
    == SERVICE uuid is 00001800-0000-1000-8000-00805f9b34fb
    The no of Characteristics for this service:3
    == == == CHAR uuid is 00002a00-0000-1000-8000-00805f9b34fb InstanceId : 22
    == == == Properties 2 ; permissions 0;writeType 2
    == == == CHAR uuid is 00002a01-0000-1000-8000-00805f9b34fb InstanceId : 24
    == == == Properties 2 ; permissions 0;writeType 2
    == == == CHAR uuid is 00002aa6-0000-1000-8000-00805f9b34fb InstanceId : 26
    == == == Properties 2 ; permissions 0;writeType 2
    ==============================================
    === The service type is 0 Instance ID is40
    == SERVICE uuid is 0000180d-0000-1000-8000-00805f9b34fb
    The no of Characteristics for this service:3
    == == == CHAR uuid is 00002a37-0000-1000-8000-00805f9b34fb InstanceId : 42
    == == == Properties 16 ; permissions 0;writeType 2
    == == == CHAR uuid is 00002a38-0000-1000-8000-00805f9b34fb InstanceId : 45
    == == == Properties 2 ; permissions 0;writeType 2
    == == == CHAR uuid is 00002a39-0000-1000-8000-00805f9b34fb InstanceId : 47
    == == == Properties 8 ; permissions 0;writeType 2
    ==============================================
    === The service type is 0 Instance ID is48
    Copy to clipboard

## Read a characteristic value

To read the characteristic value, run the following command:

gattctest_RdWrChar <bt_address> <Read> <Value> <InstanceID> <Value length>
    Copy to clipboard

**Parameters**

- `<bt_address>` is the address of the connected remote device.
- `<Read>` command value is `2`.
- `<Value>` is `0`. As the characteristic value is read from the remote device, the value is `0`.
- `<InstanceID>` is the instance value of the particular characteristic.

    During service discovery, all the services and characteristics are updated with the instance IDs in the command line.
- `<Value Length>` is the length of the characteristic value to be written. For reading the characteristic value, the value length can be `0`.

**Example**

The address of the remote device is `48:33:48:d9:2c:b0` and the `<InstanceID>` is `9`. To read the characteristic value, run the following command:

gattctest_RdWrchar 48:33:48:d9:2c:b0 2 0 9 0
    Copy to clipboard

**Sample output**

gattctest RdWrchar 48:33:48:d9:2c:b0 2 0 9 0
    BtCmdHandler GATTC_TEST_MENUReading writing char
    instanceid 9
    readcharacteristic Initiated
    onCharacteristicRead UUID 00002b2a-0000-1000-8000-00805f9b34fb, value is 16~0
    Copy to clipboard

## Write a characteristic value

To write a characteristic value, run the following command:

gattctest_RdWrChar <bt_address> <Write> <Value> <InstanceID> <Value length>
    Copy to clipboard

**Parameters**

- `<bt_address>` is the address of the connected remote device.
- `<Write>` command value is `1`.
- `<Value>` is the characteristic value to be written.
- `<InstanceID>` is the instance value of the particular characteristic.

    During service discovery, all the services and characteristics are updated with the instance IDs in the command line.
- `<Value Length>` is the length of the characteristic value to be written.

**Example**

The address of the remote device is `48:33:48:d9:2c:b0` and the `<InstanceID>` is `56`. To write the characteristic value `78` with value length of `2`, run the following command:

gattctest_RdWrchar 48:33:48:d9:2c:b0 1 78 56 2
    Copy to clipboard

**Sample output**

gattctest_RdWrchar 48:33:48:d9:2c:b0 1 78 56 2
    BtCmdHandler GATTC_TEST_MENUReading writing char
    instanceid 56
    writeCharacteristic value 78
    writeCharacteristic success
    write characteristic uid 0000aaa2-0000-1000-8000-aabbccddeeff, value:78 == success
    write characteristic: 0 success
    Copy to clipboard

## Read a descriptor value

To read a descriptor value, run the following command:

gattctest_RdWrDesc <bt_address> <Read> <Value> <InstanceID> <Value length>
    Copy to clipboard

**Parameters**

- `<bt_address>` is the address of the connected remote device.
- `<Read>` command value is `2`.
- `<Value>` is `0`. As the descriptor value is read from the remote device, the value is `0`.
- `<InstanceID>` is the instance value of the particular descriptor.

    For the instance IDs of the descriptors of a characteristic, see [Get characteristic ID](https://docs.qualcomm.com/doc/80-70018-13/topic/perform_ble_gatt_client_functions.html#section-ogz-ygt-s1c).

    During service discovery, all the services and descriptors are updated with the instance IDs in the command line.
- `<Value Length>` is the length of the descriptor value to be written. For reading the descriptor value, the value length can be `0`.

**Example**

The address of the remote device is `48:33:48:d9:2c:b0` and the `<InstanceID>` is `52`. To read the descriptor value, run the following command:

gattctest_RdWrDesc 48:33:48:d9:2c:b0 2 0 52 0
    Copy to clipboard

**Sample output**

gattctest_RdWrDesc 48:33:48:d9:2c:b0 2 0 52 0
    BtCmdHandler GATTC_TEST_MENUReading writing DESC
    instanceid 52
    readDescriptor Initiated
    DESCRIPTOR VALUE is #4Vx
    Copy to clipboard

## Write a descriptor value

To write a descriptor value, run the following command:

gattctest_RdWrDesc <bt_address> <Write> <Value> <InstanceID> <Value length>
    Copy to clipboard

**Parameters**

- `<bt_address>` is the address of the connected remote device.
- `<Write>` command value is `1`.
- `<Value>` is the descriptor value to be written.
- `<InstanceID>` is the instance value of the particular descriptor.

    For the instance IDs of the descriptors of a characteristic, see [Get characteristic ID](https://docs.qualcomm.com/doc/80-70018-13/topic/perform_ble_gatt_client_functions.html#section-ogz-ygt-s1c).

    During service discovery, all the services and descriptors are updated with the instance IDs in the command line.
- `<Value Length>` is the length of the descriptor value to be written.

**Example**

The address of the remote device is `48:33:48:d9:2c:b0` and the `<InstanceID>` is `52`. To read the descriptor value `7` with value length of `1`, run the following command:

gattctest_RdWrDesc 48:33:48:d9:2c:b0 1 7 52 1
    Copy to clipboard

**Sample output**

gattctest_RdWrDesc 48:33:48:d9:2c:b0 1 7 52 1
    BtCmdHandler GATTC_TEST_MENUReading writing DESC
    instanceid 52
    onDescriptorWrite Completed 0
    onDescriptorWrite Success
    Copy to clipboard

## Set connection priority

To set the connection priority for a particular remote device, run the following command:

gattctest_reqconn_pri <bt_address> <priority>
    Copy to clipboard

**Parameters**

- `<bt address>` is the address of the connected remote device.
- `<priority>` can be `0`, `1`, or `2`.

**Example**

To set the connection priority of the remote device with the address `66:6b:26:88:df:83` as `1`, run the following command:

gattctest_reqconn_pri 66:6b:26:88:df:83 1
    Copy to clipboard

**Sample output**

gattctest_reqconn_pri 66:6b:26:88:df:83 1
    BtCmdHandler GATTC_TEST_MENURequesting Connection Priority
    Requested Connection priority
    onConnectionUpdated interval (12), latency (0), timeout (2000), status (0)
    Copy to clipboard

## Get characteristic ID

To get the details of a characteristic, run the following command:

gattctest_getcharid <bt_address> <instanceID>
    Copy to clipboard

This command displays the details of the characteristic such as the characteristic UUID, properties, permissions, the number of descriptors, and the UUID and instance IDs of the descriptors.

**Parameters**

- `<bt address>` is the address of the connected remote device.
- `<instanceID>` is the instance ID of the characteristic.

**Example**

The address of the remote device is `54:8b:83:4a:1f:4e`. To get the characteristic with instance ID `74`, run the following command:

gattctest_getcharid 54:8b:83:4a:1f:4e 74
    Copy to clipboard

**Sample output**

gattctest_getcharid 54:8b:83:4a:1f:4e 74
    BtCmdHandler GATTC_TEST_MENUgetting Characteristic
    == == == CHAR uuid is ffffeeee-0000-1000-8000-00805f9b34fb InstanceId : 74
    == == == Properties 10 ; permissions 0 ; writeType 2
    The no of descriptors for this char: 1
    @@@@@@ desc uuid is bbbb1111-0000-1000-8000-00705f9b34fb InstanceId : 75
    ****** permissions 0 ; value (null)
    Copy to clipboard

## Get descriptor ID

To get the details of a descriptor, run the following command:

gattctest_getdescid <bt address> <instanceID>
    Copy to clipboard

**Parameters**

- `<bt address>` is the address of the connected remote device.
- `<instanceID>` is the instance ID of the descriptor.

**Example**

The address of the remote device is `54:8b:83:4a:1f:4e`. To get the descriptor with instance ID `75`, run the following command:

gattctest_getdescid 54:8b:83:4a:1f:4e 75
    Copy to clipboard

**Sample output**

gattctest_getdescid 54:8b:83:4a:1f:4e 75
    BtCmdHandler GATTC_TEST_MENUgetting Descriptor
    @@@@@@ desc uuid is bbbb1111-0000-1000-8000-00705f9b34fb InstanceId : 75
    Copy to clipboard

## Disconnect Bluetooth Low Energy GATT client

To disconnect from the remote device, run the following command:

gattctest_disconnect <bt_address>
    Copy to clipboard

**Parameters**

`<bt address>` is the address of the remote device that you intend to disconnect.

**Example**

The address of the remote device is `69:d0:d6:99:80:75`. To disconnect the device, run the following command:

gattctest_disconnect 69:d0:d6:99:80:75
    Copy to clipboard

**Sample output**

gattctest_disconnect 69:d0:d6:99:80:75
    BtCmdHandler GATTC_TEST_MENUdisconnecting
    [INFO:gatt_api.cc(1225)] GATT_Disconnect conn_id=5
    [VERBOSE1:gatt_main.cc(334)] gatt_update_app_use_link_flag: is_add=0 chk_link=1
    [VERBOSE1:gatt_main.cc(300)] gatt_update_app_hold_link_status
    [VERBOSE1:gatt_main.cc(317)] removed_gatt_if=5
    Copy to clipboard

Last Published: Apr 02, 2025

[Previous Topic
Perform Bluetooth Low Energy GATT server functions](https://docs.qualcomm.com/bundle/publicresource/80-70018-13/topics/perform_ble_gatt_server_functions.md) [Next Topic
GATT configuration parameters](https://docs.qualcomm.com/bundle/publicresource/80-70018-13/topics/gatt_config_params.md)