Bluetooth LE Profile API document
Bluetooth LE Profile API document Rev.1.00 [May 22, 2020]
Alert Notification Service Client

This is the client for the Alert Notification Service Service. More...

Detailed Description

This is the client for the Alert Notification Service Service.

Data Structures

struct  st_ble_anc_supported_new_alert_category_t
 Supported New Alert Category value structure. More...
 
struct  st_ble_anc_supported_new_alert_category_attr_hdl_t
 Supported New Alert Category attribute handle value. More...
 
struct  st_ble_anc_new_alert_t
 New Alert value structure. More...
 
struct  st_ble_anc_new_alert_attr_hdl_t
 New Alert attribute handle value. More...
 
struct  st_ble_anc_supported_unread_alert_category_t
 Supported Unread Alert Category value structure. More...
 
struct  st_ble_anc_supported_unread_alert_category_attr_hdl_t
 Supported Unread Alert Category attribute handle value. More...
 
struct  st_ble_anc_unread_alert_status_t
 Unread Alert Status value structure. More...
 
struct  st_ble_anc_unread_alert_status_attr_hdl_t
 Unread Alert Status attribute handle value. More...
 
struct  st_ble_anc_alert_notification_control_point_t
 Alert Notification Control Point value structure. More...
 
struct  st_ble_anc_alert_notification_control_point_attr_hdl_t
 Alert Notification Control Point attribute handle value. More...
 
struct  st_ble_anc_evt_data_t
 Alert Notification Service client event data. More...
 

Macros

#define BLE_ANC_NEW_ALERT_TEXT_LEN   (18)
 New Alert Text length. More...
 
#define BLE_ANC_SUPPORTED_NEW_ALERT_CATEGORY_UUID   (0x2A47)
 
#define BLE_ANC_SUPPORTED_NEW_ALERT_CATEGORY_LEN   (2)
 
#define BLE_ANC_NEW_ALERT_UUID   (0x2A46)
 
#define BLE_ANC_NEW_ALERT_LEN   (2)
 
#define BLE_ANC_NEW_ALERT_CLI_CNFG_UUID   (0x2902)
 
#define BLE_ANC_NEW_ALERT_CLI_CNFG_LEN   (2)
 
#define BLE_ANC_SUPPORTED_UNREAD_ALERT_CATEGORY_UUID   (0x2A48)
 
#define BLE_ANC_SUPPORTED_UNREAD_ALERT_CATEGORY_LEN   (2)
 
#define BLE_ANC_UNREAD_ALERT_STATUS_UUID   (0x2A45)
 
#define BLE_ANC_UNREAD_ALERT_STATUS_LEN   (2)
 
#define BLE_ANC_UNREAD_ALERT_STATUS_CLI_CNFG_UUID   (0x2902)
 
#define BLE_ANC_UNREAD_ALERT_STATUS_CLI_CNFG_LEN   (2)
 
#define BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_UUID   (0x2A44)
 
#define BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_LEN   (2)
 
#define BLE_ANC_COMMAND_NOT_SUPPORTED_ERROR   (BLE_ERR_GROUP_GATT | 0xA0)
 command not supported More...
 

Enumerations

enum  e_ble_anc_alert_notification_control_point_command_id_t {
  BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_ENABLE_NEW_INCOMING_ALERT_NOTIFICATION = 0,
  BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_ENABLE_UNREAD_CATEGORY_STATUS_NOTIFICATION = 1,
  BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_DISABLE_NEW_INCOMING_ALERT_NOTIFICATION = 2,
  BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_DISABLE_UNREAD_CATEGORY_STATUS_NOTIFICATION = 3,
  BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_NOTIFY_NEW_INCOMING_ALERT_IMMEDIATELY = 4,
  BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_NOTIFY_UNREAD_CATEGORY_STATUS_IMMEDIATELY = 5
}
 Alert Notification Control Point Command ID enumeration. More...
 
