Infineon Logo AIROC BTSDK v4.6 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
HRC Library API

HRC library of the AIROC BTSDK provides a simple method for an application to integrate Heart Rate Client functionality. More...

Data Structures

struct  wiced_bt_hrc_discovery_t
 Data associated with WICED_BT_HRC_EVENT_DISCOVERY. More...
 
struct  wiced_bt_hrc_start_t
 Data associated with WICED_BT_HRC_EVENT_START. More...
 
struct  wiced_bt_hrc_stop_t
 Data associated with WICED_BT_HRC_EVENT_STOP. More...
 
struct  wiced_bt_hrc_reset_energy_expended_t
 Data associated with WICED_BT_HRC_EVENT_RESET_ENERGY_EXPENDED. More...
 
struct  wiced_bt_hrc_notification_data_t
 Data associated with WICED_BT_HRC_EVENT_NOTIFICATION_DATA. More...
 
union  wiced_bt_hrc_event_data_t
 Union of data associated with HRC events. More...
 

Typedefs

typedef void( wiced_bt_hcr_callback_t )(wiced_bt_hrc_event_t event, wiced_bt_hrc_event_data_t *p_data)
 HRC Callback function type wiced_bt_hrc_callback_t. More...
 

Enumerations

enum  wiced_bt_hrc_event_t {
  WICED_BT_HRC_EVENT_DISCOVERY, WICED_BT_HRC_EVENT_START, WICED_BT_HRC_EVENT_STOP, WICED_BT_HRC_EVENT_RESET_ENERGY_EXPENDED,
  WICED_BT_HRC_EVENT_NOTIFICATION_DATA
}
 HRC Events received by the applicaton's HRC callback (see wiced_bt_hrc_callback_t) More...
 

Functions

wiced_result_t wiced_bt_hrc_init (wiced_bt_hcr_callback_t *p_callback)
 The application calls this function to initialize the HRC library and to register application callback. More...
 
wiced_bt_gatt_status_t wiced_bt_hrc_discover (uint16_t conn_id, uint16_t s_handle, uint16_t e_handle)
 The application calls this function when it discovers the HRS service of the connected device. More...
 
void wiced_bt_hrc_discovery_result (wiced_bt_gatt_discovery_result_t *p_data)
 The application calls this API during GATT discovery to pass discovery results for the HRC service to the HRC Library. More...
 
void wiced_bt_hrc_discovery_complete (wiced_bt_gatt_discovery_complete_t *p_data)
 The application calls this API during GATT discovery to pass discovery complete information for the HRC service to the HRC Library. More...
 
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. More...
 
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. More...
 
wiced_bt_gatt_status_t wiced_bt_hrc_start (uint16_t conn_id)
 The application calls this function whenever it is needed to collect Heart Rate. More...
 
wiced_bt_gatt_status_t wiced_bt_hrc_stop (uint16_t conn_id)
 The application calls this function whenever it need to stop to collect Heart Rate. More...
 
wiced_bt_gatt_status_t wiced_bt_hrc_reset_energy_expended (uint16_t conn_id)
 The application calls this function to reset accumulated Energy expended value during heart rate measure process. More...
 
void wiced_bt_hrc_gatt_op_complete (wiced_bt_gatt_operation_complete_t *p_data)
 The application calls this function when it receive GATT operation complete event on heart rate service characteristics. More...
 

Detailed Description

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.

Typedef Documentation

typedef void( wiced_bt_hcr_callback_t)(wiced_bt_hrc_event_t event, wiced_bt_hrc_event_data_t *p_data)

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.

Enumeration Type Documentation

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.

Function Documentation

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.
wiced_bt_gatt_status_t wiced_bt_hrc_discover ( uint16_t  conn_id,
uint16_t  s_handle,
uint16_t  e_handle 
)

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.
void wiced_bt_hrc_discovery_complete ( wiced_bt_gatt_discovery_complete_t p_data)

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.
void wiced_bt_hrc_discovery_result ( wiced_bt_gatt_discovery_result_t p_data)

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
void wiced_bt_hrc_gatt_op_complete ( wiced_bt_gatt_operation_complete_t p_data)

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.
wiced_result_t wiced_bt_hrc_init ( wiced_bt_hcr_callback_t p_callback)

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.
wiced_bt_gatt_status_t wiced_bt_hrc_reset_energy_expended ( uint16_t  conn_id)

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.
wiced_bt_gatt_status_t wiced_bt_hrc_start ( uint16_t  conn_id)

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.
wiced_bt_gatt_status_t wiced_bt_hrc_stop ( uint16_t  conn_id)

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.