BT
<h3>一、启动和管理蓝牙服务</h3>
<p>1.启动蓝牙服务: <code>systemctl start bluetooth</code>
2.设置蓝牙服务开机自启:<code>systemctl enable bluetooth</code>
3.检查蓝牙服务状态:<code>systemctl status bluetooth</code></p>
<h3>二、使用命令行工具bluetoothctl配置和管理蓝牙设备</h3>
<p>1.输入 <code>bluetoohctl</code> 进入交互页面</p>
<ol>
<li><code>power on</code> 开启蓝牙</li>
<li><code>discoverable on</code> 使机器蓝牙可以被其他蓝牙设备发现</li>
<li><code>show</code> 查看蓝牙状态
<img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=46c257c0cf723b30111781d085e7a35a&amp;file=file.PNG" alt="" />
5.<code>scan on</code> 显示可以识别到的蓝牙设备
<img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=441b5802ec26d03d95b6a267ff4764ed&amp;file=file.PNG" alt="" />
6.<code>connect</code> 蓝牙MAC地址 进行蓝牙连接
<img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=9090dbfd7348b8962ae04ed942969fe3&amp;file=file.PNG" alt="" /></li>
</ol>