【问题标题】:Gatttool Non-Interactive mode, multiple char-write-reqGatttool 非交互模式,多个 char-write-req
【发布时间】:2019-11-12 08:41:07
【问题描述】:

我想检索一个 stryd footpod 的数据。我想听 2 个单独的 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

谢谢!

【问题讨论】:

    标签: bluetooth-lowenergy gatttool


    【解决方案1】:

    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
    

    成功了!

    【讨论】:

      猜你喜欢
      • 2017-03-11
      • 1970-01-01
      • 2023-03-31
      • 1970-01-01
      • 1970-01-01
      • 2017-06-05
      • 2023-04-05
      • 1970-01-01
      • 2021-09-23
      相关资源
      最近更新 更多