6 GATT Client

GATT Client

6.1 AT Commands

AT Command
Description
GATT Primary Services Discover
GATT Primary Services Discover by UUID
GATT Service Characteristics Discover
GATT Characteristic Descriptors Discover
GATT Read
GATT Read characteristic by UUID
GATT Write
GATT Client Configuration Write
GATT Write with No Response
GATT Write long

6.1.1 AT+UBTGPSD - GATT Primary Services Discover

List all GATT services on the GATT server.
Syntax
AT Command
Description
AT+UBTGPSD=<conn_handle>
Discover all primary services on the remote device.
Response
Description
+UBTGPSD:<conn_handle>,<start_handle>,<end_handle>,<uuid>
This response is sent for each service found.
Defined values
Parameter
Type
Description
conn_handle
integer
Bluetooth Low Energy connection handle.
start_handle
integer
Service start handle.
end_handle
integer
Service end handle.
uuid
byte_array
UUID of attribute. Either 16-bit or 128-bit.

6.1.2 AT+UBTGPSDU - GATT Primary Services Discover by UUID

Discovers all primary services by UUID on the remote device.
Syntax
AT Command
Description
AT+UBTGPSDU=<conn_handle>,<uuid>
Start discovery.
Response
Description
+UBTGPSDU:<conn_handle>,<start_handle>,<end_handle>
This response is sent for each service found.
Defined values
Parameter
Type
Description
conn_handle
integer
Bluetooth Low Energy connection handle.
uuid
byte_array
UUID of attribute. Either 16-bit or 128-bit.
start_handle
integer
Service start handle.
end_handle
integer
Service end handle.

6.1.3 AT+UBTGSCD - GATT Service Characteristics Discover

This command will list all characteristics belonging to a service on the GATT server.
Syntax
AT Command
Description
AT+UBTGSCD=<conn_handle>,<start>,<end>
Discover all characteristics of a service.
Response
Description
+UBTGSCD:<conn_handle>,<attr_handle>,<properties>,<value_handle>,<uuid>
This response is sent for each characteristic found.
Defined values
Parameter
Type
Description
start
integer
Service start handle.
end
integer
Service end handle.
attr_handle
integer
Attribute handle of the characteristic
properties
byte_array
Bit mask describing the properties of the characteristic
conn_handle
integer
Bluetooth Low Energy connection handle.
value_handle
integer
Attribute handle of the characteristic value.
uuid
byte_array
UUID of attribute. Either 16-bit or 128-bit.

6.1.4 AT+UBTGCDD - GATT Characteristic Descriptors Discover

Discover Characteristics Descriptors. This command will list all descriptors of a characteristic on the GATT server.
Syntax
AT Command
Description
AT+UBTGCDD=<conn_handle>,<value_handle>,<characteristic_end_handle>
Discover all descriptors of a characteristic.
Response
Description
+UBTGCDD:<conn_handle>,<char_handle>,<desc_handle>,<uuid>
This response is sent for each descriptor found.
Defined values
Parameter
Type
Description
char_handle
integer
Characteristic handle.
characteristic_end_handle
integer
End handle of characteristic to which descriptor discovery is being performed.
desc_handle
integer
Descriptor handle.
conn_handle
integer
Bluetooth Low Energy connection handle.
value_handle
integer
Attribute handle of the characteristic value.
uuid
byte_array
UUID of attribute. Either 16-bit or 128-bit.

6.1.5 AT+UBTGR - GATT Read

Read a characteristic value.
Syntax
AT Command
Description
AT+UBTGR=<conn_handle>,<value_handle>
Reads the characteristic; all bytes included.
Response
Description
+UBTGR:<conn_handle>,<value_handle>,<hex_data>
Successful read response.
Defined values
Parameter
Type
Description
conn_handle
integer
Bluetooth Low Energy connection handle.
value_handle
integer
Attribute handle of the characteristic value.
hex_data
byte_array
Characteristic data in hexadecimal form. For example, 070809AABBCC

6.1.6 AT+UBTGRU - GATT Read characteristic by UUID

