跳转至

遥控器介绍

遥控器蓝牙连接

使用 bluetoothctl 命令行工具连接蓝牙手柄可以分为几个步骤。以下是一个详细的教程:

  1. 确保蓝牙适配器已启用

    首先,确保你的蓝牙适配器已启用。你可以使用以下命令检查蓝牙状态:

    sudo systemctl status bluetooth
    

    如果蓝牙服务未运行,可以使用以下命令启动它:

    sudo systemctl start bluetooth
    
  2. 进入 bluetoothctl 交互模式 打开终端并输入以下命令进入 bluetoothctl 交互模式:

    bluetoothctl
    

  3. 打开蓝牙控制器 在 bluetoothctl 交互模式中,输入以下命令打开蓝牙控制器:

    power on
    

  4. 启动扫描 输入以下命令启动蓝牙设备扫描:

    scan on 
    
    此时,bluetoothctl 会开始扫描附近的蓝牙设备,并显示它们的 MAC 地址和名称。记下你要连接的手柄的 MAC 地址。

  5. 停止扫描 找到手柄的 MAC 地址后,输入以下命令停止扫描:

    scan off
    

  6. 配对手柄 输入以下命令配对手柄(将 98:B6:E8:4C:24:EC 替换为手柄的 MAC 地址):

    pair 98:B6:E8:4C:24:EC
    

  7. 信任手柄 为了确保手柄在下次连接时自动配对,输入以下命令信任手柄:

    trust 98:B6:E8:4C:24:EC
    

  8. 连接手柄 输入以下命令连接手柄:

    connect 98:b6:e8:4c:24:ec
    

  9. 退出 bluetoothctl 完成上述步骤后,输入以下命令退出 bluetoothctl 交互模式:

    exit
    

  10. 验证连接 你可以使用以下命令验证手柄是否已成功连接:

    bluetoothctl info 98:B6:E8:4C:24:EC
    
    这将显示手柄的详细信息,包括连接状态。

完整示例

以下是一个完整的示例流程:

sudo systemctl start bluetooth
bluetoothctl
[bluetooth]# power on
[bluetooth]# scan on
[NEW] Device 98:B6:E8:4C:24:EC Gamesir-T4pro_24EC
[bluetooth]# scan off
[bluetooth]# pair 98:B6:E8:4C:24:EC
[bluetooth]# trust 98:B6:E8:4C:24:EC
[bluetooth]# connect 98:B6:E8:4C:24:EC
[bluetooth]# exit