The ANS library of the AIROC BTSDK provide a simple method for an application to integrate the ANS service functionality.
More...
The ANS library of the AIROC BTSDK provide a simple method for an application to integrate the ANS service functionality.
The application calls the library APIs to configure supported alerts, to process alert notification client GATT read, write requests for enable/disable/control the alerts.
wiced_bool_t wiced_bt_ans_clear_alerts |
( |
uint16_t |
conn_id, |
|
|
wiced_bt_anp_alert_category_id_t |
category_id |
|
) |
| |
The application calls this API to clear the new alert and unread alert count.of the specified category.
The library clears the new alert count and unread alert count of a given category.
- Parameters
-
conn_id | : GATT connection ID |
category_id | : Unread Alert category ID. see ANP_ALERT_CATEGORY_ID. "Alert category ID". |
- Returns
- WICED_TRUE : On success. WICED_FALSE : On the invalid category ID.
void wiced_bt_ans_connection_down |
( |
uint16_t |
conn_id | ) |
|
The application calls this API when the application is disconnected from the client.
- Parameters
-
conn_id | : GATT connection ID |
- Returns
- None.
void wiced_bt_ans_connection_up |
( |
uint16_t |
conn_id | ) |
|
The application calls this API when the application is connected with the alert notification client.
- Parameters
-
conn_id | : GATT connection ID |
- Returns
- None.
The application calls this API on an application start to initialize the AIROC BTSDK ANS server library.
The ANS GATT Handles are defined in the application. These handles must be passed to the ANS library t initialization time.
- Parameters
-
p_gatt_handles | : Pointer on a structure containing the Service Handles |
- Returns
- None.
wiced_bt_gatt_status_t wiced_bt_ans_process_and_send_new_alert |
( |
uint16_t |
conn_id, |
|
|
wiced_bt_anp_alert_category_id_t |
category_id |
|
) |
| |
The application calls this API to process and send a new alert.on given alert category ID.
The library increments the new alert count of the specified category. The library sends a new alert to 5the alert notification client if the client already configured to receive notification of the given category, otherwise the server send a new alert wheneven theclient enables. The count will be cleared when the alert is sent to the client or when theapplication asks to clear the alerts
- Parameters
-
conn_id | : GATT connection ID |
category_id | : New Alert category ID. ANP_ALERT_CATEGORY_ID."Alert category ID". |
- Returns
- Status of the GATT notification.
wiced_bt_gatt_status_t wiced_bt_ans_process_and_send_unread_alert |
( |
uint16_t |
conn_id, |
|
|
wiced_bt_anp_alert_category_id_t |
category_id |
|
) |
| |
The application calls this API to process and send the unread alert.on given alert category ID.
The library increments the unread alert count of the specified category. The library sends an unread alert to thealert notification client if client already configured to receive notification of the given category, otherwise server send the unread alert wheneven theclient enables. The count will be cleared when the alert is sent to theclient or when theapplication asks to clear the alerts
- Parameters
-
conn_id | : GATT connection ID |
category_id | : Unread Alert category ID. ANP_ALERT_CATEGORY_ID. "Alert category ID". |
- Returns
- Status of the GATT notification.
The application calls this API to process alert notification client GATT read requests.
The alert notification client uses the GATT read procedure to know server-supported new alerts, unread alerts and to check GATT notification configuration enabled/disabled for new alerts and/or unread alerts.
- Parameters
-
conn_id | : GATT connection ID |
p_read | : GATT read request. |
- Returns
- Status of the GATT read.operation
The application calls this API to process alert notification client GATT write requests.
The alert notification client uses the GATT write procedure to configure, enable/disable and to control the alerts.
- Parameters
-
conn_id | : GATT connection ID |
p_write | : GATT write request. |
- Returns
- Status of the GATT write.operation.
void wiced_bt_ans_set_supported_new_alert_categories |
( |
uint16_t |
conn_id, |
|
|
wiced_bt_anp_alert_category_enable_t |
supported_new_alert_cat |
|
) |
| |
The application calls this API to set Server supported new alert categories.
This API should be called before the application connects to the alert notification client. Supported new alerts static during the connection.
- Parameters
-
conn_id | : GATT connection ID |
supported_new_alert_cat | : Server-supported new alert categories. Each category is represented by a bit. The bit is positioned by the category ID value. ANP_ALERT_CATEGORY_ENABLE."Alert category enable bit mask". |
- Returns
- None.
void wiced_bt_ans_set_supported_unread_alert_categories |
( |
uint16_t |
conn_id, |
|
|
wiced_bt_anp_alert_category_enable_t |
supported_unread_alert_cat |
|
) |
| |
The application calls this API to set Server supported unread alert categories.
This API should be called before the application connects to the alert notification client. Supported unread alerts static during the connection.
- Parameters
-
conn_id | : GATT connection ID |
supported_unread_alert_cat | : Server-supported unread alert categories. Each category is represented by a bit. The bit is positioned by the category ID value. ANP_ALERT_CATEGORY_ENABLE."Alert category enable bit mask". |
- Returns
- None.