HRC library of the AIROC BTSDK provides a simple method for an application to integrate Heart Rate Client functionality.
More...
HRC library of the AIROC BTSDK provides a simple method for an application to integrate Heart Rate Client functionality.
Application Calls the Library APIs to: Discover Heart Rate Service characteristics and descriptors whenever it finds Heart Rate Service in the connected device. Start or Stop Heart Rate Notifications. To Reset Energy expended during Heart Rate notification based on application request Application registers callback on application start to receive the result of above 3 operations.
HRC Callback function type wiced_bt_hrc_callback_t.
This function is called to send HRC events to the application. This function is registered with the wiced_bt_hrc_init function.
- Parameters
-
[in] | event | : HRC Event. |
[in] | p_data | : Data (pointer on union of structure) associated with the event. |
- Returns
- NONE.
HRC Events received by the applicaton's HRC callback (see wiced_bt_hrc_callback_t)
Enumerator |
---|
WICED_BT_HRC_EVENT_DISCOVERY |
HRC Discovery event.
|
WICED_BT_HRC_EVENT_START |
HRC Start event.
|
WICED_BT_HRC_EVENT_STOP |
HRC Stop event.
|
WICED_BT_HRC_EVENT_RESET_ENERGY_EXPENDED |
HRC Reset Energy Expended event.
|
WICED_BT_HRC_EVENT_NOTIFICATION_DATA |
HRC Notification event.
|
void wiced_bt_hrc_connection_down |
( |
uint16_t |
conn_id | ) |
|
The application calls this function when LE connection with a peer device has been released.
- Parameters
-
conn_id | : Connection Identifier. |
- Returns
- None.
void wiced_bt_hrc_connection_up |
( |
uint16_t |
conn_id | ) |
|
The application calls this function when LE connection with a peer device has been established.
- Parameters
-
conn_id | : Connection Identifier. |
- Returns
- None.
The application calls this function when it discovers the HRS service of the connected device.
This function starts the GATT discovery of heart rate service characteristics.
- Parameters
-
conn_id | : GATT connection ID. |
s_handle | : Start GATT handle of the heart rate service. |
e_handle | : End GATT handle of the heart rate service. |
- Returns
- Status of the GATT operation.
The application calls this API during GATT discovery to pass discovery complete information for the HRC service to the HRC Library.
As the GATT discovery is performed in multiple steps this function initiates the next discovery request.
- Parameters
-
p_data | : Discovery complete data as passed from the stack. |
- Returns
- None.
The application calls this API during GATT discovery to pass discovery results for the HRC service to the HRC Library.
The library needs to find HRC service characteristics and associated characteristic client configuration descriptors.
- Parameters
-
p_data | : Discovery result data as passed from the stack. |
- Returns
- none
The application calls this function when it receive GATT operation complete event on heart rate service characteristics.
The Library parse the result and calls application registered callback.
- Parameters
-
conn_id | : GATT connection ID. |
- Returns
- Result of GATT operation.
The application calls this function to initialize the HRC library and to register application callback.
- Parameters
-
p_callback | : application's HRC callback. |
- Returns
- Status of the operation.
The application calls this function to reset accumulated Energy expended value during heart rate measure process.
Client can reset when it finds max energy expended value (i.e 0xffff) in heart rate notification.
- Parameters
-
conn_id | : GATT connection ID. |
- Returns
- Result of GATT operation.
The application calls this function whenever it is needed to collect Heart Rate.
Discovery should be completed before this function is executed. The start function enables the server to send heart Rate notifications.
- Parameters
-
conn_id | : GATT connection ID. |
- Returns
- Result of GATT operation.
The application calls this function whenever it need to stop to collect Heart Rate.
The stop function disables the server to send heart Rate notifications
- Parameters
-
conn_id | : GATT connection ID. |
- Returns
- Result of GATT operation.
The application calls this function whenever it need to stop to collect Heart Rate.
- Parameters
-
conn_id | : GATT connection ID. |
- Returns
- Result of GATT operation.