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

Alert Notification Service exposes: The different types of alerts with the short text messages. The information how many count of new alert messages. The information how many count of unread alerts. More...

Detailed Description

Alert Notification Service exposes: The different types of alerts with the short text messages. The information how many count of new alert messages. The information how many count of unread alerts.

Data Structures

struct  st_ble_ans_supported_new_alert_category_t
 Supported New Alert Category value structure. More...
 
struct  st_ble_ans_new_alert_t
 New Alert value structure. More...
 
struct  st_ble_ans_supported_unread_alert_category_t
 Supported Unread Alert Category value structure. More...
 
struct  st_ble_ans_unread_alert_status_t
 Unread Alert Status value structure. More...
 
struct  st_ble_ans_alert_notification_control_point_t
 Alert Notification Control Point value structure. More...
 

Macros

#define BLE_ANS_NEW_ALERT_TEXT_LEN   (18)
 New Alert Text length. More...
 
#define BLE_ANS_COMMAND_NOT_SUPPORTED   (BLE_ERR_GROUP_GATT | 0xA0)
 Command not supported error code. More...
 
#define BLE_ANS_PRV_WRITE_REQUEST_REJECTED   (BLE_ERR_GROUP_GATT | 0xA1)
 Write Request Rejected error code. More...
 

Enumerations

enum  e_ble_ans_alert_notification_control_point_command_id_t {
  BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_ENABLE_NEW_INCOMING_ALERT_NOTIFICATION = 0,
  BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_ENABLE_UNREAD_CATEGORY_STATUS_NOTIFICATION = 1,
  BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_DISABLE_NEW_INCOMING_ALERT_NOTIFICATION = 2,
  BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_DISABLE_UNREAD_CATEGORY_STATUS_NOTIFICATION = 3,
  BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_NOTIFY_NEW_INCOMING_ALERT_IMMEDIATELY = 4,
  BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_NOTIFY_UNREAD_CATEGORY_STATUS_IMMEDIATELY = 5
}
 Alert Notification Control Point Command ID enumeration. More...
 
enum  e_ble_ans_alert_notification_control_point_category_id_t {
  BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_SIMPLE_ALERT__GENERAL_TEXT_ALERT_OR_NON_TEST_ALERT = 0,
  BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_EMAIL__ALERT_WHEN_EMAIL_MESSAGES_ARRIVES = 1,
  BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_NEWS_NEWS_FEEDS_SUCH_AS_RSS_ATOM = 2,
  BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_CALL_INCOMING_CALL = 3,
  BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_MISSED_CALL_MISSED_CALL = 4,
  BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_SMS_MMS__SMS_MMS_MESSAGES_ARRIVES = 5,
  BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_VOICE_MAIL__VOICE_MAIL = 6,
  BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_SCHEDULE__ALERT_OCCURED_ON_CALENDAR_PLANNER = 7,
  BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_HIGH_PRIORITIDED_ALERT__ALERT_THAT_SHOULD_BE_HANDLED_AS_HIGH_PRIORITY = 8,
  BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_INSTANT_MESSAGE_ALERT_FOR_INCOMING_INSTANT_MESSAGES = 9,
  BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_ALL = 255
}
 Alert Notification Control Point Category ID enumeration. More...
 
enum  e_ble_ans_char_idx_t {
  BLE_ANS_SUPPORTED_NEW_ALERT_CATEGORY_IDX,
  BLE_ANS_NEW_ALERT_IDX,
  BLE_ANS_NEW_ALERT_CLI_CNFG_IDX,
  BLE_ANS_SUPPORTED_UNREAD_ALERT_CATEGORY_IDX,
  BLE_ANS_UNREAD_ALERT_STATUS_IDX,
  BLE_ANS_UNREAD_ALERT_STATUS_CLI_CNFG_IDX,
  BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_IDX
}
 Alert Notification Service characteristic Index. More...
 