enum  e_ble_anc_alert_notification_control_point_category_id_t {
  BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_SIMPLE_ALERT__GENERAL_TEXT_ALERT_OR_NON_TEST_ALERT = 0,
  BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_EMAIL__ALERT_WHEN_EMAIL_MESSAGES_ARRIVES = 1,
  BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_NEWS_NEWS_FEEDS_SUCH_AS_RSS_ATOM = 2,
  BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_CALL_INCOMING_CALL = 3,
  BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_MISSED_CALL_MISSED_CALL = 4,
  BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_SMS_MMS__SMS_MMS_MESSAGES_ARRIVES = 5,
  BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_VOICE_MAIL__VOICE_MAIL = 6,
  BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_SCHEDULE__ALERT_OCCURED_ON_CALENDAR_PLANNER = 7,
  BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_HIGH_PRIORITIDED_ALERT__ALERT_THAT_SHOULD_BE_HANDLED_AS_HIGH_PRIORITY = 8,
  BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_INSTANT_MESSAGE_ALERT_FOR_INCOMING_INSTANT_MESSAGES = 9,
  BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_ALL = 255
}
 Alert Notification Control Point Category ID enumeration. More...
 
enum  e_ble_anc_char_idx_t {
  BLE_ANC_SUPPORTED_NEW_ALERT_CATEGORY_IDX,
  BLE_ANC_NEW_ALERT_IDX,
  BLE_ANC_NEW_ALERT_CLI_CNFG_IDX,
  BLE_ANC_SUPPORTED_UNREAD_ALERT_CATEGORY_IDX,
  BLE_ANC_UNREAD_ALERT_STATUS_IDX,
  BLE_ANC_UNREAD_ALERT_STATUS_CLI_CNFG_IDX,
  BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_IDX
}
 Alert Notification Service characteristic ID. More...
 
enum  e_ble_anc_event_t {
  BLE_ANC_EVENT_SUPPORTED_NEW_ALERT_CATEGORY_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_ANC_SUPPORTED_NEW_ALERT_CATEGORY_IDX, BLE_SERVC_READ_RSP),
  BLE_ANC_EVENT_NEW_ALERT_HDL_VAL_NTF = BLE_SERVC_ATTR_EVENT(BLE_ANC_NEW_ALERT_IDX, BLE_SERVC_HDL_VAL_NTF),
  BLE_ANC_EVENT_NEW_ALERT_CLI_CNFG_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_ANC_NEW_ALERT_CLI_CNFG_IDX, BLE_SERVC_READ_RSP),
  BLE_ANC_EVENT_NEW_ALERT_CLI_CNFG_WRITE_RSP = BLE_SERVC_ATTR_EVENT(BLE_ANC_NEW_ALERT_CLI_CNFG_IDX, BLE_SERVC_WRITE_RSP),
  BLE_ANC_EVENT_SUPPORTED_UNREAD_ALERT_CATEGORY_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_ANC_SUPPORTED_UNREAD_ALERT_CATEGORY_IDX, BLE_SERVC_READ_RSP),
  BLE_ANC_EVENT_UNREAD_ALERT_STATUS_HDL_VAL_NTF = BLE_SERVC_ATTR_EVENT(BLE_ANC_UNREAD_ALERT_STATUS_IDX, BLE_SERVC_HDL_VAL_NTF),
  BLE_ANC_EVENT_UNREAD_ALERT_STATUS_CLI_CNFG_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_ANC_UNREAD_ALERT_STATUS_CLI_CNFG_IDX, BLE_SERVC_READ_RSP),
  BLE_ANC_EVENT_UNREAD_ALERT_STATUS_CLI_CNFG_WRITE_RSP = BLE_SERVC_ATTR_EVENT(BLE_ANC_UNREAD_ALERT_STATUS_CLI_CNFG_IDX, BLE_SERVC_WRITE_RSP),
  BLE_ANC_EVENT_ALERT_NOTIFICATION_CONTROL_POINT_WRITE_RSP = BLE_SERVC_ATTR_EVENT(BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_IDX, BLE_SERVC_WRITE_RSP)
}
 Alert Notification Service client event type. More...
 

