nRF Connect SDK Bare Metal API 2.0.99
Loading...
Searching...
No Matches

◆ ble_hrs_heart_rate_measurement_send()

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.

Parameters
hrsHeart rate service.
heart_rateHeart rate measurement in beats per minute.
Return values
NRF_SUCCESSOn success.
NRF_ERROR_NULLIf hrs is NULL.
NRF_ERROR_INVALID_STATECCCD Notification bit is not set by the peer.
Returns
In addition, this function may return any error returned by the following SoftDevice functions:
  • sd_ble_gatts_value_get()
  • sd_ble_gatts_hvx()