【发布时间】: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