Functions

ble_status_t R_BLE_ANC_ReadSupported_new_alert_category (uint16_t conn_hdl)
 Read Supported New Alert Category characteristic value from the remote GATT database. More...
 
void R_BLE_ANC_GetSupported_new_alert_categoryAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_anc_supported_new_alert_category_attr_hdl_t *p_hdl)
 Get Supported New Alert Category attribute handles. More...
 
ble_status_t R_BLE_ANC_ReadNew_alertCliCnfg (uint16_t conn_hdl)
 Read New Alert characteristic Client Characteristic Configuration descriptor value from the remote GATT database. More...
 
ble_status_t R_BLE_ANC_WriteNew_alertCliCnfg (uint16_t conn_hdl, const uint16_t *p_value)
 Write New Alert characteristic Client Characteristic Configuration descriptor value to remote GATT database. More...
 
void R_BLE_ANC_GetNew_alertAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_anc_new_alert_attr_hdl_t *p_hdl)
 Get New Alert attribute handles. More...
 
ble_status_t R_BLE_ANC_ReadSupported_unread_alert_category (uint16_t conn_hdl)
 Read Supported Unread Alert Category characteristic value from the remote GATT database. More...
 
void R_BLE_ANC_GetSupported_unread_alert_categoryAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_anc_supported_unread_alert_category_attr_hdl_t *p_hdl)
 Get Supported Unread Alert Category attribute handles. More...
 
ble_status_t R_BLE_ANC_ReadUnread_alert_statusCliCnfg (uint16_t conn_hdl)
 Read Unread Alert Status characteristic Client Characteristic Configuration descriptor value from the remote GATT database. More...
 
ble_status_t R_BLE_ANC_WriteUnread_alert_statusCliCnfg (uint16_t conn_hdl, const uint16_t *p_value)
 Write Unread Alert Status characteristic Client Characteristic Configuration descriptor value to remote GATT database. More...
 
void R_BLE_ANC_GetUnread_alert_statusAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_anc_unread_alert_status_attr_hdl_t *p_hdl)
 Get Unread Alert Status attribute handles. More...
 
ble_status_t R_BLE_ANC_WriteAlertNotificationControlPoint (uint16_t conn_hdl, const st_ble_anc_alert_notification_control_point_t *p_value)
 Write Alert Notification Control Point characteristic value to remote GATT database. More...
 
void R_BLE_ANC_GetAlertNotificationControlPointAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_anc_alert_notification_control_point_attr_hdl_t *p_hdl)
 Get Alert Notification Control Point attribute handles. More...
 
ble_status_t R_BLE_ANC_Init (ble_servc_app_cb_t cb)
 Initialize Alert Notification Service client. More...
 
void R_BLE_ANC_ServDiscCb (uint16_t conn_hdl, uint8_t serv_idx, uint16_t type, void *p_param)
 Alert Notification Service client discovery callback. More...
 
void R_BLE_ANC_GetServAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_gatt_hdl_range_t *p_hdl)
 Get Alert Notification Service client attribute handle. More...
 

Macro Definition Documentation

◆ BLE_ANC_NEW_ALERT_TEXT_LEN

#define BLE_ANC_NEW_ALERT_TEXT_LEN   (18)

New Alert Text length.

◆ BLE_ANC_COMMAND_NOT_SUPPORTED_ERROR

#define BLE_ANC_COMMAND_NOT_SUPPORTED_ERROR   (BLE_ERR_GROUP_GATT | 0xA0)

command not supported

Enumeration Type Documentation

◆ e_ble_anc_alert_notification_control_point_command_id_t

Alert Notification Control Point Command ID enumeration.

Enumerator
BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_ENABLE_NEW_INCOMING_ALERT_NOTIFICATION 

Enable New Incoming Alert Notification

BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_ENABLE_UNREAD_CATEGORY_STATUS_NOTIFICATION 

