1. Heart Rate Profile
Heart Rate Profile (HRP) [1] is a generic attribute profile (GATT) based low-energy profile defined by the Bluetooth® Special Interest Group[2]
The HRP, widely used in fitness applications, defines the communication process between a GATT-server of a Heart Rate Sensor device, such as a wrist band, and a GATT-client Collector device, such as a smartphone or tablet.
- The Heart Rate Sensor:
- Measures the heart rate and exposes it via the Heart Rate Service[3].
- Contains the Device Information Service that includes information, for example, about the manufacturer of the device.
- Is the GATT server.
- The Heart Rate Collector:
- Accesses the information exposed by the heart rate sensor. It can display it to the end user, or store it on a nonvolatile memory for later analysis.
- Is the GATT client.
The description of the Heart Rate Sensor project provided within the STM32CubeWB0 MCU Package[4] is the subject of this article.
Bluetooth® Low Energy Heart Rate Profile & STM32WB0 |
---|
The table below describes the structure of Heart Rate Sensor services:
Bluetooth® Low Energy Heart Rate Service specification | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
The Heart Rate Profile is a combination of a Heart Rate Collector and a Heart Rate Sensor. The goal is to connect and exchange data in different applications.
The GAP - Generic Access Profile defines and manages advertising and connection.
Collector Central device and Sensor Peripheral device |
---|
The GATT - generic attribute profile defines and manages in/out data exchange.
Collector GATT client device and Sensor GATT service device |
---|
Example of flow diagram between STM32WB0 & STBLEToolbox |
---|
1.1. Advertising Data
At startup, the Heart Rate Sensor application starts a fast advertising(80ms/100ms).
Data advertised are composed as follow:
Heart Rate Advertising packet | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
The manufacturer data are encoded following STMicroelectronics BlueST-SDK v2 as described below:
STMicroelectronics Manufacturer Advertising data | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Advertising is switched to Low Power advertising (1s/2.5s) after 60s.