enum  e_ble_ans_event_t {
  BLE_ANS_EVENT_SUPPORTED_NEW_ALERT_CATEGORY_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_ANS_SUPPORTED_NEW_ALERT_CATEGORY_IDX, BLE_SERVS_READ_REQ),
  BLE_ANS_EVENT_NEW_ALERT_CLI_CNFG_WRITE_REQ = BLE_SERVS_ATTR_EVENT(BLE_ANS_NEW_ALERT_CLI_CNFG_IDX, BLE_SERVS_WRITE_REQ),
  BLE_ANS_EVENT_NEW_ALERT_CLI_CNFG_WRITE_COMP = BLE_SERVS_ATTR_EVENT(BLE_ANS_NEW_ALERT_CLI_CNFG_IDX, BLE_SERVS_WRITE_COMP),
  BLE_ANS_EVENT_NEW_ALERT_CLI_CNFG_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_ANS_NEW_ALERT_CLI_CNFG_IDX, BLE_SERVS_READ_REQ),
  BLE_ANS_EVENT_SUPPORTED_UNREAD_ALERT_CATEGORY_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_ANS_SUPPORTED_UNREAD_ALERT_CATEGORY_IDX, BLE_SERVS_READ_REQ),
  BLE_ANS_EVENT_UNREAD_ALERT_STATUS_CLI_CNFG_WRITE_REQ = BLE_SERVS_ATTR_EVENT(BLE_ANS_UNREAD_ALERT_STATUS_CLI_CNFG_IDX, BLE_SERVS_WRITE_REQ),
  BLE_ANS_EVENT_UNREAD_ALERT_STATUS_CLI_CNFG_WRITE_COMP = BLE_SERVS_ATTR_EVENT(BLE_ANS_UNREAD_ALERT_STATUS_CLI_CNFG_IDX, BLE_SERVS_WRITE_COMP),
  BLE_ANS_EVENT_UNREAD_ALERT_STATUS_CLI_CNFG_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_ANS_UNREAD_ALERT_STATUS_CLI_CNFG_IDX, BLE_SERVS_READ_REQ),
  BLE_ANS_EVENT_ALERT_NOTIFICATION_CONTROL_POINT_WRITE_REQ = BLE_SERVS_ATTR_EVENT(BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_IDX, BLE_SERVS_WRITE_REQ),
  BLE_ANS_EVENT_ALERT_NOTIFICATION_CONTROL_POINT_WRITE_COMP = BLE_SERVS_ATTR_EVENT(BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_IDX, BLE_SERVS_WRITE_COMP)
}
 Alert Notification Service event type. More...
 

Functions

ble_status_t R_BLE_ANS_SetSup_nw_alt_cat (const st_ble_ans_supported_new_alert_category_t *p_value)
 Set Supported New Alert Category characteristic value to the local GATT database. More...
 
ble_status_t R_BLE_ANS_GetSup_nw_alt_cat (st_ble_ans_supported_new_alert_category_t *p_value)
 Get Supported New Alert Category characteristic value from the local GATT database. More...
 
ble_status_t R_BLE_ANS_NotifyNew_alert (uint16_t conn_hdl, const st_ble_ans_new_alert_t *p_value)
 Send notificatoin of New Alert characteristic value to the remote device. More...
 
ble_status_t R_BLE_ANS_SetNew_alerttCliCnfg (uint16_t conn_hdl, const uint16_t *p_value)
 Set New Alert cli cnfg descriptor value to the local GATT database. More...
 
ble_status_t R_BLE_ANS_GetNew_alertCliCnfg (uint16_t conn_hdl, uint16_t *p_value)
 Get New Alert cli cnfg descriptor value from the local GATT database. More...
 
ble_status_t R_BLE_ANS_SetSup_un_alt_cat (const st_ble_ans_supported_unread_alert_category_t *p_value)
 Set Supported Unread Alert Category characteristic value to the local GATT database. More...
 
ble_status_t R_BLE_ANS_GetSup_un_alt_cat (st_ble_ans_supported_unread_alert_category_t *p_value)
 Get Supported Unread Alert Category characteristic value from the local GATT database. More...
 
ble_status_t R_BLE_ANS_NotifyUnread_alt_st (uint16_t conn_hdl, const st_ble_ans_unread_alert_status_t *p_value)
 Send notificatoin of Unread Alert Status characteristic value to the remote device. More...
 
