我想检索stryd footpod的数据。我想听两个不同的uuid。在交互模式下,我会使用
sudo gatttool -t random -b XX:XX:XX:XX:XX:XX -I
connect
char-write-req 0x001a 0100
char-write-req 0x000f 0100但是,由于我将其用作perl脚本的一部分,因此我希望利用非交互模式。
使用单个句柄启动gatttool可以很好地工作:
gatttool -t random -i hci0 -b XX:XX:XX:XX:XX:XX --char-write-req --handle=0x001a --value=0100 --listen但是,如何同时传递这两个句柄?以下内容不起作用。
gatttool -t random -i hci0 -b XX:XX:XX:XX:XX:XX --char-write-req --handle=0x001a --value=0100 --char-write-req --handle=0x000f --value=0100 --listen谢谢!
发布于 2019-11-14 03:01:19
在http://www.humbug.in/2014/using-gatttool-manualnon-interactive-mode-read-ble-devices/上找到了解决方案
gatttool -t random -i hci0 -b XX:XX:XX:XX:XX:XX --char-write-req --handle=0x001a --value=0100; sleep 1; gatttool -t random -i hci0 -b XX:XX:XX:XX:XX:XX --char-write-req --handle=0x000f --value=0100 --listen成功了!
https://stackoverflow.com/questions/58814890
复制相似问题