HRS library of the AIROC BTSDK provides a simple method for an application to integrate Heart Rate server functionality.
More...
HRS library of the AIROC BTSDK provides a simple method for an application to integrate Heart Rate server functionality.
Application calls library APIs to process Heart Rate Client(HRC) GATT read, write requests to configure Heart Rate services. Application notified with simple events to start or stop Heart rate notification based on client configuration. Formats Heart rate notification as per spec and sends to client when application sends Heart rate data data. see wiced_bt_heart_rate_data_t
HRS Callback function wiced_bt_hrs_event_cback_t.
This callback is executed when HRS library completes HRC requested configuration (Client requests to start/stop/reset energy expended in heart rate using GATT write operation).
- Parameters
-
conn_id | : GATT connection ID. |
event | : Event to application to act accordingly. |
- Returns
- None.
HRC Events received by the applicaton's HRS callback (see wiced_bt_hrs_callback_t)
Enumerator |
---|
WICED_BT_HRS_EVENT_HEART_RATE_NOTIFICATIONS_ENABLED |
Client Registered for for Heart rate notifications.
|
WICED_BT_HRS_EVENT_HEART_RATE_NOTIFICATIONS_DISABLED |
Client Un-registered Heart rate notifications.
|
WICED_BT_HRS_RESET_ENERGY_EXPENDED_VALUE |
Reset Energy expended during heart rate measurement since last reset.
|
void wiced_bt_hrs_connection_down |
( |
uint16_t |
conn_id | ) |
|
The application calls this function when LE connection with a peer device has been disconnected.
- Parameters
-
conn_id | : GATT connection ID. |
- Returns
- None.
void wiced_bt_hrs_connection_up |
( |
uint16_t |
conn_id | ) |
|
The application calls this function when LE connection with a peer device has been established.
- Parameters
-
conn_id | : GATT connection ID. |
- Returns
- None.
The application calls this function on start up to initialize HRS library.
Through callback application notified with different events (see wiced_bt_hrs_event_cback_t) based on heart rate client actions.
- Parameters
-
p_callback | : Application callback pointer to receive events from library. |
- Returns
- None.
The application calls this function when it receives GATT read request on Heart rate service characteristic and descriptors.
- Parameters
-
conn_id | : GATT connection ID. |
p_read | : GATT read request. |
- Returns
- Status of GATT Read operation
The application calls this function when it receives GATT write request on Heart rate service characteristic and descriptors.
- Parameters
-
conn_id | : GATT connection ID. |
p_write | : GATT write request. |
- Returns
- Status of GATT Write operation (Note: WICED_BT_HRP_CONTROL_POINT_WRITE_UNSUPPORTED_VALUE value returns when client provides invalid value in reset energy expended request.)
The application calls this function to send heart rate notification.
- Parameters
-
conn_id | : GATT connection ID. |
heart_rate_data | : Heart rate data.See wiced_bt_heart_rate_data_t |
- Returns
- Status of GATT notification operation
void wiced_bt_hrs_set_previous_connection_client_notification_configuration |
( |
uint16_t |
conn_id, |
|
|
wiced_bool_t |
notifications_enabled |
|
) |
| |
The application should call this API on successful encryption with Heart Rate client.
Library is required to know whether the client enabled notifications.
- Parameters
-
conn_id | : GATT connection ID. |
notifications_enabled | : Notifications status. WICED_TRUE:Enabled, WICED_FALSE:disabled |
- Returns
- None.