Datasheet
BLE GATT
GATT (http://adafru.it/iCp), which standards for the Generic ATTribute Profile, governs data organization and data exchanges between connected
devices. One device (the peripheral) acts as a GATT Server, which stores data in Attribute records, and the second device in the connection (the
central) acts as a GATT Client, requesting data from the server whenever necessary.
The following commands can be used to create custom GATT services and characteristics on the BLEFriend, which are used to store and
exchange data.
Please note that any characteristics that you define here will automatically be saved to non-volatile FLASH config memory on the device and re-
initialised the next time the device starts.
You need to perform a system reset via 'ATZ' before most of the commands below will take effect!
GATT Limitations
The commands below have the following limitations due to SRAM and resource availability, which should be kept in mind when creating or
working with customer GATT services and characteristics.
These values apply to firmware 0.7.0 and higher:
Maximum number of services: 10
Maximum number of characteristics: 30
Maximum buffer size for each characteristic: 32 bytes
Maximum number of CCCDs: 16
If you want to clear any previous config value, enter the 'AT+FACTORYRESET' command before working on a new peripheral configuration.
AT+GATTCLEAR
Clears any custom GATT services and characteristics that have been defined on the device.
Codebase Revision: 0.3.0
Parameters: None
Response: None
AT+GATTCLEAR
OK
AT+GATTADDSERVICE
Adds a new custom service definition to the device.
Codebase Revision: 0.3.0
Parameters: This command accepts a set of comma-separated key-value pairs that are used to define the service properties. The following key-
value pairs can be used:
UUID: The 16-bit UUID to use for this service. 16-bit values should be in hexadecimal format (0x1234).
UUID128: The 128-bit UUID to use for this service. 128-bit values should be in the following format: 00-11-22-33-44-55-66-77-88-99-AA-BB-
CC-DD-EE-FF
Response: The index value of the service in the custom GATT service lookup table. (It's important to keep track of these index values to work with
the service later.)
Note: Key values are not case-sensitive
Only one UUID type can be entered for the service (either UUID or UUID128)
# Clear any previous custom services/characteristics
AT+GATTCLEAR
OK
# Add a battery service (UUID = 0x180F) to the peripheral
AT+GATTADDSERVICE=UUID=0x180F
© Adafruit Industries
https://learn.adafruit.com/introducing-the-adafruit-bluefruit-le-uart-
friend
Page 88 of 115