|
PebbleOS
|
Shares heart rate over the BLE Heart Rate Service, with per-device user permission. More...
Macros | |
| #define | BLE_HRM_REMINDER_POPUP_DELAY_MINS (2 * PBL_MIN_PER_HOUR) |
| Interval between sharing reminder popups, in minutes. | |
Typedefs | |
| typedef struct BLEHRMSharingRequest | BLEHRMSharingRequest |
| Opaque pending request for permission to share. | |
Functions | |
| void | ble_hrm_handle_sharing_request_response (bool is_granted, BLEHRMSharingRequest *sharing_request) |
| Apply the user's answer to a sharing request. | |
| bool | ble_hrm_is_supported_and_enabled (void) |
| Check whether heart rate sharing is possible. | |
| bool | ble_hrm_is_sharing_to_connection (const GAPLEConnection *connection) |
| Check whether heart rate is shared with a connection. | |
| bool | ble_hrm_is_sharing (void) |
| Check whether heart rate is shared with any device. | |
| void | ble_hrm_revoke_sharing_permission_for_connection (GAPLEConnection *connection) |
| Revoke sharing permission for a connection. | |
| void | ble_hrm_revoke_all (void) |
| Revoke sharing permission for all connections, disconnecting them. | |
| void | ble_hrm_handle_activity_prefs_heart_rate_is_enabled (bool is_enabled) |
| Handle a change of the heart rate monitoring preference. | |
| void | ble_hrm_handle_disconnection (GAPLEConnection *connection) |
| Handle an LE disconnection. | |
| void | ble_hrm_init (void) |
| Initialize heart rate sharing when the stack starts. | |
| void | ble_hrm_deinit (void) |
| Stop sharing and forget all permissions when the stack stops. | |
Shares heart rate over the BLE Heart Rate Service, with per-device user permission.
When a device subscribes, the user is asked for permission. While sharing, the heart rate monitor runs and a reminder popup is shown periodically. Available with CONFIG_SERVICE_BLE_HRM.
| #define BLE_HRM_REMINDER_POPUP_DELAY_MINS (2 * PBL_MIN_PER_HOUR) |
Interval between sharing reminder popups, in minutes.
| typedef struct BLEHRMSharingRequest BLEHRMSharingRequest |
Opaque pending request for permission to share.
| void ble_hrm_deinit | ( | void | ) |
Stop sharing and forget all permissions when the stack stops.
| void ble_hrm_handle_activity_prefs_heart_rate_is_enabled | ( | bool | is_enabled | ) |
Handle a change of the heart rate monitoring preference.
Disabling it ends all sharing.
| is_enabled | New preference value. |
| void ble_hrm_handle_disconnection | ( | GAPLEConnection * | connection | ) |
Handle an LE disconnection.
If the device was being shared with, briefly advertises the Heart Rate Service to help it reconnect. Permissions are kept. The caller must hold bt_lock().
| connection | Disconnected connection. |
| void ble_hrm_handle_sharing_request_response | ( | bool | is_granted, |
| BLEHRMSharingRequest * | sharing_request | ||
| ) |
Apply the user's answer to a sharing request.
Called by the sharing popup. Frees sharing_request.
| is_granted | True if the user allowed sharing. |
| sharing_request | The request being answered. |
| void ble_hrm_init | ( | void | ) |
Initialize heart rate sharing when the stack starts.
| bool ble_hrm_is_sharing | ( | void | ) |
Check whether heart rate is shared with any device.
| bool ble_hrm_is_sharing_to_connection | ( | const GAPLEConnection * | connection | ) |
Check whether heart rate is shared with a connection.
The caller must hold bt_lock().
| connection | LE connection, may be NULL. |
| bool ble_hrm_is_supported_and_enabled | ( | void | ) |
Check whether heart rate sharing is possible.
| void ble_hrm_revoke_all | ( | void | ) |
Revoke sharing permission for all connections, disconnecting them.
| void ble_hrm_revoke_sharing_permission_for_connection | ( | GAPLEConnection * | connection | ) |
Revoke sharing permission for a connection.
Disconnects the link, since the server cannot remove a client's subscription.
| connection | LE connection. |