4

I want to write gatttool in non-interactive mode.

$ sudo gatttool -i hci0 -b 78:A5:04:44:0A:57 -I
[78:A5:04:44:0A:57][LE]> connect
Attempting to connect to 78:A5:04:44:0A:57
Connection successful
[78:A5:04:44:0A:57][LE]> char-write-cmd 0x0025 ff

I'm changing color of light that is using bluetooth.

What is the equivalent by using non-interactive mode? I tried like this, but it doesn't change the color of light and to stop it I must use ctrl+c. There is no message at all.

sudo gatttool -i hci0 -b 78:A5:04:44:0A:57 --char-write -a 0x0025 -n ff

How can I write the command?

Environment:

I'm using Raspberry Pi and Rasbian.

ironsand
  • 14,329
  • 17
  • 83
  • 176

1 Answers1

4

the option is not --char-write but a --char-write-req.

Total command must be:

sudo gatttool -i hci0 -b 78:A5:04:44:0A:57 --char-write-req -a 0x0025 -n ff
ironsand
  • 14,329
  • 17
  • 83
  • 176