Enable Unread Category Status Notification

BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_DISABLE_NEW_INCOMING_ALERT_NOTIFICATION 

Disable New Incoming Alert Notification

BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_DISABLE_UNREAD_CATEGORY_STATUS_NOTIFICATION 

Disable Unread Category Status Notification

BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_NOTIFY_NEW_INCOMING_ALERT_IMMEDIATELY 

Notify New Incoming Alert immediately

BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_NOTIFY_UNREAD_CATEGORY_STATUS_IMMEDIATELY 

Notify Unread Category Status immediately

◆ e_ble_anc_alert_notification_control_point_category_id_t

Alert Notification Control Point Category ID enumeration.

Enumerator
BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_SIMPLE_ALERT__GENERAL_TEXT_ALERT_OR_NON_TEST_ALERT 

Simple Alert: General or non

BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_EMAIL__ALERT_WHEN_EMAIL_MESSAGES_ARRIVES 

Email: Alert when Email messages arrives

BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_NEWS_NEWS_FEEDS_SUCH_AS_RSS_ATOM 

News: News feeds such as RSS, Atom

BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_CALL_INCOMING_CALL 

Call: Incoming call

BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_MISSED_CALL_MISSED_CALL 

Missed call: Missed Call

BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_SMS_MMS__SMS_MMS_MESSAGES_ARRIVES 

SMS/MMS: SMS/MMS message arrives

BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_VOICE_MAIL__VOICE_MAIL 

Voice mail: Voice mail

BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_SCHEDULE__ALERT_OCCURED_ON_CALENDAR_PLANNER 

Schedule: Alert occurred on calendar, planner

BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_HIGH_PRIORITIDED_ALERT__ALERT_THAT_SHOULD_BE_HANDLED_AS_HIGH_PRIORITY 

High Prioritized Alert: Alert that should be handled as high priority

BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_INSTANT_MESSAGE_ALERT_FOR_INCOMING_INSTANT_MESSAGES 

Instant Message: Alert for incoming instant messages

BLE_ANC_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_ALL 

Category ID: All category(0xff)

◆ e_ble_anc_char_idx_t

Alert Notification Service characteristic ID.

◆ e_ble_anc_event_t

Alert Notification Service client event type.

Function Documentation

◆ R_BLE_ANC_ReadSupported_new_alert_category()

ble_status_t R_BLE_ANC_ReadSupported_new_alert_category ( uint16_t  conn_hdl)

Read Supported New Alert Category characteristic value from the remote GATT database.

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_ANC_GetSupported_new_alert_categoryAttrHdl()

void R_BLE_ANC_GetSupported_new_alert_categoryAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_anc_supported_new_alert_category_attr_hdl_t p_hdl 
)

Get Supported New Alert Category attribute handles.

Parameters
[in]p_addrThe pointer to Bluetooth device address for the attribute handles.
[out]p_hdlThe pointer to store supported new alert category attribute handles.
Returns
ble_status_t

◆ R_BLE_ANC_ReadNew_alertCliCnfg()

ble_status_t R_BLE_ANC_ReadNew_alertCliCnfg ( uint16_t  conn_hdl)

Read New Alert characteristic Client Characteristic Configuration descriptor value from the remote GATT database.

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_ANC_WriteNew_alertCliCnfg()

ble_status_t R_BLE_ANC_WriteNew_alertCliCnfg ( uint16_t  conn_hdl,
const uint16_t *  p_value 
)

Write New Alert characteristic Client Characteristic Configuration descriptor value to remote GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueThe pointer to New Alert characteristic Client Characteristic Configuration descriptor value to write.
Returns
ble_status_t

◆ R_BLE_ANC_GetNew_alertAttrHdl()

void R_BLE_ANC_GetNew_alertAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_anc_new_alert_attr_hdl_t p_hdl 
)

Get New Alert attribute handles.

Parameters
[in]p_addrThe pointer to Bluetooth device address for the attribute handles.
[out]p_hdlThe pointer to store the retrieved new alert attribute handles.
Returns
ble_status_t