ble_status_t R_BLE_ANS_SetUnd_at_stCliCnfg (uint16_t conn_hdl, const uint16_t *p_value)
 Set Unread Alert Status cli cnfg descriptor value to the local GATT database. More...
 
ble_status_t R_BLE_ANS_GetUnd_at_stCliCnfg (uint16_t conn_hdl, uint16_t *p_value)
 Get Unread Alert Status cli cnfg descriptor value from the local GATT database. More...
 
ble_status_t R_BLE_ANS_Init (ble_servs_app_cb_t cb)
 Initialize Alert Notification Service service. More...
 

Macro Definition Documentation

◆ BLE_ANS_NEW_ALERT_TEXT_LEN

#define BLE_ANS_NEW_ALERT_TEXT_LEN   (18)

New Alert Text length.

◆ BLE_ANS_COMMAND_NOT_SUPPORTED

#define BLE_ANS_COMMAND_NOT_SUPPORTED   (BLE_ERR_GROUP_GATT | 0xA0)

Command not supported error code.

◆ BLE_ANS_PRV_WRITE_REQUEST_REJECTED

#define BLE_ANS_PRV_WRITE_REQUEST_REJECTED   (BLE_ERR_GROUP_GATT | 0xA1)

Write Request Rejected error code.

Enumeration Type Documentation

◆ e_ble_ans_alert_notification_control_point_command_id_t

Alert Notification Control Point Command ID enumeration.

Enumerator
BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_ENABLE_NEW_INCOMING_ALERT_NOTIFICATION 

Enable New Incoming Alert Notification

BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_ENABLE_UNREAD_CATEGORY_STATUS_NOTIFICATION 

Enable Unread Category Status Notification

BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_DISABLE_NEW_INCOMING_ALERT_NOTIFICATION 

Disable New Incoming Alert Notification

BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_DISABLE_UNREAD_CATEGORY_STATUS_NOTIFICATION 

Disable Unread Category Status Notification

BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_NOTIFY_NEW_INCOMING_ALERT_IMMEDIATELY 

Notify New Incoming Alert immediately

BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_COMMAND_ID_NOTIFY_UNREAD_CATEGORY_STATUS_IMMEDIATELY 

Notify Unread Category Status immediately

◆ e_ble_ans_alert_notification_control_point_category_id_t

Alert Notification Control Point Category ID enumeration.

Enumerator
BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_SIMPLE_ALERT__GENERAL_TEXT_ALERT_OR_NON_TEST_ALERT 

Simple Alert: General or non

BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_EMAIL__ALERT_WHEN_EMAIL_MESSAGES_ARRIVES 

Email: Alert when Email messages arrives

BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_NEWS_NEWS_FEEDS_SUCH_AS_RSS_ATOM 

News: News feeds such as RSS, Atom

BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_CALL_INCOMING_CALL 

Call: Incoming call

BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_MISSED_CALL_MISSED_CALL 

Missed call: Missed Call

BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_SMS_MMS__SMS_MMS_MESSAGES_ARRIVES 

SMS/MMS: SMS/MMS message arrives

BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_VOICE_MAIL__VOICE_MAIL 

Voice mail: Voice mail

BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_SCHEDULE__ALERT_OCCURED_ON_CALENDAR_PLANNER 

Schedule: Alert occurred on calendar, planner

BLE_ANS_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_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_INSTANT_MESSAGE_ALERT_FOR_INCOMING_INSTANT_MESSAGES 

Instant Message: Alert for incoming instant messages

BLE_ANS_ALERT_NOTIFICATION_CONTROL_POINT_CATEGORY_ID_ALL 

Category ID: All category(0xff)

◆ e_ble_ans_char_idx_t

Alert Notification Service characteristic Index.

◆ e_ble_ans_event_t

Alert Notification Service event type.

Function Documentation

◆ R_BLE_ANS_SetSup_nw_alt_cat()

ble_status_t R_BLE_ANS_SetSup_nw_alt_cat ( const st_ble_ans_supported_new_alert_category_t p_value)

