Heart Rate Service Client.
More...
Heart Rate Service Client.
◆ hrs_client_get_event_state_completed_cb_t
Get event state completed callback.
- Parameters
-
| [in] | hrs_client | HRS Client instance |
| [in] | event | indication/notification characteristic |
| [in] | status | operation status |
| [in] | enabled | state flag |
◆ hrs_client_heart_rate_measurement_notif_cb_t
Heart Rate Measurement notification callback.
Called when the HRS Client receives Heart Rate Measurement notification from server. The rr_values have variable length in the received data. To prevent the memory leak caused by OS_MALLOC (measurement) this callback uses OS_FREE()
- Parameters
-
| [in] | hrs_client | HRS Client instance |
| [in] | measurement | heart rate measurements |
◆ hrs_client_read_body_sensor_location_cb_t
Read value of Body Sensor Location callback.
Indicates status of read Body Sensor Location value procedure.
- Parameters
-
| [in] | hrs_client | HRS Client instance |
| [in] | status | operation status |
| [in] | location | body sensor location |
◆ hrs_client_reset_energy_expended_completed_cb_t
Reset the value of the Energy Expended callback.
Indicates status of reset Energy Expended value procedure.
- Parameters
-
| [in] | hrs_client | HRS Client instance |
| [in] | status | operation status |
◆ hrs_client_set_event_state_completed_cb_t
Set event state completed callback.
- Parameters
-
| [in] | hrs_client | HRS Client instance |
| [in] | event | indication/notification characteristic |
| [in] | status | operation status |
◆ hrs_client_body_sensor_location_t
Body Sensor Location.
As defined by HRS specification.
| Enumerator |
|---|
| HRS_CLIENT_BODY_SENSOR_LOC_OTHER | Other
|
| HRS_CLIENT_BODY_SENSOR_LOC_CHEST | Chest
|
| HRS_CLIENT_BODY_SENSOR_LOC_WRIST | Wrist
|
| HRS_CLIENT_BODY_SENSOR_LOC_FINGER | Finger
|
| HRS_CLIENT_BODY_SENSOR_LOC_HAND | Hand
|
| HRS_CLIENT_BODY_SENSOR_LOC_EAR_LOBE | Ear Lobe
|
| HRS_CLIENT_BODY_SENSOR_LOC_FOOT | Foot
|
◆ hrs_client_cap_t
Client capabilities bit mask.
| Enumerator |
|---|
| HRS_CLIENT_CAP_BODY_SENSOR_LOCATION | Body Sensor Location Characteristic
|
| HRS_CLIENT_CAP_HEART_RATE_CONTROL_POINT | Heart Rate Control Point Characteristic
|
◆ hrs_client_event_t
Event Characteristics (those which have indications/notifications as property)
| Enumerator |
|---|
| HRS_CLIENT_EVENT_HEART_RATE_MEASUREMENT_NOTIF | Heart Rate Measurement Characteristic
|
◆ hrs_client_get_capabilities()
Get client capabilities.
Function returns client capabilities enum
- Parameters
-
| [in] | hrs_client | HRS Client instance |
- Returns
- Bit mask with client capabilities
◆ hrs_client_get_event_state()
Get event characteristic indication/notification state.
Function reads CCC descriptor of selected event. After successful operation get_event_state callback will be called.
- Parameters
-
| [in] | hrs_client | HRS Client instance |
| [in] | event | selected notification/indication characteristic |
- Returns
- true if read request has been sent successfully, false if server doesn't support selected event characteristic or if operation is already in progress.
◆ hrs_client_init()
Register Heart Rate Client instance.
Function registers new Heart Rate Client instance.
- Parameters
-
| [in] | cb | HRS Client application callbacks |
| [in] | evt | browse svc event with HR svc details |
- Returns
- client instance if success, otherwise NULL
◆ hrs_client_init_from_data()
Initialize HRS Client instance from buffered (cached) data and register application callbacks.
Function semantics is very similar to hrs_client_init(). The difference is that internal data is initialized by the buffered context and the HRS Client is automatically added to active clients collection.
- Parameters
-
| [in] | conn_idx | connection index |
| [in] | cb | HRS Client application callbacks |
| [in] | data | buffered data |
| [in] | length | buffer's length |
- Returns
- HRS Client instance when initialized properly, NULL otherwise
◆ hrs_client_read_body_sensor_location()
| bool hrs_client_read_body_sensor_location |
( |
ble_client_t * |
hrs_client | ) |
|
Read body sensor location.
Function triggers read Body Sensor Location characteristic. Once operation is completed, callback hrs_client_read_body_sensor_location_cb_t will be called.
- Parameters
-
| [in] | hrs_client | HRS Client instance |
- Returns
- true if request has been sent successfully, otherwise false
◆ hrs_client_reset_energy_expended()
| bool hrs_client_reset_energy_expended |
( |
ble_client_t * |
hrs_client | ) |
|
Reset Energy Expended value to 0.
Function reset Energy Expended field in HR Measurement characteristic to 0 by writing 0x01 value to heart rate control point. Once operation is completed, callback hrs_client_reset_energy_expended_completed_cb_t will be called.
- Parameters
-
| [in] | hrs_client | HRS Client instance |
- Returns
- true if request has been sent successfully, otherwise false
◆ hrs_client_set_event_state()
Set event characteristic indication/notification state.
Function writes CCC descriptor of selected event. After successful operation set_event_state callback will be called.
- Parameters
-
| [in] | hrs_client | HRS Client instance |
| [in] | event | selected notification/indication characteristic |
| [in] | enable | state flag |
- Returns
- true if write request has been sent successfully, false if server doesn't support selected event characteristic or if operation is already in progress.