Read GATT characteristic values by UUID.
Syntax
AT Command
Description
AT+UBTGRU=<conn_handle>,<start>,<end>,<uuid>
Read all the characteristics by UUID. It will read all the bytes in each characteristic.
Response
Description
+UBTGRU:<conn_handle>,<value_handle>,<hex_data>
Successful read response.
Defined values
Parameter
Type
Description
start
integer
Start handle.
end
integer
End handle.
conn_handle
integer
Bluetooth Low Energy connection handle.
uuid
byte_array
UUID of attribute. Either 16-bit or 128-bit.
value_handle
integer
Attribute handle of the characteristic value.
hex_data
byte_array
Characteristic data in hexadecimal form. For example, 070809AABBCC

6.1.7 AT+UBTGW - GATT Write

Write a characteristic value.
Syntax
AT Command
Description
AT+UBTGW=<conn_handle>,<value_handle>,<hex_data>
Write the characteristic value.
Defined values
Parameter
Type
Description
conn_handle
integer
Bluetooth Low Energy connection handle.
value_handle
integer
Attribute handle of the characteristic value.
hex_data
byte_array
Characteristic data in hexadecimal form. For example, 070809AABBCC

6.1.8 AT+UBTGCCW - GATT Client Configuration Write

Write characteristic configuration to enable notifications or indications.
Syntax
AT Command
Description
AT+UBTGCCW=<conn_handle>,<desc_handle>,<config>
Writes the client characteristic configuration.
Defined values
Parameter
Type
Description
desc_handle
integer
Descriptor handle.
config
enumerator
Valid values:
0: None
1: Enable notifications
2: Enable indications
3: Enable notifications and indications
conn_handle
integer
Bluetooth Low Energy connection handle.

6.1.9 AT+UBTGWNR - GATT Write with No Response

Write the characteristic with no response message from the remote side.
Syntax
AT Command
Description
AT+UBTGWNR=<conn_handle>,<value_handle>,<hex_data>
Write characteristic.
Defined values
Parameter
Type
Description
conn_handle
integer
Bluetooth Low Energy connection handle.
value_handle
integer
Attribute handle of the characteristic value.
hex_data
byte_array
Characteristic data in hexadecimal form. For example, 070809AABBCC

6.1.10 AT+UBTGWL - GATT Write long

Write a long characteristic.
Syntax
AT Command
Description
AT+UBTGWL=<conn_handle>,<value_handle>,<hex_data>,<reliable>,<flag>,<offset>
Write long characteristic.
Defined values
Parameter
Type
Description
reliable
enumerator
Valid values:
0: Not reliable
1: Reliable
flag
enumerator
Valid values:
0: Final data
1: More data
2: Cancel
offset
integer
conn_handle
integer
Bluetooth Low Energy connection handle.
value_handle
integer
Attribute handle of the characteristic value.
hex_data
byte_array
Characteristic data in hexadecimal form. For example, 070809AABBCC

6.2 Unsolicited Response Codes

Unsolicited Response Code
Description
Event GATT Client Notification
Event GATT Client Indication

6.2.1 +UEBTGCN - Event GATT Client Notification

GATT Client Notification. This event is received when the remote side sends a notification.
Syntax
+UEBTGCN:<conn_handle>,<value_handle>,<hex_data>
Defined values
Parameter
Type
Description
conn_handle
integer
Bluetooth Low Energy connection handle.
value_handle
integer
Attribute handle of the characteristic value.
hex_data
byte_array
Characteristic data in hexadecimal form. For example, 070809AABBCC

6.2.2 +UEBTGCI - Event GATT Client Indication

GATT Client Indication. This event is received when the remote side sends an indication.
Syntax
+UEBTGCI:<conn_handle>,<value_handle>,<hex_data>
Defined values
Parameter
Type
Description
conn_handle
integer
Bluetooth Low Energy connection handle.
value_handle
integer
Attribute handle of the characteristic value.
hex_data
byte_array
Characteristic data in hexadecimal form. For example, 070809AABBCC
Last updated: 04 March 2025
Need help?Contact Support
Questions?Contact us