如何使用 gatttool 非交互模式 [英] How to use gatttool non-interactive mode

查看:17
本文介绍了如何使用 gatttool 非交互模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在非交互模式下编写 gatttool.

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.

使用非交互模式的等价物是什么?我这样试过,但它不会改变光的颜色,要阻止它,我必须使用 ctrl+c.根本没有消息.

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

如何编写命令?

我正在使用 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

这篇关于如何使用 gatttool 非交互模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