◆ R_BLE_ANC_ReadSupported_unread_alert_category()

ble_status_t R_BLE_ANC_ReadSupported_unread_alert_category ( uint16_t  conn_hdl)

Read Supported Unread Alert Category characteristic value from the remote GATT database.

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_ANC_GetSupported_unread_alert_categoryAttrHdl()

void R_BLE_ANC_GetSupported_unread_alert_categoryAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_anc_supported_unread_alert_category_attr_hdl_t p_hdl 
)

Get Supported Unread Alert Category attribute handles.

Parameters
[in]p_addrThe pointer to Bluetooth device address for the attribute handles.
[out]p_hdlThe pointer to store the retrieved supported unread alert category attribute handles.
Returns
ble_status_t

◆ R_BLE_ANC_ReadUnread_alert_statusCliCnfg()

ble_status_t R_BLE_ANC_ReadUnread_alert_statusCliCnfg ( uint16_t  conn_hdl)

Read Unread Alert Status characteristic Client Characteristic Configuration descriptor value from the remote GATT database.

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_ANC_WriteUnread_alert_statusCliCnfg()

ble_status_t R_BLE_ANC_WriteUnread_alert_statusCliCnfg ( uint16_t  conn_hdl,
const uint16_t *  p_value 
)

Write Unread Alert Status characteristic Client Characteristic Configuration descriptor value to remote GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueThe pointer to Unread Alert Status characteristic Client Characteristic Configuration descriptor value to write.
Returns
ble_status_t

◆ R_BLE_ANC_GetUnread_alert_statusAttrHdl()

void R_BLE_ANC_GetUnread_alert_statusAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_anc_unread_alert_status_attr_hdl_t p_hdl 
)

Get Unread Alert Status attribute handles.

Parameters
[in]p_addrThe pointer to Bluetooth device address for the attribute handles.
[out]p_hdlThe pointer to store the retrieved unread alert status attribute handles.
Returns
ble_status_t

◆ R_BLE_ANC_WriteAlertNotificationControlPoint()

ble_status_t R_BLE_ANC_WriteAlertNotificationControlPoint ( uint16_t  conn_hdl,
const st_ble_anc_alert_notification_control_point_t p_value 
)

Write Alert Notification Control Point characteristic value to remote GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueThe pointer to Alert Notification Control Point characteristic value to write.
Returns
ble_status_t

◆ R_BLE_ANC_GetAlertNotificationControlPointAttrHdl()

void R_BLE_ANC_GetAlertNotificationControlPointAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_anc_alert_notification_control_point_attr_hdl_t p_hdl 
)

Get Alert Notification Control Point attribute handles.

Parameters
[in]p_addrThe pointer to Bluetooth device address for the attribute handles.
[out]p_hdlThe pointer to store the retrieved control point attribute handles.
Returns
ble_status_t

◆ R_BLE_ANC_Init()

ble_status_t R_BLE_ANC_Init ( ble_servc_app_cb_t  cb)

Initialize Alert Notification Service client.

Parameters
[in]cbClient callback.
Returns
ble_status_t

◆ R_BLE_ANC_ServDiscCb()

void R_BLE_ANC_ServDiscCb ( uint16_t  conn_hdl,
uint8_t  serv_idx,
uint16_t  type,
void *  p_param 
)

Alert Notification Service client discovery callback.

Parameters
[in]conn_hdlConnection handle
[in]serv_idxService instance index.
[in]typeService discovery event type.
[out]p_paramThe pointer to Service discovery event parameter.
Returns
ble_status_t

◆ R_BLE_ANC_GetServAttrHdl()

void R_BLE_ANC_GetServAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_gatt_hdl_range_t p_hdl 
)

Get Alert Notification Service client attribute handle.

Parameters
[in]p_addrThe pointer to Bluetooth device address for the attribute handles.
[out]p_hdlThe pointer to store the retrieved attribute handles.