Datasheet

# Start gatttool, pointing to the UART device found above
$ sudo gatttool -b D6:4E:06:4F:72:86 -I -t random --sec-level=high
[D6:4E:06:4F:72:86][LE]> connect
Attempting to connect to D6:4E:06:4F:72:86
Connection successful
# Scan for primary GATT Services
[D6:4E:06:4F:72:86][LE]> primary
attr handle: 0x0001, end grp handle: 0x0007 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x0008, end grp handle: 0x0008 uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x0009, end grp handle: 0x000e uuid: 6e400001-b5a3-f393-e0a9-e50e24dcca9e
attr handle: 0x000f, end grp handle: 0xffff uuid: 0000180a-0000-1000-8000-00805f9b34fb
# Get the handles for the entries in the UART service (handle 0x0009)
[D6:4E:06:4F:72:86][LE]> char-desc
handle: 0x0001, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x0002, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb
handle: 0x0004, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb
handle: 0x0006, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0007, uuid: 00002a04-0000-1000-8000-00805f9b34fb
handle: 0x0008, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x0009, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x000a, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x000b, uuid: 6e400002-b5a3-f393-e0a9-e50e24dcca9e
handle: 0x000c, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x000d, uuid: 6e400003-b5a3-f393-e0a9-e50e24dcca9e
handle: 0x000e, uuid: 00002902-0000-1000-8000-00805f9b34fb
handle: 0x000f, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x0010, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0011, uuid: 00002a27-0000-1000-8000-00805f9b34fb
# 6e400002 (handle 0x000b) = TX characteristic
# 6e400003 (handle 0x000d) = RX characteristic
# Optional (but maybe helpful) ... scan for CCCD entries
[D6:4E:06:4F:72:86][LE]> char-read-uuid 2902
handle: 0x000e value: 00 00
# Enable notifications on the RX characteristic (CCCD handle = 0x000e)
# 0100 = get notifications
# 0200 = get indications
# 0300 = get notifications + indications
# 0000 = disable notifications + indications
[D6:4E:06:4F:72:86][LE]> char-write-req 0x000e 0100
Characteristic value was written successfully
# Just to make sure it was updated
[D6:4E:06:4F:72:86][LE]> char-read-hnd 0x000e
Characteristic value/descriptor: 01 00
# Writing "test" in the Serial Monitor of the Arduino sketch should
# cause this output not that notifications are enabled:
Notification handle = 0x000d value: 74 65 73 74
# Write something to the TX characteristic (handle = 0x000b)
# This should cause E F G H to appear in the Serial Monitor
[D6:4E:06:4F:72:86][LE]> char-write-cmd 0x000b 45
[D6:4E:06:4F:72:86][LE]> char-write-cmd 0x000b 46
[D6:4E:06:4F:72:86][LE]> char-write-cmd 0x000b 47
[D6:4E:06:4F:72:86][LE]> char-write-cmd 0x000b 48
# To send multiple bytes
[D6:4E:06:4F:72:86][LE]> char-write-cmd 0x000B 707172737475
# If you are running the callbackEcho sketch and notifications
# are enabled you should get this response after the above cmd:
Notification handle = 0x000d value: 70 71 72 73 74 75
--------------
# If you just want to enable constant listening, enter the following command from the CLI:
$ sudo gatttool -b D6:4E:06:4F:72:86 -t random --char-write-req -a 0x000e -n 0100 --listen
# This should give us the following output as data is written on the Uno,
# though we can't send anything back:
Characteristic value was written successfully
Notification handle = 0x000d value: 74 65 73 74
Notification handle = 0x000d value: 6d 6f 72 65 20 74 65 73 74
© Adafruit Industries
https://learn.adafruit.com/introducing-the-adafruit-bluefruit-le-uart-
friend
Page 110 of 115