linux – bluetoothctl到hcitool等效命令
发布时间:2020-12-13 19:21:03 所属栏目:Linux 来源:网络整理
导读:在 Linux中,我曾经使用“hidd –connect mmac”来连接BT设备,但是现在它已经从Bluez5开始消失了. 我可以使用bluetoothctl手动建立连接但我需要从我的应用程序使用这些命令并使用bluetoothctl将是困难的. 什么是hcitool等效命令来做bluetoothctl做的事情? 例
在
Linux中,我曾经使用“hidd –connect mmac”来连接BT设备,但是现在它已经从Bluez5开始消失了.
我可以使用bluetoothctl手动建立连接但我需要从我的应用程序使用这些命令并使用bluetoothctl将是困难的. 什么是hcitool等效命令来做bluetoothctl做的事情? 例如,我输入bluetoothctl: select <cmac> scan on trust <mmac> pairable on pair <mmac> connect <mmac> 我可以使用“hcitool scan”进行扫描,但我还没想到要连接. 或者hcitool可以做bluetoothctl的工作吗? 解决方法
我在这样的脚本中使用bluetoothctl:
#!/bin/bash bluetoothctl << EOF power on EOF 并且可以将多个命令指定为每行一个命令. 奇怪的是,它对我来说不是这样的: echo "power on" | bluetoothctl (我使用的是bluez-5.21-r1 – 不确定这是否依赖于版本) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |