Datasheet

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.)
# Clear any previous custom services/characteristics
AT+GATTCLEAR
OK
# Add a battery service (UUID = 0x180F) to the peripheral
AT+GATTADDSERVICE=UUID=0x180F
1
OK
# Add a battery measurement characteristic (UUID = 0x2A19), notify enabled
AT+GATTADDCHAR=UUID=0x2A19,PROPERTIES=0x10,MIN_LEN=1,VALUE=100
1
OK
# Clear any previous custom services/characteristics
AT+GATTCLEAR
OK
# Add a custom service to the peripheral
AT+GATTADDSERVICE=UUID128=00-11-00-11-44-55-66-77-88-99-AA-BB-CC-DD-EE-FF
1
OK
# Add a custom characteristic to the above service (making sure that there
# is no conflict between the 16-bit UUID and bytes 3+4 of the 128-bit service UUID)
AT+GATTADDCHAR=UUID=0x0002,PROPERTIES=0x02,MIN_LEN=1,VALUE=100
1
OK
AT+GATTADDCHAR
Adds a custom characteristic to the last service that was added to the peripheral (via AT+GATTADDSERVICE).
Note: Key values are not case-sensitive
Only one UUID type can be entered for the service (either UUID or UUID128)
AT+GATTADDCHAR must be run AFTER AT+GATTADDSERVICE, and will add the new characteristic to the
last service definition that was added.
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le Page 134 of 211