Bluetooth LE Profile API document
Bluetooth LE Profile API document Rev.1.00 [May 22, 2020]
Heart Rate Service Server

This service exposes heart rate and other data from a Heart Rate Sensor intended for fitness applications. More...

Detailed Description

This service exposes heart rate and other data from a Heart Rate Sensor intended for fitness applications.

Data Structures

struct  st_ble_hrs_meas_flags_t
 Heart Rate Measurement Flags value structure. More...
 
struct  st_ble_hrs_meas_t
 Heart Rate Measurement value structure. More...
 

Macros

#define BLE_HRS_HEART_RATE_CONTROL_POINT_NOT_SUPPORTED_ERROR   (BLE_ERR_GROUP_GATT | 0x80)
 Heart Rate Control Point Not Supported. More...
 

Enumerations

enum  e_ble_hrs_body_sensor_location_body_sensor_location_t {
  BLE_HRS_BODY_SENSOR_LOCATION_BODY_SENSOR_LOCATION_OTHER = 0,
  BLE_HRS_BODY_SENSOR_LOCATION_BODY_SENSOR_LOCATION_CHEST = 1,
  BLE_HRS_BODY_SENSOR_LOCATION_BODY_SENSOR_LOCATION_WRIST = 2,
  BLE_HRS_BODY_SENSOR_LOCATION_BODY_SENSOR_LOCATION_FINGER = 3,
  BLE_HRS_BODY_SENSOR_LOCATION_BODY_SENSOR_LOCATION_HAND = 4,
  BLE_HRS_BODY_SENSOR_LOCATION_BODY_SENSOR_LOCATION_EAR_LOBE = 5,
  BLE_HRS_BODY_SENSOR_LOCATION_BODY_SENSOR_LOCATION_FOOT = 6
}
 Body Sensor Location Body Sensor Location enumeration. More...
 
enum  e_ble_hrs_heart_rate_cp_heart_rate_control_point_t { BLE_HRS_HEART_RATE_CP_HEART_RATE_CONTROL_POINT_RESET_ENERGY_EXPENDED = 1 }
 Heart Rate Control Point Heart Rate Control Point enumeration. More...
 
enum  e_ble_hrs_char_idx_t {
  BLE_HRS_MEAS_IDX,
  BLE_HRS_MEAS_CLI_CNFG_IDX,
  BLE_HRS_BODY_SENSOR_LOCATION_IDX,
  BLE_HRS_HEART_RATE_CP_IDX
}
 Heart Rate characteristic Index. More...
 
enum  e_ble_hrs_event_t {
  BLE_HRS_EVENT_BODY_SENSOR_LOCATION_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_HRS_BODY_SENSOR_LOCATION_IDX, BLE_SERVS_READ_REQ),
  BLE_HRS_EVENT_HEART_RATE_CP_WRITE_REQ = BLE_SERVS_ATTR_EVENT(BLE_HRS_HEART_RATE_CP_IDX, BLE_SERVS_WRITE_REQ),
  BLE_HRS_EVENT_HEART_RATE_CP_WRITE_COMP = BLE_SERVS_ATTR_EVENT(BLE_HRS_HEART_RATE_CP_IDX, BLE_SERVS_WRITE_COMP)
}
 Heart Rate event type. More...
 

Functions

ble_status_t R_BLE_HRS_NotifyMeas (uint16_t conn_hdl, const st_ble_hrs_meas_t *p_value)
 Send notification of Heart Rate Measurement characteristic value to the remote device. More...
 
ble_status_t R_BLE_HRS_AddEnergyExpended (uint16_t *p_value)
 Add Energy Expended value. More...
 
ble_status_t R_BLE_HRS_SetMeasCliCnfg (const uint16_t *p_value)
 Set Heart Rate Measurement cli cnfg descriptor value to the local GATT database. More...
 
ble_status_t R_BLE_HRS_GetMeasCliCnfg (uint16_t *p_value)
 Get Heart Rate Measurement cli cnfg descriptor value from the local GATT database. More...
 
ble_status_t R_BLE_HRS_SetBodySensorLocation (const uint8_t *p_value)
 Set Body Sensor Location characteristic value to the local GATT database. More...
 
ble_status_t R_BLE_HRS_GetBodySensorLocation (uint8_t *p_value)
 Get Body Sensor Location characteristic value from the local GATT database. More...
 
