# 基于 GATT 配置文件的 Human Interface Device

Source: [https://docs.qualcomm.com/doc/80-70017-13SC/topic/bluez-hogp.html](https://docs.qualcomm.com/doc/80-70017-13SC/topic/bluez-hogp.html)

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

## 设置 HOGP 功能的设备

**前提条件**

- 启用 SSH 以访问您的主机设备。相关说明，可参见[使用 SSH 登录](https://docs.qualcomm.com/bundle/publicresource/topics/80-70017-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.222Copy to clipboard
2. 输入以下密码来连接 SSH： 

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

        bluetoothctlCopy to clipboard

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

    **示例输出**

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

        power onCopy 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: yesCopy to clipboard

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

- **[执行蓝牙 HOGP 功能](https://docs.qualcomm.com/doc/80-70017-13SC/topic/bluez-perform-bluetooth-hogp-functions.html)**  

可以使用 `bluetoothctl` 选项和 evtest 工具执行 HOGP 功能。

**上一级主题：** [验证 BlueZ 堆栈的功能](https://docs.qualcomm.com/doc/80-70017-13SC/topic/verify-bluetooth-functionality-of-bluez-stack.html)

Last Published: Jan 23, 2025

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