7#ifndef BT_HRS_CLIENT_H_
8#define BT_HRS_CLIENT_H_
17#include <zephyr/bluetooth/conn.h>
19#include <zephyr/bluetooth/gatt.h>
21#include <zephyr/sys/atomic.h>
void(* bt_hrs_client_write_cb)(struct bt_hrs_client *hrs_c, uint8_t err)
Heart Rate Control Point write callback.
Definition: hrs_client.h:151
bool bt_hrs_client_has_sensor_location(struct bt_hrs_client *hrs_c)
Check if Heart Rate Service has the Body Sensor Location characteristic.
int bt_hrs_client_measurement_unsubscribe(struct bt_hrs_client *hrs_c)
Remove subscription to the Heart Rate Measurement notification.
bt_hrs_client_error
Heart Rate Service error codes.
Definition: hrs_client.h:31
@ BT_HRS_CLIENT_ERROR_CP_NOT_SUPPORTED
Definition: hrs_client.h:33
bt_hrs_client_sensor_location
Body sensor location values.
Definition: hrs_client.h:49
@ BT_HRS_CLIENT_SENSOR_LOCATION_FINGER
Definition: hrs_client.h:60
@ BT_HRS_CLIENT_SENSOR_LOCATION_OTHER
Definition: hrs_client.h:51
@ BT_HRS_CLIENT_SENSOR_LOCATION_HAND
Definition: hrs_client.h:63
@ BT_HRS_CLIENT_SENSOR_LOCATION_WRIST
Definition: hrs_client.h:57
@ BT_HRS_CLIENT_SENSOR_LOCATION_CHEST
Definition: hrs_client.h:54
@ BT_HRS_CLIENT_SENSOR_LOCATION_EAR_LOBE
Definition: hrs_client.h:66
@ BT_HRS_CLIENT_SENSOR_LOCATION_FOOT
Definition: hrs_client.h:69
int bt_hrs_client_sensor_location_read(struct bt_hrs_client *hrs_c, bt_hrs_client_read_sensor_location_cb read_cb)
Read Body Sensor Location characteristic.
int bt_hrs_client_handles_assign(struct bt_gatt_dm *dm, struct bt_hrs_client *hrs_c)
Function for assigning handles to Heart Rate Service Client instance.
int bt_hrs_client_measurement_subscribe(struct bt_hrs_client *hrs_c, bt_hrs_client_notify_cb notify_cb)
Subscribe to Heart Rate Measurement notification.
int bt_hrs_client_init(struct bt_hrs_client *hrs_c)
Function for initializing the Heart Rate Service Client.
bt_hrs_client_cp_value
Heart Rate Control Point values.
Definition: hrs_client.h:40
@ BT_HRS_CLIENT_CP_VALUE_RESET_EE
Definition: hrs_client.h:44
bool bt_hrs_client_has_control_point(struct bt_hrs_client *hrs_c)
Check if Heart Rate Service has the Heart Rate Control Point characteristic.
void(* bt_hrs_client_read_sensor_location_cb)(struct bt_hrs_client *hrs_c, enum bt_hrs_client_sensor_location location, int err)
Heart Rate Body Sensor Location read callback.
Definition: hrs_client.h:141
int bt_hrs_client_control_point_write(struct bt_hrs_client *hrs_c, enum bt_hrs_client_cp_value value, bt_hrs_client_write_cb write_cb)
Write Heart Rate Control Point characteristic.
void(* bt_hrs_client_notify_cb)(struct bt_hrs_client *hrs_c, const struct bt_hrs_client_measurement *meas, int err)
Heart Rate Measurement notification callback.
Definition: hrs_client.h:130
uint16_t handle
Definition: hrs_client.h:174
bt_hrs_client_read_sensor_location_cb read_cb
Definition: hrs_client.h:180
struct bt_gatt_read_params read_params
Definition: hrs_client.h:177
Body Sensor Location characteristic structure.
Definition: hrs_client.h:172
struct bt_gatt_write_params write_params
Definition: hrs_client.h:190
uint16_t handle
Definition: hrs_client.h:187
bt_hrs_client_write_cb write_cb
Definition: hrs_client.h:193
Heart Rate Control Point characteristic structure.
Definition: hrs_client.h:185
uint16_t ccc_handle
Definition: hrs_client.h:161
struct bt_gatt_subscribe_params notify_params
Definition: hrs_client.h:164
bt_hrs_client_notify_cb notify_cb
Definition: hrs_client.h:167
uint16_t handle
Definition: hrs_client.h:158
Heart Rate Measurement characteristic structure.
Definition: hrs_client.h:156
uint16_t energy_expended
Definition: hrs_client.h:112
uint16_t hr_value
Definition: hrs_client.h:107
uint8_t rr_intervals_count
Definition: hrs_client.h:98
uint16_t rr_intervals[CONFIG_BT_HRS_CLIENT_RR_INTERVALS_COUNT]
Definition: hrs_client.h:104
struct bt_hrs_flags flags
Definition: hrs_client.h:95
Data structure of the Heart Rate Measurement characteristic.
Definition: hrs_client.h:93
struct bt_conn * conn
Definition: hrs_client.h:201
struct bt_hrs_client_control_point cp_char
Definition: hrs_client.h:210
atomic_t state
Definition: hrs_client.h:213
struct bt_hrs_client_hr_meas measurement_char
Definition: hrs_client.h:204
struct bt_hrs_client_body_sensor_location sensor_location_char
Definition: hrs_client.h:207
Heart Rate Service Client instance structure. This structure contains status information for the clie...
Definition: hrs_client.h:199
uint8_t energy_expended_present
Definition: hrs_client.h:85
uint8_t sensor_contact_detected
Definition: hrs_client.h:79
uint8_t rr_intervals_present
Definition: hrs_client.h:88
uint8_t value_format
Definition: hrs_client.h:76
uint8_t sensor_contact_supported
Definition: hrs_client.h:82
Heart Measurement flags structure.
Definition: hrs_client.h:74