如何使用gatttool非交互模式

How to use gatttool non-interactive mode

我想在非交互模式下写gatttool

$ 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

我正在更改使用蓝牙的灯的颜色。

使用非交互模式相当于什么? 我试过这样,但它不会改变光的颜色,要停止它我必须使用 ctrl+c。完全没有消息。

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

命令怎么写?

环境:

我正在使用 Raspberry PiRasbian

选项不是 --char-write,而是 --char-write-req

总命令必须是:

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