Datasheet

Command Examples
The following code snippets can be used when operating in Command Mode to perform
specific tasks.
Heart Rate Monitor Service
The command list below will add a Heart Rate service to the BLEFriend's attribute table, with
two characteristics:
Heart Rate Measurement
Body Sensor Location
# Perform a factory reset to make sure we get a clean start
AT+FACTORYRESET
OK
# Add the Heart Rate service entry
AT+GATTADDSERVICE=UUID=0x180D
1
OK
# Add the Heart Rate Measurement characteristic
AT+GATTADDCHAR=UUID=0x2A37, PROPERTIES=0x10, MIN_LEN=2, MAX_LEN=3, VALUE=00-40
1
OK
# Add the Body Sensor Location characteristic
AT+GATTADDCHAR=UUID=0x2A38, PROPERTIES=0x02, MIN_LEN=1, VALUE=3
2
OK
# Create a custom advertising packet that includes the Heart Rate service UUID
AT+GAPSETADVDATA=02-01-06-05-02-0d-18-0a-18
OK
# Reset the device to start advertising with the custom payload
ATZ
OK
# Update the value of the heart rate measurement (set it to 0x004A)
AT+GATTCHAR=1,00-4A
OK
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-m0-bluefruit-le Page 192 of 238