我可以使用bluetoothctl手动建立连接但我需要从我的应用程序使用这些命令并使用bluetoothctl将是困难的.
什么是hcitool等效命令来做bluetoothctl做的事情?
例如,我输入bluetoothctl:
select <cmac>scan ontrust <mmac>pairable onpair <mmac>connect <mmac>
我可以使用“hcitool scan”进行扫描,但我还没想到要连接.
我尝试使用“hcitool cc mmac”后跟“hcitool auth mmac”,但没有任何效果.
或者hcitool可以做bluetoothctl的工作吗?
解决方法 我在这样的脚本中使用bluetoothctl:#!/bin/bashbluetoothctl << EOFpower onEOF
并且可以将多个命令指定为每行一个命令.
奇怪的是,它对我来说不是这样的:
echo "power on" | bluetoothctl
(我使用的是bluez-5.21-r1 – 不确定这是否依赖于版本)
总结以上是内存溢出为你收集整理的linux – bluetoothctl到hcitool等效命令全部内容,希望文章能够帮你解决linux – bluetoothctl到hcitool等效命令所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)