【问题标题】:WowWee MiP command over Bluetooth in Linux Shell with gatttool使用 gatttool 在 Linux Shell 中通过蓝牙的 WowWee MiP 命令
【发布时间】:2014-08-27 20:50:00
【问题描述】:

我尝试使用 Linux shell 命令 (Ubuntu 14.04) 来命令我的 MiP 机器人。

在尝试此之前,我使用了官方的 Android 应用程序,并且我已经使用 Android 开发人员选项中集成的“Snoop HCI 蓝牙日志”嗅探了所有蓝牙数据包。

当我使用这个应用程序向我的机器人下达左转命令(例如)时,应用程序似乎发送:

Opcode: Write Command (0x52)
Handle: 0x0013
Value: 7800XX (replacing XX by some different value according the direction)

这在 Wireshark 中可见(我无法发布图片...)。

我尝试在 shell 中使用 gatttool 重现此问题。

使用此工具,语法为:

char-write-cmd <cmd> <handle> value

我已经尝试过使用不同的值,如下所示:

[CON][EE:AA:BB:A2:FE:FF][LE]> char-write-cmd 0x52 0x0013 0x78 0x00 0x60
[CON][EE:AA:BB:A2:FE:FF][LE]> char-write-cmd 0x52 0x0013 0x780060
[CON][EE:AA:BB:A2:FE:FF][LE]> char-write-cmd 0x52 0x0013 78 00 60
[CON][EE:AA:BB:A2:FE:FF][LE]> char-write-cmd 0x52 0x0013 0x60 0x00 0x78
[CON][EE:AA:BB:A2:FE:FF][LE]> char-write-cmd 0x52 0x0013 0x600078
[CON][EE:AA:BB:A2:FE:FF][LE]> char-write-cmd 0x52 0x0013 60 00 78

但是没有成功...

我的问题是:

如何为 value 参数发送多个字节?

最好的问候

PiF

PS:对不起我的英语不好:)

【问题讨论】:

    标签: android linux shell bluetooth


    【解决方案1】:

    我找到了我的问题的答案。也许这可以帮助某人。

    正确的语法命令是:

    [CON][EE:AA:BB:A2:FE:FF][LE]> char-write-cmd 0x0013 780060
    

    命令

    char-write-cmd
    

    始终放置 0x52(gatt 或蓝牙)操作码命令

    希望对您有所帮助。

    【讨论】:

      【解决方案2】:

      您可能对位于https://github.com/WowWeeLabs/MiP-BLE-Protocol 的官方蓝牙规范感兴趣,这应该提供有关 hte 命令的良好文档。

      【讨论】:

        猜你喜欢
        • 2013-07-24
        • 1970-01-01
        • 2016-09-12
        • 2016-05-07
        • 2017-12-04
        • 1970-01-01
        • 2014-07-12
        • 2016-05-08
        相关资源
        最近更新 更多