Go to the documentation of this file.
62 #include "custom_config.h"
70 #define ANS_CONNECTION_MAX 10
71 #define ANS_ERROR_CMD_NOT_SUP 0xa0
72 #define ANS_UTF_8_STR_LEN_MAX 18
73 #define ANS_SUP_NEW_ALERT_CAT_VAL_LEN 2
74 #define ANS_NEWS_ALERT_VAL_LEN (ANS_UTF_8_STR_LEN_MAX + 2)
75 #define ANS_SUP_UNREAD_ALERT_CAT_VAL_LEN 2
76 #define ANS_UNREAD_ALERT_STA_VAL_LEN 2
77 #define ANS_ALERT_NTF_CTRL_PT_VAL_LEN 2
84 #define ANS_SMPL_ALERT_SUP (0x01 << 0)
85 #define ANS_EMAIL_SUP (0x01 << 1)
86 #define ANS_NEWS_SUP (0x01 << 2)
87 #define ANS_CALL_SUP (0x01 << 3)
88 #define ANS_MISSED_CALL_SUP (0x01 << 4)
89 #define ANS_SMS_MMS_SUP (0x01 << 5)
90 #define ANS_VOICE_MAIL_SUP (0x01 << 6)
91 #define ANS_SCHEDULE_SUP (0x01 << 7)
92 #define ANS_HG_PRIO_ALERT_SUP (0x01 << 8)
93 #define ANS_INSTANT_MES (0x01 << 9)
94 #define ANS_ALL_CAT_SUP (0x03ff)
ans_alert_cat_id_t cat_id
Category ID.
@ ANS_EVT_INVALID
Invalid ANS event type.
ans_alert_cat_id_t cat_id
Category ID.
@ ANS_CAT_ID_SCHEDULE
Schedule: Alert occurred on calendar, planner.
@ ANS_CTRL_PT_EN_UNREAD_CAT_STA_NTF
Enable Unread Category Status Notification.
@ ANS_CAT_ID_EMAIL
Email: Alert when Email messages arrive.
@ ANS_CTRL_PT_NTF_UNREAD_CAT_STA_IMME
Notify Unread Category Status immediately.
uint8_t alert_num
Number of new alert.
@ ANS_CAT_ID_CALL
Call: Incoming call.
ans_ctrl_pt_id_t
Alert Notification Service Control point.
Alert Notification Service event.
uint8_t unread_num
Number of unread alert.
uint16_t cat_ids
Category IDs.
@ ANS_CAT_ID_NB
Number of all Categories of alerts/messages.
sdk_err_t ans_service_init(ans_init_t *p_ans_init)
Initialize an Alert Notification Service instance and add to the DB.
@ ANS_CAT_ID_HG_PRIO_ALERT
High Prioritized Alert: Alert that should be handled as high priority.
@ ANS_CAT_ID_SMS_MMS
SMS/MMS: SMS/MMS message arrives.
@ ANS_EVT_UNREAD_ALERT_STA_NTF_ENABLE
Unread Alert Status notification is enabled.
@ ANS_CAT_ID_INSTANT_MES
Instant Message: Alert for incoming instant messages.
Alert Notification Service Unread Alert Status value.
@ ANS_CAT_ID_MISSED_CALL
Missed call: Missed Call.
@ ANS_CTRL_PT_DIS_UNREAD_CAT_STA_NTF
Disable Unread Category Status Notification.
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.
@ ANS_EVT_NEW_ALERT_IMME_NTF_REQ
Request: notify the New Alert characteristic to the client immediately.
@ ANS_EVT_Unread_ALERT_IMME_NTF_REQ
Request: notify the Unread Alert Status characteristic to the client immediately.
ans_evt_type_t
Alert Notification Service Event type.
uint8_t length
Length of Text String.
@ ANS_CAT_ID_VOICE_MAIL
Voice mail: Voice mail.
ans_alert_cat_id_t cat_id
Category ID.
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.
@ ANS_CAT_ID_ALL
All Categories of alerts/messages.
ans_evt_type_t evt_type
The ANS event type.
@ ANS_CTRL_PT_NTF_NEW_INC_ALERT_IMME
Notify New Incoming Alert immediately.
uint16_t sdk_err_t
SDK API result type.
#define ANS_UTF_8_STR_LEN_MAX
Maximum length of “UTF-8 string”.
Alert Notification Service Control Point value.
Alert Notification Service init stucture.
@ ANS_CAT_ID_NEWS
News: News feeds such as RSS, Atom.
ans_evt_handler_t evt_handler
Phone Alert Status Service event handler.
Alert Notification Service New Alert value.
ans_alert_cat_id_t
Alert Notification Service Categories of alerts/messages.
@ ANS_CTRL_PT_EN_NEW_INC_ALERT_NTF
Enable New Incoming Alert Notification.
@ ANS_CAT_ID_SMPL_ALERT
Simple Alert: General text alert or non-text alert.
@ ANS_EVT_NEW_ALERT_NTF_DISABLE
NEW Alert notification is disabled.
@ ANS_EVT_UNREAD_ALERT_STA_NTF_DISABLE
Unread Alert Status notification is disabled.
@ ANS_CTRL_PT_DIS_NEW_INC_ALERT_NTF
Disable New Incoming Alert Notification.
uint16_t sup_new_alert_cat
Initial mask of Supported New Alert Category.
uint8_t conn_idx
The index of the connection.
ans_ctrl_pt_id_t cmd_id
Command ID.
void(* ans_evt_handler_t)(ans_evt_t *p_evt)
Alert Notification Service event handler type.
@ ANS_EVT_NEW_ALERT_NTF_ENABLE
NEW Alert notification is enabled.
uint16_t sup_unread_alert_sta
Initial mask of Unread Alert Status.