GATT Human Interface Device Service (HIDS) Client

The HIDS Client uses the GATT Discovery Manager to acquire all attribute handles that are required to interact with the HIDS server.

Overview

Some additional data must be read from the discovered descriptors before the HIDS Client is ready. This process is started automatically just after the handles are assigned. If the process finishes successfully, the bt_hogp_ready_cb function is called. Otherwise, bt_hogp_prep_fail_cb is called.

Configuration

Use the following Kconfig options to configure the library:

Usage

You can use the GATT HIDS Client library to interact with a connected HIDS server.

Retrieving the HIDS Client readiness state

The following functions are available to retrieve the readiness state of the service client object:

Reading the report map

To read the report map, call the bt_hogp_map_read() function. If the report map does not fit into a single PDU, call the function repeatedly with different offsets.

The HIDS report map interpretation implemented in the HIDS Client is not specifically supported.

Accessing the reports

To read or write a report, use one of the following functions:

To manage input report notifications, use the following functions:

The report size is always updated before the callback function is called while reading or notifying. It can be obtained by calling bt_hogp_rep_size().

All report operations require a report info pointer as input. How to retrieve this pointer depends on whether you are processing a normal report or a boot report.

Call the bt_hogp_rep_next() function to retrieve the report info pointer. This function iterates through all detected reports (excluding boot reports).

Use the bt_hogp_rep_find() function to find a specific report. This function locates a report based on its type and ID.

Changing protocol mode

To manage protocol modes, use the following functions:

  • bt_hogp_pm_write() - Switch between Boot Protocol Mode and Report Protocol Mode.

    Every time the protocol mode is changed, the bt_hogp_pm_update_cb function is called.

  • bt_hogp_pm_get() - Retrieve the current protocol.

    This function returns the internally cached version of the current protocol mode.

  • bt_hogp_pm_update() - Update the protocol mode value directly from the device.

Suspending and resuming

To suspend or resume the connected device, call the following functions:

HID Shorter Connection Intervals (SCI)

When the CONFIG_BT_HOGP_SCI Kconfig option is enabled, the client discovers the HID SCI Information and HID SCI mode characteristics if the peer exposes them.

After the client is ready, use the bt_hogp_sci_supported() function to check whether the peer supports SCI. If the mandatory interval validation fails during SCI Information read, the client still becomes ready, but this function returns false.

This feature is in an experimental state.

The following functions are needed for host side SCI interaction:

Call the bt_hogp_sci_low_power_mode_supported() function before requesting Low Power mode using bt_hogp_sci_mode_req().

Samples using the library

The following nRF Connect SDK modules use this library:

The following nRF Connect SDK application uses this library:

Additional information

Do not access any of the values in the bt_hogp object structure directly. All values that should be accessed have accessor functions. The structure is fully defined to allow the application to allocate the memory for it.

Dependencies

This library uses GATT Discovery Manager.

When SCI support is enabled, the CONFIG_BT_SHORTER_CONNECTION_INTERVALS Kconfig option must also be enabled in the application.

API documentation

Header file: include/bluetooth/services/hogp.h
Source file: subsys/bluetooth/services/hogp.c
Bluetooth LE GATT HIDS Client API