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

ANC library of the AIROC BTSDK provide a simple method for an application to integrate ANC service functionality. More...

Data Structures

struct  wiced_bt_anc_discovery_result_t
 Data associated with WICED_BT_ANC_DISCOVER_RESULT. More...
 
struct  wiced_bt_anc_supported_new_alerts_result_t
 Data associated with WICED_BT_ANC_READ_SUPPORTED_NEW_ALERTS_RESULT. More...
 
struct  wiced_bt_anc_supported_unread_alerts_result_t
 Data associated with WICED_BT_ANC_READ_SUPPORTED_UNREAD_ALERTS_RESULT. More...
 
struct  wiced_bt_anc_control_alerts_result_t
 Data associated with WICED_BT_ANC_CONTROL_ALERTS_RESULT. More...
 
struct  wiced_bt_anc_enable_disable_alerts_result_t
 Data associated with WICED_BT_ANC_ENABLE_NEW_ALERTS_RESULT and WICED_BT_ANC_DISABLE_NEW_ALERTS_RESULT. More...
 
struct  wiced_bt_anc_new_alert_notification_t
 Data associated with WICED_BT_ANC_EVENT_NEW_ALERT_NOTIFICATION. More...
 
struct  wiced_bt_anc_unread_alert_notification_t
 Data associated with WICED_BT_ANC_EVENT_UNREAD_ALERT_NOTIFICATION. More...
 
union  wiced_bt_anc_event_data_t
 Union of data associated with ANC events. More...
 

Typedefs

typedef void( wiced_bt_anc_callback_t )(wiced_bt_anc_event_t event, wiced_bt_anc_event_data_t *p_data)
 ANC Callback function type wiced_bt_anc_callback_t. More...
 

Enumerations

enum  wiced_bt_anc_event_t {
  WICED_BT_ANC_DISCOVER_RESULT, WICED_BT_ANC_READ_SUPPORTED_NEW_ALERTS_RESULT, WICED_BT_ANC_READ_SUPPORTED_UNREAD_ALERTS_RESULT, WICED_BT_ANC_CONTROL_ALERTS_RESULT,
  WICED_BT_ANC_ENABLE_NEW_ALERTS_RESULT, WICED_BT_ANC_DISABLE_NEW_ALERTS_RESULT, WICED_BT_ANC_ENABLE_UNREAD_ALERTS_RESULT, WICED_BT_ANC_DISABLE_UNREAD_ALERTS_RESULT,
  WICED_BT_ANC_EVENT_NEW_ALERT_NOTIFICATION, WICED_BT_ANC_EVENT_UNREAD_ALERT_NOTIFICATION
}
 ANC Events received by the applicaton's ANC callback (see wiced_bt_anc_callback_t) More...
 

Functions

wiced_result_t wiced_bt_anc_init (wiced_bt_anc_callback_t *p_callback)
 The application calls this API on an application start to initialize the AIROC BTSDK ANS server library. More...
 
wiced_bt_gatt_status_t wiced_bt_anc_discover (uint16_t conn_id, uint16_t start_handle, uint16_t end_handle)
 The application calls this API to Performs ANC characteristics discovery and characteristic descriptor discovery. More...
 
void wiced_bt_anc_discovery_result (wiced_bt_gatt_discovery_result_t *p_data)
 The application calls this API during GATT discovery to pass discovery results for the ANC service to the ANC Library. More...
 
void wiced_bt_anc_client_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 ANC service to the ANC Library. More...
 
wiced_bt_gatt_status_t wiced_bt_anc_read_server_supported_new_alerts (uint16_t conn_id)
 Once GATT discovery is complete, the Application calls this API to read the supported new alerts. More...
 
wiced_bt_gatt_status_t wiced_bt_anc_read_server_supported_unread_alerts (uint16_t conn_id)
 Once GATT discovery is complete, the Application call to Read the Value of Supported Unread Alert Categories. More...
 
