AIROC™ BTSDK v4.4 - Documentation | ||||
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... | |
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... | |
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 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.
[in] | event | : ANC Event. |
[in] | p_data | : Data (pointer on union of structure) associated with the event. |
enum wiced_bt_anc_event_t |
ANC Events received by the applicaton's ANC callback (see wiced_bt_anc_callback_t)
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.
p_conn_status | : pointer to a wiced_bt_gatt_connection_status_t which includes the address and connection ID. |
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.
p_conn_status | : pointer to a wiced_bt_gatt_connection_status_t which includes the address and connection ID. |
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.
p_data | : Discovery complete data as passed from the stack. |
void wiced_bt_anc_client_process_notification | ( | wiced_bt_gatt_operation_complete_t * | p_data | ) |
This function processes the ANC process Notification.
p_data | : pointer to a GATT operation complete data structure. |
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.
conn_id | : GATT connection id. |
cmd_id | : ANC alert command id. |
category | : ANC alert category id. |
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.
conn_id | GATT connection id. |
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.
conn_id | GATT connection id. |
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.
conn_id | : GATT connection ID. |
start_handle | : Start GATT handle of the ANC service. |
end_handle | : End GATT handle of the ANC service. |
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.
p_data | : Discovery result data as passed from the stack. |
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.
conn_id | GATT connection id. |
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.
conn_id | GATT connection id. |
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.
p_reg | : Registration control block that includes ANC application call backs. |
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.
p_data | : pointer to a GATT operation complete data structure. |
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.
conn_id | GATT connection id. |
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.
conn_id | GATT connection id. |
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.
conn_id | GATT connection id. |
cmd_id | ANC alert command id. |
category | ANC alert category id. |
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.
conn_id | GATT connection id. |
cmd_id | ANC alert command id. |
category | ANC alert category id. |
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.
p_data | : pointer to a GATT operation complete data structure. |