Classes | Macros | Typedefs | Enumerations | Functions
ans.h File Reference

Alert Notification Service API. More...

`#include "gr_includes.h"`
`#include "custom_config.h"`
`#include <stdint.h>`
`#include <stdbool.h>`
Include dependency graph for ans.h:

Go to the source code of this file.

## Classes
struct | ans_new_alert_t
| Alert Notification Service New Alert value. More...
struct | ans_unread_alert_t
| Alert Notification Service Unread Alert Status value. More...
struct | ans_ctrl_pt_t
| Alert Notification Service Control Point value. More...
struct | ans_evt_t
| Alert Notification Service event. More...
struct | ans_init_t
| Alert Notification Service init stucture. More...

## Macros
#define | ANS_CONNECTION_MAX 10
| Maximum number of Alert Notification Service connections. More...
#define | ANS_ERROR_CMD_NOT_SUP 0xa0
| Command not supported. More...
#define | ANS_UTF_8_STR_LEN_MAX 18
| Maximum length of “UTF-8 string”. More...
#define | ANS_SUP_NEW_ALERT_CAT_VAL_LEN 2
| Length of Supported New Alert Category value. More...
#define | ANS_NEWS_ALERT_VAL_LEN (ANS_UTF_8_STR_LEN_MAX + 2)
| Length of New Alert value. More...
#define | ANS_SUP_UNREAD_ALERT_CAT_VAL_LEN 2
| Length of Supported Unread Alert Category value. More...
#define | ANS_UNREAD_ALERT_STA_VAL_LEN 2
| Length of Unread Alert Status value. More...
#define | ANS_ALERT_NTF_CTRL_PT_VAL_LEN 2
| Length of Alert Notification Control Point value. More...
#define | ANS_SMPL_ALERT_SUP (0x01 << 0)
| Bit for Simple Alert Supported. More...
#define | ANS_EMAIL_SUP (0x01 << 1)
| Bit for Email Supported. More...
#define | ANS_NEWS_SUP (0x01 << 2)
| Bit for News Supported. More...
#define | ANS_CALL_SUP (0x01 << 3)
| Bit for Call Supported. More...
#define | ANS_MISSED_CALL_SUP (0x01 << 4)
| Bit for Missed Call Supported. More...
#define | ANS_SMS_MMS_SUP (0x01 << 5)
| Bit for SMS/MMS Supported. More...
#define | ANS_VOICE_MAIL_SUP (0x01 << 6)
| Bit for Voice Mail Supported. More...
#define | ANS_SCHEDULE_SUP (0x01 << 7)
| Bit for Schedule Supported. More...
#define | ANS_HG_PRIO_ALERT_SUP (0x01 << 8)
| Bit for High Prioritized Alert Supported. More...
#define | ANS_INSTANT_MES (0x01 << 9)
| Bit for Instant Message Supported. More...
#define | ANS_ALL_CAT_SUP (0x03ff)
| Bit for All Category Supported. More...

## Typedefs
typedef void(* | ans_evt_handler_t) (ans_evt_t *p_evt)
| Alert Notification Service event handler type. More...

## Enumerations
enum | ans_alert_cat_id_t { ANS_CAT_ID_SMPL_ALERT, ANS_CAT_ID_EMAIL, ANS_CAT_ID_NEWS, ANS_CAT_ID_CALL, ANS_CAT_ID_MISSED_CALL, ANS_CAT_ID_SMS_MMS, ANS_CAT_ID_VOICE_MAIL, ANS_CAT_ID_SCHEDULE, ANS_CAT_ID_HG_PRIO_ALERT, ANS_CAT_ID_INSTANT_MES, ANS_CAT_ID_NB, ANS_CAT_ID_ALL = 0xff }
| Alert Notification Service Categories of alerts/messages. More...
enum | ans_ctrl_pt_id_t { ANS_CTRL_PT_EN_NEW_INC_ALERT_NTF, ANS_CTRL_PT_EN_UNREAD_CAT_STA_NTF, ANS_CTRL_PT_DIS_NEW_INC_ALERT_NTF, ANS_CTRL_PT_DIS_UNREAD_CAT_STA_NTF, ANS_CTRL_PT_NTF_NEW_INC_ALERT_IMME, ANS_CTRL_PT_NTF_UNREAD_CAT_STA_IMME }
| Alert Notification Service Control point. More...
enum | ans_evt_type_t { ANS_EVT_INVALID, ANS_EVT_NEW_ALERT_NTF_ENABLE, ANS_EVT_NEW_ALERT_NTF_DISABLE, ANS_EVT_UNREAD_ALERT_STA_NTF_ENABLE, ANS_EVT_UNREAD_ALERT_STA_NTF_DISABLE, ANS_EVT_NEW_ALERT_IMME_NTF_REQ, ANS_EVT_Unread_ALERT_IMME_NTF_REQ }
| Alert Notification Service Event type. More...

## Functions
sdk_err_t | ans_service_init (ans_init_t *p_ans_init)
| Initialize an Alert Notification Service instance and add to the DB. More...
sdk_err_t | ans_new_alert_send (uint8_t conn_idx, ans_new_alert_t *p_new_alert)
| Send New Alert if its notification has been enabled. More...
sdk_err_t | ans_unread_alert_send (uint8_t conn_idx, ans_unread_alert_t *p_unread_alert)
| Send Unread Alert Status if its notification has been enabled. More...

## Detailed Description

Alert Notification Service API.

Attention

  ##### Copyright (c) 2019 GOODIX

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file ans.h.