wiced_bt_gatt_status_t wiced_bt_anc_control_required_alerts (uint16_t conn_id, wiced_bt_anp_alert_control_cmd_id_t cmd_id, wiced_bt_anp_alert_category_id_t category)
 The application use this API to control notifications using Alert notification control point characteristic. More...
 
wiced_bt_gatt_status_t wiced_bt_anc_enable_new_alerts (uint16_t conn_id)
 The application use this API to write client characteristic configuration descriptor (to start receiving new alerts). More...
 
wiced_bt_gatt_status_t wiced_bt_anc_disable_new_alerts (uint16_t conn_id)
 The application use this API to write client characteristic configuration descriptor (to stop receiving new alerts). More...
 
wiced_bt_gatt_status_t wiced_bt_anc_enable_unread_alerts (uint16_t conn_id)
 The application use this API to write client characteristic configuration descriptor (to start receiving new unread alerts). More...
 
wiced_bt_gatt_status_t wiced_bt_anc_disable_unread_alerts (uint16_t conn_id)
 The application use this API to write client characteristic configuration descriptor (to stop receiving new unread alerts). More...
 
wiced_bt_gatt_status_t wiced_bt_anc_recover_new_alerts_from_conn_loss (uint16_t conn_id, wiced_bt_anp_alert_control_cmd_id_t cmd_id, wiced_bt_anp_alert_category_id_t category)
 The application use this API to enable new alerts and control alerts. More...
 
wiced_bt_gatt_status_t wiced_bt_anc_recover_new_unread_alerts_from_conn_loss (uint16_t conn_id, wiced_bt_anp_alert_control_cmd_id_t cmd_id, wiced_bt_anp_alert_category_id_t category)
 The application use this API to enable unread alerts and control alerts. More...
 
void wiced_bt_anc_write_rsp (wiced_bt_gatt_operation_complete_t *p_data)
 The application should call this function when it receives GATT Write Response for the attribute handle which belongs to the ANC service. More...
 
void wiced_bt_anc_read_rsp (wiced_bt_gatt_operation_complete_t *p_data)
 The application should call this function when it receives GATT Read Response for the attribute handle which belongs to the ANC service. More...
 
void wiced_bt_anc_client_connection_up (wiced_bt_gatt_connection_status_t *p_conn_status)
 The application should call this function when LE connection with a peer device has been established. More...
 
void wiced_bt_anc_client_connection_down (wiced_bt_gatt_connection_status_t *p_conn_status)
 The application should call this function when LE connection with a peer device has been disconnected. More...
 
void wiced_bt_anc_client_process_notification (wiced_bt_gatt_operation_complete_t *p_data)
 This function processes the ANC process Notification. More...
 

Detailed Description

ANC library of the AIROC BTSDK provide a simple method for an application to integrate ANC service functionality.

Application calls the library APIs to discover/enable/disable/control/read the alerts.

Typedef Documentation

typedef void( wiced_bt_anc_callback_t)(wiced_bt_anc_event_t event, wiced_bt_anc_event_data_t *p_data)

ANC Callback function type wiced_bt_anc_callback_t.

This function is called to send ANC events to the application. This function is registered with the wiced_bt_anc_init function.

Parameters
[in]event: ANC Event.
[in]p_data: Data (pointer on union of structure) associated with the event.
Returns
NONE.

Enumeration Type Documentation

ANC Events received by the applicaton's ANC callback (see wiced_bt_anc_callback_t)

Enumerator
WICED_BT_ANC_DISCOVER_RESULT 

ANC Discovery Result.

WICED_BT_ANC_READ_SUPPORTED_NEW_ALERTS_RESULT 

ANC read Supported New Alert Result.

WICED_BT_ANC_READ_SUPPORTED_UNREAD_ALERTS_RESULT 

ANC read Supported Unread Alert Result.

WICED_BT_ANC_CONTROL_ALERTS_RESULT 

