> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 执行蓝牙 HOGP 功能

> 您可以使用 ``bluetoothctl`` 选项和 evtest 工具执行 HOGP 功能。蓝牙 HOGP 功能允许您连接远程设备、验证 HOGP 功能以及断开与设备的连接。

## 前提条件

开始之前，请按照 <a href="verify-hogp-functions#set-up-the-device-for-hogp-functions" target="_self">为 HOGP 功能设置设备</a> 中的说明设置您的设备。

## 连接远程设备

要连接远程设备，请在 `bluetoothctl` 菜单中运行以下命令：

```text theme={null}
connect <bt_address>
```

**参数**

`<bt_address>` 是远程设备的蓝牙地址。

**示例**

要连接 `<bt_address>` 为 `30:73:00:41:22:49` 的已配对远程设备，请运行以下命令：

```text theme={null}
connect 30:73:00:41:22:49
```

**示例输出**

```text theme={null}
[bluetooth]# connect 30:73:00:41:22:49
Attempting to connect to 30:73:00:41:22:49
[CHG] Device 30:73:00:41:22:49 Connected: yes
[CHG] Device 30:73:00:41:22:49 Modalias: usb:v04E8p7021d0001
[CHG] Device 30:73:00:41:22:49 UUIDs: 00001000-0000-1000-8000-00805f9b34fb
[CHG] Device 30:73:00:41:22:49 UUIDs: 00001124-0000-1000-8000-00805f9b34fb
[CHG] Device 30:73:00:41:22:49 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 30:73:00:41:22:49 ServicesResolved: yes
[CHG] Device 30:73:00:41:22:49 WakeAllowed: yes
Connection successful
```

## 验证 HOGP 功能

evtest 工具是用于验证 HOGP 功能的开源工具。它监控和查询输入设备（如鼠标或键盘）的设备事件。

<Note>
  evtest 工具在用户版本（user build）中不可用。要验证 HOGP 功能，请从开源代码编译该工具并将其推送到 DUT。
</Note>

**示例**

要验证蓝牙无线鼠标的功能，请执行以下操作：

1. 打开蓝牙无线鼠标。

2. 在 DUT 上针对蓝牙无线鼠标运行<a href="perform-bluetooth-low-energy-gatt-client-functions#start-bluetooth-low-energy-gatt-scan" target="_self">低功耗扫描</a>。

3. <a href="#connect-a-remote-device" target="_self">将 DUT 连接</a>到蓝牙无线鼠标。

4. 在 SSH 中运行 evtest 工具。

5. 从屏幕上显示的已连接输入设备列表中选择蓝牙无线鼠标。

6. 使用鼠标并执行不同的操作，例如单击、滚动、拖动和移动。

7. 验证屏幕上为每个操作打印的事件。

## 断开远程设备

要断开远程设备，请在 `bluetoothctl` 菜单中运行以下命令：

```text theme={null}
disconnect <bt_address>
```

**参数**

`<bt_address>` 是远程设备的蓝牙地址。

**示例**

要断开 `<bt_address>` 为 `30:73:00:41:22:49` 的已配对远程设备，请运行以下命令：

```text theme={null}
disconnect 30:73:00:41:22:49
```

**示例输出**

```text theme={null}
[MyBTkeyboard]# disconnect 30:73:00:41:22:49
Attempting to disconnect from 30:73:00:41:22:49
[CHG] Device 30:73:00:41:22:49 ServicesResolved: no
Successful disconnected
[CHG] Device 30:73:00:41:22:49 Connected: no
```