ble_status_t R_BLE_HRS_Init (ble_servs_app_cb_t cb)
 Initialize Heart Rate service. More...
 

Macro Definition Documentation

◆ BLE_HRS_HEART_RATE_CONTROL_POINT_NOT_SUPPORTED_ERROR

#define BLE_HRS_HEART_RATE_CONTROL_POINT_NOT_SUPPORTED_ERROR   (BLE_ERR_GROUP_GATT | 0x80)

Heart Rate Control Point Not Supported.

Enumeration Type Documentation

◆ e_ble_hrs_body_sensor_location_body_sensor_location_t

Body Sensor Location Body Sensor Location enumeration.

Enumerator
BLE_HRS_BODY_SENSOR_LOCATION_BODY_SENSOR_LOCATION_OTHER 

Other

BLE_HRS_BODY_SENSOR_LOCATION_BODY_SENSOR_LOCATION_CHEST 

Chest

BLE_HRS_BODY_SENSOR_LOCATION_BODY_SENSOR_LOCATION_WRIST 

Wrist

BLE_HRS_BODY_SENSOR_LOCATION_BODY_SENSOR_LOCATION_FINGER 

Finger

BLE_HRS_BODY_SENSOR_LOCATION_BODY_SENSOR_LOCATION_HAND 

Hand

BLE_HRS_BODY_SENSOR_LOCATION_BODY_SENSOR_LOCATION_EAR_LOBE 

Ear Lobe

BLE_HRS_BODY_SENSOR_LOCATION_BODY_SENSOR_LOCATION_FOOT 

Foot

◆ e_ble_hrs_heart_rate_cp_heart_rate_control_point_t

Heart Rate Control Point Heart Rate Control Point enumeration.

Enumerator
BLE_HRS_HEART_RATE_CP_HEART_RATE_CONTROL_POINT_RESET_ENERGY_EXPENDED 

Reset Energy Expended: resets the value of the Energy Expended field in the Heart Rate Measurement characteristic to 0

◆ e_ble_hrs_char_idx_t

Heart Rate characteristic Index.

◆ e_ble_hrs_event_t

Heart Rate event type.

Function Documentation

◆ R_BLE_HRS_NotifyMeas()

ble_status_t R_BLE_HRS_NotifyMeas ( uint16_t  conn_hdl,
const st_ble_hrs_meas_t p_value 
)

Send notification of Heart Rate Measurement characteristic value to the remote device.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueCharacteristic value to send.
Returns
ble_status_t

◆ R_BLE_HRS_AddEnergyExpended()

ble_status_t R_BLE_HRS_AddEnergyExpended ( uint16_t *  p_value)

Add Energy Expended value.

Parameters
[in]p_valueEnergy expended value to add.
Returns
ble_status_t

◆ R_BLE_HRS_SetMeasCliCnfg()

ble_status_t R_BLE_HRS_SetMeasCliCnfg ( const uint16_t *  p_value)

Set Heart Rate Measurement cli cnfg descriptor value to the local GATT database.

Parameters
[in]p_valueDescriptor value to set.
Returns
ble_status_t

◆ R_BLE_HRS_GetMeasCliCnfg()

ble_status_t R_BLE_HRS_GetMeasCliCnfg ( uint16_t *  p_value)

Get Heart Rate Measurement cli cnfg descriptor value from the local GATT database.

Parameters
[in]p_valueOutput location for the acquired descriptor value.
Returns
ble_status_t

◆ R_BLE_HRS_SetBodySensorLocation()

ble_status_t R_BLE_HRS_SetBodySensorLocation ( const uint8_t *  p_value)

Set Body Sensor Location characteristic value to the local GATT database.

Parameters
[in]p_valueCharacteristic value to set.
Returns
ble_status_t

◆ R_BLE_HRS_GetBodySensorLocation()

ble_status_t R_BLE_HRS_GetBodySensorLocation ( uint8_t *  p_value)

Get Body Sensor Location characteristic value from the local GATT database.

Parameters
[in]p_valueOutput location for the acquired descriptor value.
Returns
ble_status_t

◆ R_BLE_HRS_Init()

ble_status_t R_BLE_HRS_Init ( ble_servs_app_cb_t  cb)

Initialize Heart Rate service.

Parameters
[in]cbService callback.
Returns
ble_status_t