# 基于 GATT Profile 的人机接口设备

HOGP 定义低功耗蓝牙无线通信设备如何使用 GATT 通过低功耗蓝牙协议栈支持 HID 服务。

## 设置 HOGP 功能的设备

**前提条件**

- 启用 SSH 以访问您的主机设备。有关说明，请参阅[使用 SSH 登录](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-254/how_to.html#use-ssh)。
- 将 DUT 和远程设备放置在蓝牙附近。

**步骤**

1. 在命令提示符下使用以下命令运行 SSH：

ssh root@<device_IP_address>
        Copy to clipboard

    **示例**

    如果设备的 IP 地址为 `10.92.160.222`，则运行以下命令：

ssh root@10.92.160.222
        Copy to clipboard
2. 输入以下密码来连接 SSH：

oelinux123
        Copy to clipboard
3. 通过运行以下命令打开蓝牙测试应用程序：

bluetoothctl
        Copy to clipboard

    您可以通过 **bluetoothctl** 的主菜单选项执行一些 GATT 功能，例如连接和扫描。

    **示例输出**

sh-5.1# bluetoothctl
        Agent registered        uetoothd...
        [CHG] Controller 22:22:F1:C1:99:C0 Pairable: yes
        Copy to clipboard
4. 运行以下命令，启用蓝牙：

power on
        Copy to clipboard

    **示例输出**

[bluetooth]# power on
        [CHG] Controller 22:22:F1:C1:99:C0 Class: 0x007c0000
        Changing power on succeeded
        [CHG] Controller 22:22:F1:C1:99:C0 Powered: yes
        Copy to clipboard

    有关 HOGP 功能，请参阅[执行蓝牙 HOGP 功能](https://docs.qualcomm.com/doc/80-70020-13SC/topic/bluez-perform-bluetooth-hogp-functions.html#bluez-perform-bluetooth-hogp-functions)。

## 后续步骤

- [执行蓝牙 HOGP 功能](https://docs.qualcomm.com/doc/80-70020-13SC/topic/bluez-perform-bluetooth-hogp-functions.html)
可以使用 `bluetoothctl` 选项和 evtest 工具执行 HOGP 功能。

Last Published: Jul 22, 2025

[Previous Topic
执行低功耗蓝牙 GATT 客户端功能](https://docs.qualcomm.com/bundle/publicresource/80-70020-13SC/topics/bluez-perform-bluetooth-low-energy-gatt-client-functions.md) [Next Topic
执行蓝牙 HOGP 功能](https://docs.qualcomm.com/bundle/publicresource/80-70020-13SC/topics/bluez-perform-bluetooth-hogp-functions.md)