Gatttool Non-Interactive mode, multiple char-write-req

亡梦爱人 提交于 2021-01-29 18:53:04

问题


I would like to retrieve the data of a stryd footpod. I would like to listen to 2 separate uuid's. In interactive mode, I would connect using

sudo gatttool -t random -b XX:XX:XX:XX:XX:XX -I
connect
char-write-req 0x001a 0100
char-write-req 0x000f 0100

However, as I use this as part of a perl script, I would like to leverage non-interactive mode.

Starting gatttool with a single handle works fine:

gatttool -t random -i hci0 -b XX:XX:XX:XX:XX:XX --char-write-req --handle=0x001a  --value=0100 --listen

However how do I pass both handles at the same time? Following does not work.

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

Thanks!


回答1:


Found the solution on 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

Does the trick!



来源:https://stackoverflow.com/questions/58814890/gatttool-non-interactive-mode-multiple-char-write-req

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!