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

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

Data Structures

struct  wiced_bt_hrs_handles_t
 List of Handles of the Heart Rate Service. More...
 
struct  wiced_bt_hrs_notification_enabled_t
 Data associated with WICED_BT_HRS_EVENT_HEART_RATE_NOTIFICATIONS_ENABLED. More...
 
struct  wiced_bt_hrs_notification_disabled_t
 Data associated with WICED_BT_HRS_EVENT_HEART_RATE_NOTIFICATIONS_DISABLED. More...
 
struct  wiced_bt_hrs_reset_energy_expended_t
 Data associated with WICED_BT_HRS_RESET_ENERGY_EXPENDED_VALUE. More...
 
struct  wiced_bt_hrs_notification_data_t
 Heart Rate Notification data. More...
 
union  wiced_bt_hrs_event_data_t
 Union of data associated with HRS events. More...
 

Typedefs

typedef void( wiced_bt_hrs_event_cback_t )(wiced_bt_hrs_event_t event, wiced_bt_hrs_event_data_t *p_data)
 HRS Callback function wiced_bt_hrs_event_cback_t. More...
 

Enumerations

enum  wiced_bt_hrs_event_t { WICED_BT_HRS_EVENT_HEART_RATE_NOTIFICATIONS_ENABLED, WICED_BT_HRS_EVENT_HEART_RATE_NOTIFICATIONS_DISABLED, WICED_BT_HRS_RESET_ENERGY_EXPENDED_VALUE }
 HRC Events received by the applicaton's HRS callback (see wiced_bt_hrs_callback_t) More...
 

Functions

wiced_result_t wiced_bt_hrs_init (wiced_bt_hrs_event_cback_t *p_callback, wiced_bt_hrs_handles_t *p_gatt_handles)
 The application calls this function on start up to initialize HRS library. More...
 
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. More...
 
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. More...
 
wiced_bt_gatt_status_t wiced_bt_hrs_process_client_read_req (uint16_t conn_id, wiced_bt_gatt_read_t *p_read)
 The application calls this function when it receives GATT read request on Heart rate service characteristic and descriptors. More...
 
wiced_bt_gatt_status_t wiced_bt_hrs_process_client_write_req (uint16_t conn_id, wiced_bt_gatt_write_t *p_write)
 The application calls this function when it receives GATT write request on Heart rate service characteristic and descriptors. More...
 
wiced_bt_gatt_status_t wiced_bt_hrs_send_heart_rate (uint16_t conn_id, wiced_bt_hrs_notification_data_t *p_heart_rate_data)
 The application calls this function to send heart rate notification. More...
 
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. More...
 

Detailed Description

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

Typedef Documentation

typedef void( wiced_bt_hrs_event_cback_t)(wiced_bt_hrs_event_t event, wiced_bt_hrs_event_data_t *p_data)

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.

Enumeration Type Documentation

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.

Function Documentation

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.
wiced_result_t wiced_bt_hrs_init ( wiced_bt_hrs_event_cback_t p_callback,
wiced_bt_hrs_handles_t p_gatt_handles 
)

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.
wiced_bt_gatt_status_t wiced_bt_hrs_process_client_read_req ( uint16_t  conn_id,
wiced_bt_gatt_read_t p_read 
)

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
wiced_bt_gatt_status_t wiced_bt_hrs_process_client_write_req ( uint16_t  conn_id,
wiced_bt_gatt_write_t *  p_write 
)

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.)
wiced_bt_gatt_status_t wiced_bt_hrs_send_heart_rate ( uint16_t  conn_id,
wiced_bt_hrs_notification_data_t p_heart_rate_data 
)

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.