GATT Heart Rate Service (HRS) Client

The GATT Heart Rate Service Client is used to retrieve information about heart rate measurements.

Overview

The GATT HRS Client can retrieve information such as the sensor location from a device that provides the Heart Rate Service. It can also configure the Heart Rate Service on a remote device by writing specific values to the Heart Rate Control Point characteristic.

Configuration

Applications use the Bluetooth LE scanning for detecting advertising devices that support the Heart Rate Service. If an advertising device is detected, the application connects to it automatically and starts receiving HRS data.

Once a connection with a remote device providing a Heart Rate Service is established, the client needs service discovery to discover Heart Rate Service handles. If this succeeds, the handles of the Heart Rate Service must be assigned to a HRS client instance using the bt_hrs_client_handles_assign() function. Now, the application is ready to operate with the remote Heart Rate Service.

Usage

Retrieve data from the Heart Rate Service or configure its behavior using the following functions:

Samples using the library

The following nRF Connect SDK samples use this library:

Additional information

Do not use any of the values in the bt_hrs_client object structure directly. All values that should be accessed have accessory functions. The structure is fully defined because the application must be able to allocate memory for it.

Dependencies

API documentation

Header file: include/bluetooth/services/hrs_client.h
Source file: subsys/bluetooth/services/hrs_client.c
Heart Rate Service Client