本文介绍了Gatttool非交互模式,多个char-write-req的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想检索一个小脚架的数据.我想听2个独立的uuid.在交互模式下,我将使用

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

但是,当我将其用作perl脚本的一部分时,我想利用非交互模式.

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

使用单个手柄启动gatttool可以正常工作:

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

谢谢!

推荐答案

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

有把戏!

这篇关于Gatttool非交互模式,多个char-write-req的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 14:39