Skip to content

BLE ReadWrite

Uffe Björklund edited this page Jun 16, 2015 · 9 revisions

By using gatttool we can now read data with char-read-hnd <hex handle>, and write data with char-write-cmd <hex handle> <new value>

First we enable the IR-Temperature service by writing 01 to handle 0x24 (0x29 if you have CC2541).

char-write-cmd 0x24 01

Then we enable read-notification for the IR-Temperature by reading from handle 0x21 (0x25 if you have CC2541)

char-read-hnd 0x21

Next we enable notification for the IR-Temperature by writing 01:00 to handle 0x22 (0x26 if you have CC2541)

char-write-cmd 0x22 01:00

We will now start to see IR-Temperature data like

Notification handle = 0x0021 value: 4c 09 24 0b
Notification handle = 0x0021 value: 7c 09 28 0b
Notification handle = 0x0021 value: 6c 09 28 0b
Notification handle = 0x0021 value: 64 09 28 0b
Notification handle = 0x0021 value: 7c 09 28 0b
Notification handle = 0x0021 value: 6c 09 28 0b
Notification handle = 0x0021 value: 88 09 28 0b
Notification handle = 0x0021 value: 70 09 28 0b
Notification handle = 0x0021 value: 70 09 28 0b
Notification handle = 0x0021 value: 84 09 28 0b

And if we disable notifications by writing 00:00 to handle 0x22 (0x26 if you have CC2541) the information will stop.

char-write-cmd 0x22 00:00


GATT TABLES

TI-CC2541/CC2650

GATT-Server CC2541
GATT-Server CC2650

next

Clone this wiki locally