GATT Heart Rate Service, sharing the watch's heart rate with connected devices.
More...
GATT Heart Rate Service, sharing the watch's heart rate with connected devices.
Implemented by backends that select CONFIG_BT_HRM_SERVICE. The NimBLE backend does not.
◆ pbl_bt_hrm_service_measurement
| struct pbl_bt_hrm_service_measurement |
A heart rate measurement.
| Data Fields |
|
uint16_t |
bpm |
Heart rate in beats per minute. |
|
bool |
is_on_wrist |
True if the watch is worn. |
◆ pbl_bt_cb_hrm_service_update_subscription()
| void pbl_bt_cb_hrm_service_update_subscription |
( |
const struct pbl_bt_device_internal * |
device, |
|
|
bool |
is_subscribed |
|
) |
| |
|
extern |
Called when a connected device (un)subscribes to the Heart Rate Measurement characteristic.
- Parameters
-
| device | The device. |
| is_subscribed | true if the device is now subscribed. |
◆ pbl_bt_hrm_service_enable()
| void pbl_bt_hrm_service_enable |
( |
bool |
enable | ) |
|
Add or remove the Heart Rate Service from the GATT database.
Connected devices are sent a Service Changed indication for the affected handle range.
- Parameters
-
| enable | true to add the service, false to remove it. |
◆ pbl_bt_hrm_service_handle_measurement()
Send a heart rate measurement to the subscribed devices.
- Parameters
-
| measurement | The measurement. |
| permitted_devices | Devices allowed to receive it. |
| num_permitted_devices | Number of entries in permitted_devices. |