在 Linux 中,我曾经使用“hidd --connect mmac”来连接 BT 设备,但自 Bluez5 以来,这种情况已经消失了。
我可以使用 bluetoothctl 手动建立连接,但我需要从我的应用程序使用这些命令,并且使用 bluetoothctl 会很困难。
执行 bluetoothctl 操作的 hcitool 等效命令有哪些?
例如,我会输入 bluetoothctl:
select <cmac>
scan on
trust <mmac>
pairable on
pair <mmac>
connect <mmac>
我可以使用“hcitool scan”进行扫描,但我还没有弄清楚连接。
我尝试使用“hcitool cc mmac”,然后使用“hcitool auth mmac”,但没有任何效果。
或者 hcitool 可以做 bluetoothctl 所做的事情吗?
我在用蓝牙控制来自这样的脚本:
#!/bin/bash
bluetoothctl << EOF
power on
EOF
并且可以将多个命令指定为每行一个命令。
奇怪的是,它does not对我来说这样工作:
echo "power on" | bluetoothctl
(我正在使用 bluez-5.21-r1 - 不确定这是否与版本相关)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)