ANC Control Alert Result.

WICED_BT_ANC_ENABLE_NEW_ALERTS_RESULT 

ANC Enable New Alert Notification Result.

WICED_BT_ANC_DISABLE_NEW_ALERTS_RESULT 

ANC Disable New Alert Notification Result.

WICED_BT_ANC_ENABLE_UNREAD_ALERTS_RESULT 

ANC Enable Unread Alert Notification Result.

WICED_BT_ANC_DISABLE_UNREAD_ALERTS_RESULT 

ANC Disable Unread Alert Notification Result.

WICED_BT_ANC_EVENT_NEW_ALERT_NOTIFICATION 

ANC New Alert Notification.

WICED_BT_ANC_EVENT_UNREAD_ALERT_NOTIFICATION 

ANC Unread Alert Notification.

Function Documentation

void wiced_bt_anc_client_connection_down ( wiced_bt_gatt_connection_status_t p_conn_status)

The application should call this function when LE connection with a peer device has been disconnected.

Parameters
p_conn_status: pointer to a wiced_bt_gatt_connection_status_t which includes the address and connection ID.
Returns
none.
void wiced_bt_anc_client_connection_up ( wiced_bt_gatt_connection_status_t p_conn_status)

The application should call this function when LE connection with a peer device has been established.

Parameters
p_conn_status: pointer to a wiced_bt_gatt_connection_status_t which includes the address and connection ID.
Returns
none
void wiced_bt_anc_client_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 ANC service to the ANC 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_anc_client_process_notification ( wiced_bt_gatt_operation_complete_t p_data)

This function processes the ANC process Notification.

Parameters
p_data: pointer to a GATT operation complete data structure.
Returns
none.
wiced_bt_gatt_status_t wiced_bt_anc_control_required_alerts ( uint16_t  conn_id,
wiced_bt_anp_alert_control_cmd_id_t  cmd_id,
wiced_bt_anp_alert_category_id_t  category 
)

The application use this API to control notifications using Alert notification control point characteristic.

Upon reception of the GATT operation result, the application must provides GATT operation result through wiced_bt_anc_read_rsp API.

Parameters
conn_id: GATT connection id.
cmd_id: ANC alert command id.
category: ANC alert category id.
Returns
Status of the GATT operation.
wiced_bt_gatt_status_t wiced_bt_anc_disable_new_alerts ( uint16_t  conn_id)

The application use this API to write client characteristic configuration descriptor (to stop receiving new alerts).

Upon reception of the GATT operation result, the application must provides GATT operation result through wiced_bt_anc_read_rsp API.

Parameters
conn_idGATT connection id.
Returns
Status of the GATT operation.
wiced_bt_gatt_status_t wiced_bt_anc_disable_unread_alerts ( uint16_t  conn_id)

The application use this API to write client characteristic configuration descriptor (to stop receiving new unread alerts).

Upon reception of the GATT operation result, the application must provides GATT operation result through wiced_bt_anc_read_rsp API.

Parameters
conn_idGATT connection id.
Returns
Status of the GATT operation.
wiced_bt_gatt_status_t wiced_bt_anc_discover ( uint16_t  conn_id,
uint16_t  start_handle,
uint16_t  end_handle 
)

The application calls this API to Performs ANC characteristics discovery and characteristic descriptor discovery.

Once discovery complete, registered application p_op_complete_callback is called with result of operation.

Parameters
conn_id: GATT connection ID.
start_handle: Start GATT handle of the ANC service.
end_handle: End GATT handle of the ANC service.
Returns
Status of the GATT operation.
void wiced_bt_anc_discovery_result ( wiced_bt_gatt_discovery_result_t p_data)

The application calls this API during GATT discovery to pass discovery results for the ANC service to the ANC Library.

The library needs to find ANC service characteristics and associated characteristic client configuration descriptors.

