SmartSnippets DA1459x SDK
hrs.h
Go to the documentation of this file.
1 
43 #ifndef HRS_H_
44 #define HRS_H_
45 
46 #include <stdbool.h>
47 #include <stdint.h>
48 #include "ble_service.h"
49 
56 typedef enum {
57  HRS_SENSOR_LOC_OTHER = 0,
58  HRS_SENSOR_LOC_CHEST = 1,
59  HRS_SENSOR_LOC_WRIST = 2,
60  HRS_SENSOR_LOC_FINGER = 3,
61  HRS_SENSOR_LOC_HAND = 4,
62  HRS_SENSOR_LOC_EAR_LOBE = 5,
63  HRS_SENSOR_LOC_FOOT = 6,
65 
66 typedef void (* hrs_ee_reset_cb_t) (uint16_t conn_idx);
67 
68 typedef void (* hrs_notification_changed_cb_t) (uint16_t conn_idx, bool enabled);
69 
73 typedef struct {
75  hrs_ee_reset_cb_t ee_reset;
76 
78  hrs_notification_changed_cb_t notif_changed;
80 
87 typedef struct {
88  uint16_t bpm;
92  uint16_t energy_expended;
93  uint8_t rr_num;
94  uint16_t rr[];
96 
107 
118 void hrs_notify_measurement(ble_service_t *svc, uint16_t conn_idx, hrs_measurement_t *meas);
119 
130 
131 #endif /* HRS_H_ */
132 
hrs_callbacks_t
Definition: hrs.h:73
hrs_measurement_t::rr_num
uint8_t rr_num
Definition: hrs.h:93
hrs_init
ble_service_t * hrs_init(hrs_body_sensor_location_t location, const hrs_callbacks_t *cb)
hrs_measurement_t
Definition: hrs.h:87
ble_service.h
Services handling routines API.
hrs_measurement_t::bpm
uint16_t bpm
Definition: hrs.h:88
hrs_notify_measurement_all
void hrs_notify_measurement_all(ble_service_t *svc, hrs_measurement_t *meas)
hrs_measurement_t::contact_supported
bool contact_supported
Definition: hrs.h:89
hrs_measurement_t::has_energy_expended
bool has_energy_expended
Definition: hrs.h:91
hrs_notify_measurement
void hrs_notify_measurement(ble_service_t *svc, uint16_t conn_idx, hrs_measurement_t *meas)
hrs_measurement_t::contact_detected
bool contact_detected
Definition: hrs.h:90
hrs_measurement_t::energy_expended
uint16_t energy_expended
Definition: hrs.h:92
hrs_body_sensor_location_t
hrs_body_sensor_location_t
Definition: hrs.h:56
ble_service
Definition: ble_service.h:132