Set Supported New Alert Category characteristic value to the local GATT database.

Parameters
[in]p_valueCharacteristic value to set pointer to supported new alert category.
Returns
ble_status_t

◆ R_BLE_ANS_GetSup_nw_alt_cat()

ble_status_t R_BLE_ANS_GetSup_nw_alt_cat ( st_ble_ans_supported_new_alert_category_t p_value)

Get Supported New Alert Category characteristic value from the local GATT database.

Parameters
[out]p_valuePointer to Retrieved Supported new alert category characteristic value.
Returns
ble_status_t

◆ R_BLE_ANS_NotifyNew_alert()

ble_status_t R_BLE_ANS_NotifyNew_alert ( uint16_t  conn_hdl,
const st_ble_ans_new_alert_t p_value 
)

Send notificatoin of New Alert characteristic value to the remote device.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueCharacteristic value to send pointer to new alert category.
Returns
ble_status_t

◆ R_BLE_ANS_SetNew_alerttCliCnfg()

ble_status_t R_BLE_ANS_SetNew_alerttCliCnfg ( uint16_t  conn_hdl,
const uint16_t *  p_value 
)

Set New Alert cli cnfg descriptor value to the local GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueDescriptor value to set pointer to uint16_t.
Returns
ble_status_t

◆ R_BLE_ANS_GetNew_alertCliCnfg()

ble_status_t R_BLE_ANS_GetNew_alertCliCnfg ( uint16_t  conn_hdl,
uint16_t *  p_value 
)

Get New Alert cli cnfg descriptor value from the local GATT database.

Parameters
[in]conn_hdlConnection handle.
[out]p_valueOutput location for the acquired descriptor value.
Returns
ble_status_t

◆ R_BLE_ANS_SetSup_un_alt_cat()

ble_status_t R_BLE_ANS_SetSup_un_alt_cat ( const st_ble_ans_supported_unread_alert_category_t p_value)

Set Supported Unread Alert Category characteristic value to the local GATT database.

Parameters
[in]p_valueCharacteristic value to set pointer to supported unread alert category.
Returns
ble_status_t

◆ R_BLE_ANS_GetSup_un_alt_cat()

ble_status_t R_BLE_ANS_GetSup_un_alt_cat ( st_ble_ans_supported_unread_alert_category_t p_value)

Get Supported Unread Alert Category characteristic value from the local GATT database.

Parameters
[out]p_valuePointer to Retrieved Supported unread alert category characteristic value.
Returns
ble_status_t

◆ R_BLE_ANS_NotifyUnread_alt_st()

ble_status_t R_BLE_ANS_NotifyUnread_alt_st ( uint16_t  conn_hdl,
const st_ble_ans_unread_alert_status_t p_value 
)

Send notificatoin of Unread Alert Status characteristic value to the remote device.

Parameters
[in]conn_hdlConnection handle.
[in]p_valuepointer to unread alert Characteristic value to send .
Returns
ble_status_t

◆ R_BLE_ANS_SetUnd_at_stCliCnfg()

ble_status_t R_BLE_ANS_SetUnd_at_stCliCnfg ( uint16_t  conn_hdl,
const uint16_t *  p_value 
)

Set Unread Alert Status cli cnfg descriptor value to the local GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueDescriptor value to set pointer to uint16_t.
Returns
ble_status_t

◆ R_BLE_ANS_GetUnd_at_stCliCnfg()

ble_status_t R_BLE_ANS_GetUnd_at_stCliCnfg ( uint16_t  conn_hdl,
uint16_t *  p_value 
)

Get Unread Alert Status cli cnfg descriptor value from the local GATT database.

Parameters
[in]conn_hdlConnection handle.
[out]p_valueOutput location for the acquired descriptor value.
Returns
ble_status_t

◆ R_BLE_ANS_Init()

ble_status_t R_BLE_ANS_Init ( ble_servs_app_cb_t  cb)

Initialize Alert Notification Service service.

Parameters
[in]cbService callback.
Returns
ble_status_t