Parameters
p_data: Discovery result data as passed from the stack.
Returns
none.
wiced_bt_gatt_status_t wiced_bt_anc_enable_new_alerts ( uint16_t  conn_id)

The application use this API to write client characteristic configuration descriptor (to start receiving new alerts).

Upon reception of the GATT operation result, the application must provides GATT operation result through wiced_bt_anc_read_rsp API.

Parameters
conn_idGATT connection id.
Returns
Status of the GATT operation.
wiced_bt_gatt_status_t wiced_bt_anc_enable_unread_alerts ( uint16_t  conn_id)

The application use this API to write client characteristic configuration descriptor (to start receiving new unread alerts).

Upon reception of the GATT operation result, the application must provides GATT operation result through wiced_bt_anc_read_rsp API.

Parameters
conn_idGATT connection id.
Returns
Status of the GATT operation.
wiced_result_t wiced_bt_anc_init ( wiced_bt_anc_callback_t p_callback)

The application calls this API on an application start to initialize the AIROC BTSDK ANS server library.

Application registered callbacks gets called when requested operations completed. Once connection success, Application does ANS service discovery. If ANS service is discovered successfully, calls below for Characteristic discovery.

Parameters
p_reg: Registration control block that includes ANC application call backs.
Returns
WICED_SUCCESS if ANC initialized successfully, error otherwise.
void wiced_bt_anc_read_rsp ( wiced_bt_gatt_operation_complete_t p_data)

The application should call this function when it receives GATT Read Response for the attribute handle which belongs to the ANC service.

This function will parse the data and provide the result through p_op_complete_callback.

Parameters
p_data: pointer to a GATT operation complete data structure.
Returns
none.
wiced_bt_gatt_status_t wiced_bt_anc_read_server_supported_new_alerts ( uint16_t  conn_id)

Once GATT discovery is complete, the Application calls this API to read the supported new alerts.

Upon reception of the GATT operation result, the application must provides GATT operation result through wiced_bt_anc_read_rsp API.

Parameters
conn_idGATT connection id.
Returns
Status of the GATT operation.
wiced_bt_gatt_status_t wiced_bt_anc_read_server_supported_unread_alerts ( uint16_t  conn_id)

Once GATT discovery is complete, the Application call to Read the Value of Supported Unread Alert Categories.

Upon reception of the GATT operation result, the application must provides GATT operation result through wiced_bt_anc_read_rsp API.

Parameters
conn_idGATT connection id.
Returns
Status of the GATT operation.
wiced_bt_gatt_status_t wiced_bt_anc_recover_new_alerts_from_conn_loss ( uint16_t  conn_id,
wiced_bt_anp_alert_control_cmd_id_t  cmd_id,
wiced_bt_anp_alert_category_id_t  category 
)

The application use this API to enable new alerts and control alerts.

This function sequentially call wiced_bt_anc_enable_new_alerts and wiced_bt_anc_control_required_alerts API inside the library.

Parameters
conn_idGATT connection id.
cmd_idANC alert command id.
categoryANC alert category id.
Returns
Status of the GATT operation.
wiced_bt_gatt_status_t wiced_bt_anc_recover_new_unread_alerts_from_conn_loss ( uint16_t  conn_id,
wiced_bt_anp_alert_control_cmd_id_t  cmd_id,
wiced_bt_anp_alert_category_id_t  category 
)

The application use this API to enable unread alerts and control alerts.

This function sequentially call wiced_bt_anc_enable_unread_alerts an wiced_bt_anc_control_required_alerts API inside the library.

Parameters
conn_idGATT connection id.
cmd_idANC alert command id.
categoryANC alert category id.
Returns
Status of the GATT operation.
void wiced_bt_anc_write_rsp ( wiced_bt_gatt_operation_complete_t p_data)

The application should call this function when it receives GATT Write Response for the attribute handle which belongs to the ANC service.

Parameters
p_data: pointer to a GATT operation complete data structure.
Returns
none.