![]() |
nRF Connect SDK Bare Metal API 2.0.99
|
| uint32_t ble_hrs_heart_rate_measurement_send | ( | struct ble_hrs * | hrs, |
| uint16_t | heart_rate ) |
#include <ble_hrs.h>
Send a heart rate measurement notification.
Reads the CCCD to check whether the peer has enabled notifications. If enabled, encodes the heart rate measurement and sends it as a BLE notification. If notifications are not enabled or the CCCD state is unknown, no data is sent and the function returns an error.
| hrs | Heart rate service. |
| heart_rate | Heart rate measurement in beats per minute. |
| NRF_SUCCESS | On success. |
| NRF_ERROR_NULL | If hrs is NULL. |
| NRF_ERROR_INVALID_STATE | CCCD Notification bit is not set by the peer. |