准备

  1. 下载拥有bluetoothctl的程序软件,在archlinux上可以下载bluetooth-utils

  2. 启动蓝牙服务

1
2
systemctl enable bluetooth #开机自启
systemctl start bluetooth #开启服务
  1. 将用户加入lp组

1
usermod -a -G lp $USER

bluetoothctl

  1. 在终端输入bluetoothctl进入bluetoothctl的模式里

  2. power on (打开控制电源)

  3. agent on(打开代理)

  4. default-agent(打开默认代理) //可以进行自动连接已配对过的设备

  5. scan on(打开扫描)

  6. pair $设备Mac号 (进行配对)

  7. connect $设备Mac号 (手动连接)

  8. scan off(关闭扫描)

  9. exit(退出bluetooth模式)

设置自动启动蓝牙

/etc/bluetooth/main.conf最后的AutoEnable 值修改为true