linux – bluetoothctl到hcitool等效命令

linux – bluetoothctl到hcitool等效命令,第1张

概述在 Linux中,我曾经使用“hidd –connect mmac”来连接BT设备,但是现在它已经从Bluez5开始消失了. 我可以使用bluetoothctl手动建立连接但我需要从我的应用程序使用这些命令并使用bluetoothctl将是困难的. 什么是hcitool等效命令来做bluetoothctl做的事情? 例如,我输入bluetoothctl: select <cmac>scan on 在 Linux中,我曾经使用“hIDd –connect mmac”来连接BT设备,但是现在它已经从Bluez5开始消失了.
我可以使用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等效命令所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1047738.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存