Prerequisites
Before you begin, set up the device as described in Set up the device for Bluetooth Low Energy GATT functions.Connect to a remote device
To connect to a remote device, run the following command from thebluetoothctl menu:
<bt_address> is the Bluetooth address of the remote device.
To get the Bluetooth address of the remote device, run a Bluetooth Low Energy GATT scan.
<bt_address> 6D:38:AF:C6:B5:62, run the following command:
Start Bluetooth Low Energy GATT scan
To start a Bluetooth Low Energy GATT scan, run the following command from thebluetoothctl menu:
To get the scan results, the remote device must advertise using any Bluetooth Low Energy application.
Stop Bluetooth Low Energy GATT scan
To stop a Bluetooth Low Energy GATT scan, run the following command from thebluetoothctl menu:
Get the list of attributes
To get the list of attributes of the remote device, run the following command from themenu gatt menu:
<bt_address> is the address of the remote device.
Example
To list the attributes of the remote device with the address 6D:38:AF:C6:B5:62, run the following command:
Get attribute information
To get the information of an attribute, run the following command from themenu gatt menu:
<attribute/UUID> is the UUID or the attribute path.
Example
To get the information of an attribute with the UUID 00002b29-0000-1000-8000-00805f9b34fb, run the following command:
Select an attribute
To select the attribute using the UUID or path, run the following command from themenu gatt menu:
<attribute/UUID> is the UUID or path of the attribute.
Example
-
To select an attribute using the UUID
00006677-0000-1000-8000-00805f9b34fb, run the following command:Sample output -
To select an attribute using the attribute path
/org/bluez/hci0/dev_6C_5F_B9_ED_5B_48/service0001/char0002, run the following command:Sample output
Read a characteristic value
To read a characteristic value, do the following from themenu gatt menu:
- Select the intended attribute.
-
Read the selected attribute by running the following command:
Write a characteristic value
To write a characteristic value, do the following from themenu gatt menu:
- Select the intended attribute.
-
Write a value to the selected attribute by running the following command:
Parameters
<value>is the value you intend to write. Example To write the attribute value as0x11, run the following command:
Read a descriptor value
To read a descriptor value, do the following from themenu gatt menu:
- Select the intended attribute.
-
Read the selected attribute by running the following command:
Write a descriptor value
To write a descriptor value, do the following from themenu gatt menu:
- Select the intended attribute.
-
Write a value to the selected attribute by running the following command:
Parameters
<value>is the value you intend to write. Example To write the attribute value as0x11, run the following command:
Read an encrypted characteristic value
To read an encrypted characteristic value, do the following from themenu gatt menu:
- Select the intended attribute.
-
Read the selected attribute by running the following command:
-
Enter
yeswhen prompted to confirm the reading.
Write an encrypted characteristic value
To write an encrypted characteristic value, do the following from themenu gatt menu:
- Select the intended attribute.
-
Write a value to the selected attribute by running the following command:
Parameters
<value>is the value you intend to write. Example To write the attribute value as0x11, run the following command: -
Enter
yeswhen prompted to confirm writing.
Turn on notifications for an attribute
To turn on notifications for an attribute, do the following from themenu gatt menu:
- Select the intended attribute.
-
Enable notifications for the attribute by running the following command:
You get notifications of any changes to the attribute.
Turn off notifications for an attribute
To turn off notifications for an attribute, do the following from themenu gatt menu:
- Select the intended attribute.
-
Disable notifications for the attribute by running the following command:

