Go to the documentation of this file.
62 #include "custom_config.h"
70 #define ANS_C_CONNECTION_MAX 10
71 #define ANS_C_ERROR_CMD_NOT_SUP 0xa0
72 #define ANS_C_UTF_8_STR_LEN_MAX 18
73 #define ANS_C_ALERT_NTF_CTRL_PT_VAL_LEN 2
80 #define ANS_C_SMPL_ALERT_SUP (0x01 << 0)
81 #define ANS_C_EMAIL_SUP (0x01 << 1)
82 #define ANS_C_NEWS_SUP (0x01 << 2)
83 #define ANS_C_CALL_SUP (0x01 << 3)
84 #define ANS_C_MISSED_CALL_SUP (0x01 << 4)
85 #define ANS_C_SMS_MMS_SUP (0x01 << 5)
86 #define ANS_C_VOICE_MAIL_SUP (0x01 << 6)
87 #define ANS_C_SCHEDULE_SUP (0x01 << 7)
88 #define ANS_C_HG_PRIO_ALERT_SUP (0x01 << 8)
89 #define ANS_C_INSTANT_MES (0x01 << 9)
90 #define ANS_C_ALL_CAT_SUP (0x03ff)
@ ANS_C_EVT_UNREAD_ALERT_RECEIVE
ANS Client has received Unread Alert Status value (Notification from peer).
@ ANS_C_CTRL_PT_DIS_NEW_INC_ALERT_NTF
Disable New Incoming Alert Notification.
uint16_t ans_new_alert_cccd_handle
ANS CCCD handle of New Alert characteristic which has been got from peer.
Alert Notification Service Client event.
uint16_t ans_ctrl_pt_handle
ANS Control Point characteristic Value handle which has been got from peer.
@ ANS_C_EVT_DISCOVERY_COMPLETE
ANS Client has found ANS service and its characteristics.
@ ANS_C_EVT_INVALID
ANS Client invalid event type.
uint8_t length
Length of Text String.
@ ANS_C_EVT_SUP_UNREAD_ALERT_CAT_REC
ANS Client has received Supported Unread Alert Category value (Read from peer).
ans_c_ctrl_pt_id_t
Alert Notification Service Client Control point ID.
ans_c_alert_cat_id_t cat_id
Category ID.
@ ANS_C_CAT_ID_SMS_MMS
SMS/MMS: SMS/MMS message arrives.
@ ANS_C_CAT_ID_INSTANT_MES
Instant Message: Alert for incoming instant messages.
@ ANS_C_EVT_DISCOVERY_FAIL
ANS Client found ANS service failed because of invalid operation or no found at the peer.
@ ANS_C_CAT_ID_ALL
All Categories of alerts/messages.
ans_c_unread_alert_t unread_alert
Unread Alert Status value.
@ ANS_C_EVT_WRITE_OP_ERR
Error occured when ANS Client wrote to peer.
uint8_t alert_num
Number of new alert.
sdk_err_t ans_c_new_alert_notify_set(uint8_t conn_idx, bool is_enable)
Enable or disable peer New Alert characteristic notify.
@ ANS_C_CTRL_PT_NTF_NEW_INC_ALERT_IMME
Notify New Incoming Alert immediately.
ans_c_alert_cat_id_t
Alert Notification Service Categories of alerts/messages.
@ ANS_C_CAT_ID_EMAIL
Email: Alert when Email messages arrives.
ans_c_evt_type_t evt_type
The ANS event type.
uint16_t ans_sup_new_alert_cat_handle
ANS Supported New Alert Category characteristic Value handle which has been got from peer.
uint16_t sup_new_alert_cat_ids
Alert status received.
@ ANS_C_EVT_UNREAD_ALERT_STA_NTF_SET_SUCCESS
ANS Client has set Unread Alert Status notification.
uint16_t ans_unread_alert_handle
ANS Unread Alert characteristic Value handle which has been got from peer.
@ ANS_C_CTRL_PT_EN_UNREAD_CAT_STA_NTF
Enable Unread Category Status Notification.
sdk_err_t ans_c_unread_alert_notify_set(uint8_t conn_idx, bool is_enable)
Enable or disable peer Unread Alert characteristic notify.
uint16_t ans_sup_unread_alert_cat_handle
ANS Supported Unread Alert Category characteristic Value handle which has been got from peer.
uint16_t ans_srvc_end_handle
ANS Service end handle.
Alert Notification Service Client Control Point value.
@ ANS_C_EVT_CTRL_POINT_SET_SUCCESS
ANS Client has written Control Point completely.
@ ANS_C_EVT_NEW_ALERT_NTF_SET_SUCCESS
ANS Client has set NEW Alert notification.
@ AANS_C_CAT_ID_NB
Number of all Categories of alerts/messages.
Alert Notification Service Client decoded Unread Alert Status value.
@ ANS_C_CTRL_PT_EN_NEW_INC_ALERT_NTF
Enable New Incoming Alert Notification.
@ ANS_C_CAT_ID_SCHEDULE
Schedule: Alert occurred on calendar, planner.
uint8_t conn_idx
The index of the connection.
@ ANS_C_CAT_ID_MISSED_CALL
Missed call: Missed Call.
uint16_t ans_new_alert_handle
ANS New Alert characteristic Value handle which has been got from peer.
@ ANS_C_CAT_ID_CALL
Call: Incoming call.
@ ANS_C_CAT_ID_SMPL_ALERT
Simple Alert: General text alert or non-text alert.
sdk_err_t ans_c_sup_new_alert_cat_read(uint8_t conn_idx)
Read Supported New Alert Category characteristic value.
uint16_t ans_srvc_start_handle
ANS Service start handle.
sdk_err_t ans_client_init(ans_c_evt_handler_t evt_handler)
Register ANS Client event handler.
ans_c_alert_cat_id_t cat_id
Category ID.
Profile/Service Common Types.
uint16_t sup_unread_alert_cat_ids
Ringer setting received.
uint16_t sdk_err_t
SDK API result type.
@ ANS_C_CAT_ID_HG_PRIO_ALERT
High Prioritized Alert: Alert that should be handled as high priority.
void(* ans_c_evt_handler_t)(ans_c_evt_t *p_evt)
Alert Notification Service Client event handler type.
uint16_t ans_unread_alert_cccd_handle
ANS CCCD handle of Unread Alert characteristic which has been got from peer.
sdk_err_t ans_c_sup_unread_alert_cat_read(uint8_t conn_idx)
Read Supported Unread Alert Category characteristic value.
Handles on the connected peer device needed to interact with it.
@ ANS_C_EVT_SUP_NEW_ALERT_CAT_RECEIV
ANS Client has received Supported New Alert Category value (Read from peer).
ans_c_alert_cat_id_t cat_id
Category ID.
@ ANS_C_CTRL_PT_DIS_UNREAD_CAT_STA_NTF
Disable Unread Category Status Notification.
ans_c_evt_type_t
Alert Notification Service Client Event type.
sdk_err_t ans_c_disc_srvc_start(uint8_t conn_idx)
Discover Alert Notification Service on peer.
@ ANS_C_CAT_ID_VOICE_MAIL
Voice mail: Voice mail.
@ ANS_C_CTRL_PT_NTF_UNREAD_CAT_STA_IMME
Notify Unread Category Status immediately.
sdk_err_t ans_c_ctrl_point_set(uint8_t conn_idx, ans_c_ctrl_pt_t *p_ctrl_pt)
Set Control Point characteristic value.
@ ANS_C_EVT_NEW_ALERT_RECEIVE
ANS Client has received New Alert value (Notification from peer).
Alert Notification Service Client decoded New Alert value.
uint8_t unread_num
Number of unread alert.
@ ANS_C_CAT_ID_NEWS
News: News feeds such as RSS, Atom.
ans_c_new_alert_t new_alert
New Alert value.
ans_c_ctrl_pt_id_t cmd_id
Command ID.
#define ANS_C_UTF_8_STR_LEN_MAX
Maximum length of “UTF-8 string”.