Heart Rate Service (HRS) Client

This module implements the Heart Rate Service Client to retrieve Heart Rate Measurements and Body Sensor Location from a peripheral device with the Heart Rate Service (HRS).

Overview

The HRS Client retrieves information such as the sensor location from a device that provides the Heart Rate Service.

Configuration

Set the CONFIG_BLE_HRS_CLIENT Kconfig option to enable the service.

Set the maximum number of RR intervals for each HRM notification using the CONFIG_BLE_HRS_CLIENT_RR_INTERVALS_MAX_COUNT Kconfig option.

Initialization

The service instance is declared using the BLE_HRS_CLIENT_DEF macro, specifying the name of the instance. To initialize the service, call the ble_hrs_client_init() function. See the ble_hrs_client_config structure for configuration details, in addition to the HRS specification.

Usage

Applications can use the Bluetooth: Scan library for detecting advertising devices that support the Heart Rate Service.

Upon connection, the application can use the Bluetooth: Database Discovery library library to discover the peer’s database. Call the ble_hrs_on_db_disc_evt() function on callback events from the Database Discovery library. This function sends the BLE_HRS_CLIENT_EVT_DISCOVERY_COMPLETE event to the application if the Heart Rate Service is discovered in the peer’s database. The application must call the ble_hrs_client_handles_assign() function to associate the link with the HRS Client instance.

Upon Heart Rate Service discovery, the application can call the ble_hrs_client_hrm_notif_enable() function to request the peer to start sending Heart Rate Measurement notifications.

Dependencies

This service has the following Bare Metal dependencies:

The service is typically used with the Bluetooth: Scan Bare Metal library - CONFIG_BLE_SCAN.

API documentation

Header file: include/bm/bluetooth/services/ble_hrs_client.h
Source files: subsys/bluetooth/services/ble_hrs_client/

Heart Rate Service API reference