gatttool Userguide

来源:互联网 发布:352空气净化器 知乎 编辑:程序博客网 时间:2024/05/17 06:44

http://i-miss-erin.blogspot.in/2010/12/gatttool-in-bluez-over-bredr.html

http://stackoverflow.com/questions/15657007/bluetooth-low-energy-listening-for-notifications-indications-in-linux


root@raspberrypi:/home/pi# gatttool -b E3:40:61:BB:F8:39 -t random -I
[E3:40:61:BB:F8:39][LE]> connect
Attempting to connect to E3:40:61:BB:F8:39
Connection successful
[E3:40:61:BB:F8:39][LE]> primary
attr handle: 0x0001, end grp handle: 0x0007 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x0008, end grp handle: 0x000b uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x000c, end grp handle: 0x0011 uuid: 6e400001-b5a3-f393-e0a9-e50e24dcca9e
attr handle: 0x0012, end grp handle: 0xffff uuid: 00001530-1212-efde-1523-785feabcd123
[E3:40:61:BB:F8:39][LE]> characteristic
handle: 0x0002, char properties: 0x0a, char value handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb
handle: 0x0004, char properties: 0x02, char value handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb
handle: 0x0006, char properties: 0x02, char value handle: 0x0007, uuid: 00002a04-0000-1000-8000-00805f9b34fb
handle: 0x0009, char properties: 0x20, char value handle: 0x000a, uuid: 00002a05-0000-1000-8000-00805f9b34fb
handle: 0x000d, char properties: 0x10, char value handle: 0x000e, uuid: 6e400003-b5a3-f393-e0a9-e50e24dcca9e
handle: 0x0010, char properties: 0x0c, char value handle: 0x0011, uuid: 6e400002-b5a3-f393-e0a9-e50e24dcca9e
handle: 0x0013, char properties: 0x04, char value handle: 0x0014, uuid: 00001532-1212-efde-1523-785feabcd123
handle: 0x0015, char properties: 0x18, char value handle: 0x0016, uuid: 00001531-1212-efde-1523-785feabcd123
handle: 0x0018, char properties: 0x02, char value handle: 0x0019, uuid: 00001534-1212-efde-1523-785feabcd123
[E3:40:61:BB:F8:39][LE]> char-write-req 0x000f 0100
Characteristic value was written successfully
Notification handle = 0x000e value: 5b 15 00 4e
Notification handle = 0x000e value: 5b 15 00 4e
Notification handle = 0x000e value: 5b 1c 01
Notification handle = 0x000e value: 5b 1c 02
Notification handle = 0x000e value: 5b 1c 01
Notification handle = 0x000e value: 5b 1c 02
Notification handle = 0x000e value: 5b 1c 01
Notification handle = 0x000e value: 5b 1c 02
Notification handle = 0x000e value: 5b 15 00 4e
[E3:40:61:BB:F8:39][LE]> char-write-req 0x0011 5a02
Characteristic value was written successfully
Notification handle = 0x000e value: 5b 02 00 38 30 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Notification handle = 0x000e value: 5b 15 00 4e
Notification handle = 0x000e value: 5b 15 00 4e
[E3:40:61:BB:F8:39][LE]> char-write-req 0x0011 5a03
Characteristic value was written successfully
Notification handle = 0x000e value: 5b 03 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00
Notification handle = 0x000e value: 5b 15 00 4e
[E3:40:61:BB:F8:39][LE]> char-write-req 0x0011 5a14
Characteristic value was written successfully
Notification handle = 0x000e value: 5b 14 00 00 56 32 2e 30 2e 34
Notification handle = 0x000e value: 5b 15 00 4e
[E3:40:61:BB:F8:39][LE]> char-write-req 0x0011 5a15
Characteristic value was written successfully
Notification handle = 0x000e value: 5b 15 00 4e
Notification handle = 0x000e value: 5b 15 00 4e
[E3:40:61:BB:F8:39][LE]> char-write-req 0x0011 5a1700ff0000
Characteristic value was written successfully
Notification handle = 0x000e value: 5b 17
Notification handle = 0x000e value: 5b 15 00 4e
[E3:40:61:BB:F8:39][LE]> char-write-req 0x0011 5a170000ff00
Characteristic value was written successfully
Notification handle = 0x000e value: 5b 17
Notification handle = 0x000e value: 5b 15 00 4e
[E3:40:61:BB:F8:39][LE]> char-write-req 0x0011 5a17000000ff
Characteristic value was written successfully
Notification handle = 0x000e value: 5b 17
Notification handle = 0x000e value: 5b 15 00 4e
Notification handle = 0x000e value: 5b 15 00 4e
[E3:40:61:BB:F8:39][LE]> char-write-req 0x0011 5a1f
Characteristic value was written successfully
Notification handle = 0x000e value: 5b 1f 01
[E3:40:61:BB:F8:39][LE]>exit

0 0
原创粉丝点击