> ## 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 GATT functions

> GATT is a service framework that uses ATT to discover services, and to read and write characteristic values on a peer device.

<a id="bluez-gatt" />

To perform Bluetooth Low Energy GATT server or client functions, you must first complete the steps in the following procedure.

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

* Place the DUT and the remote device in the Bluetooth vicinity.

## Set up the device for Bluetooth Low Energy GATT functions

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 test application by running the following command:

   ```text theme={null}
   bluetoothctl
   ```

   You can perform a few GATT functions like connecting and scanning through the main menu options of bluetoothctl.

   **Sample output**

   ```text theme={null}
   sh-5.1# bluetoothctl
   Agent registered        uetoothd...
   [CHG] Controller 22:22:F1:C1:99:C0 Pairable: yes
   ```

4. Enable Bluetooth by running the following command:

   ```text theme={null}
   power on
   ```

   **Sample output**

   ```text theme={null}
   [bluetooth]# power on
   [CHG] Controller 22:22:F1:C1:99:C0 Class: 0x007c0000
   Changing power on succeeded
   [CHG] Controller 22:22:F1:C1:99:C0 Powered: yes
   ```

5. Go to the **GATT submenu** by running the following command:

   ```text theme={null}
   menu gatt
   ```

   **Sample output**

   ```text theme={null}
   [bluetooth]# menu gatt
   Menu gatt:
   Available commands:
   -------------------
   list-attributes [dev/local]                       List attributes
   select-attribute <attribute/UUID/local> [attribute/UUID] Select attribute
   attribute-info [attribute/UUID]                   Select attribute
   read [offset]                                     Read attribute value
   write <data=xx xx ...> [offset] [type]            Write attribute value
   acquire-write                                     Acquire Write file descriptor
   release-write                                     Release Write file descriptor
   acquire-notify                                    Acquire Notify file descriptor
   release-notify                                    Release Notify file descriptor
   notify <on/off>                                   Notify attribute value
   clone [dev/attribute/UUID]                        Clone a device or attribute
   register-application [UUID ...]                   Register profile to connect
   unregister-application                            Unregister profile
   register-service <UUID> [handle]                  Register application service.
   unregister-service <UUID/object>                  Unregister application service
   register-includes <UUID> [handle]                 Register as Included service in.
   unregister-includes <Service-UUID> <Inc-UUID>     Unregister Included service.
   register-characteristic <UUID> <Flags=read,write,notify...> [handle] Register application characteristic
   unregister-characteristic <UUID/object>           Unregister application characteristic
   register-descriptor <UUID> <Flags=read,write...> [handle] Register application descriptor
   unregister-descriptor <UUID/object>               Unregister application descriptor
   back                                              Return to main menu
   version                                           Display version
   quit                                              Quit program
   exit                                              Quit program
   help                                              Display help about this program
   export                                            Print environment variables
   ```

   * For GATT server functions, see <a href="perform-bluetooth-low-energy-gatt-server-functions" target="_self">Perform Bluetooth Low Energy GATT server functions</a>.

   * For GATT client functions, see <a href="perform-bluetooth-low-energy-gatt-client-functions" target="_self">Perform Bluetooth Low Energy GATT client functions</a>.

## Next steps

### <a href="perform-bluetooth-low-energy-gatt-server-functions" target="_self">Perform Bluetooth Low Energy GATT server functions</a>

You can perform Bluetooth Low Energy GATT server functions using the GATT submenu options and **bluetoothctl** commands. Bluetooth Low Energy GATT server functions include connecting to and disconnecting from remote devices, adding a primary service, and defining characteristics and descriptors. GATT functions also support adding included services, registering an application, and starting advertisements to make the device discoverable.

### <a href="perform-bluetooth-low-energy-gatt-client-functions" target="_self">Perform Bluetooth Low Energy GATT client functions</a>

You can perform Bluetooth Low Energy GATT client functions using the GATT submenu options and **bluetoothctl** commands. Bluetooth Low Energy GATT client functions include connecting to a remote device and starting or stopping Bluetooth Low Energy GATT scans. You can retrieve the list of attributes, get attribute information, and select specific attributes. GATT functions also support reading and writing characteristic values, including encrypted characteristics, and reading and writing descriptor values. Additionally, they allow turning notifications on or off for selected attributes.
