思澈科技软件开发工具包  2.20

Data Structures

struct  ble_ancs_enable_rsp_t
 The structure of BLE_ANCS_ENABLE_RSP. More...
 
struct  ble_ancs_get_app_attr_rsp_t
 The structure of BLE_ANCS_GET_APP_ATTR_RSP. More...
 
struct  ble_ancs_noti_attr_t
 The structure of BLE_ANCS_NOTIFICATION_IND. More...
 

Enumerations

enum  ble_ancs_err {
  BLE_ANCS_ERR_NO_ERR,
  BLE_ANCS_ERR_NO_CONNECTION,
  BLE_ANCS_ERR_SEARCH_REMOTE_SERVICE_FAILED,
  BLE_ANCS_ERR_REGISTER_REMOTE_DEVICE_FAILED,
  BLE_ANCS_ERR_REJECTED
}
 ANCS error type. More...
 
enum  ble_ancs_event {
  BLE_ANCS_ENABLE_RSP = BLE_ANCS_TYPE,
  BLE_ANCS_NOTIFICATION_IND,
  BLE_ANCS_GET_APP_ATTR_RSP
}
 ANCS events that notify user. More...
 
enum  ble_ancs_category_id_t {
  BLE_ANCS_CATEGORY_ID_OTHER,
  BLE_ANCS_CATEGORY_ID_INCOMING_CALL,
  BLE_ANCS_CATEGORY_ID_MISSED_CALL,
  BLE_ANCS_CATEGORY_ID_VOICE_MAIL,
  BLE_ANCS_CATEGORY_ID_SOCIAL,
  BLE_ANCS_CATEGORY_ID_SCHEDULE,
  BLE_ANCS_CATEGORY_ID_EMAIL,
  BLE_ANCS_CATEGORY_ID_NEWS,
  BLE_ANCS_CATEGORY_ID_HEALTH_AND_FITNESS,
  BLE_ANCS_CATEGORY_ID_BUSINESS_AND_FINANCE,
  BLE_ANCS_CATEGORY_ID_LOCATION,
  BLE_ANCS_CATEGORY_ID_ENTERTAINMENT
}
 Category ID of IOS notification classify. More...
 
enum  ble_ancs_category_id_mask_t {
  BLE_ANCS_CATEGORY_ID_MASK_OTHER = 1 << BLE_ANCS_CATEGORY_ID_OTHER,
  BLE_ANCS_CATEGORY_ID_MASK_INCOMING_CALL = 1 << BLE_ANCS_CATEGORY_ID_INCOMING_CALL,
  BLE_ANCS_CATEGORY_ID_MASK_MISSED_CALL = 1 << BLE_ANCS_CATEGORY_ID_MISSED_CALL,
  BLE_ANCS_CATEGORY_ID_MASK_VOICE_MAIL = 1 << BLE_ANCS_CATEGORY_ID_VOICE_MAIL,
  BLE_ANCS_CATEGORY_ID_MASK_SOCIAL = 1 << BLE_ANCS_CATEGORY_ID_SOCIAL,
  BLE_ANCS_CATEGORY_ID_MASK_SCHEDULE = 1 << BLE_ANCS_CATEGORY_ID_SCHEDULE,
  BLE_ANCS_CATEGORY_ID_MASK_EMAIL = 1 << BLE_ANCS_CATEGORY_ID_EMAIL,
  BLE_ANCS_CATEGORY_ID_MASK_NEWS = 1 << BLE_ANCS_CATEGORY_ID_NEWS,
  BLE_ANCS_CATEGORY_ID_MASK_HEALTH_AND_FITNESS = 1 << BLE_ANCS_CATEGORY_ID_HEALTH_AND_FITNESS,
  BLE_ANCS_CATEGORY_ID_MASK_BUSINESS_AND_FINANCE = 1 << BLE_ANCS_CATEGORY_ID_BUSINESS_AND_FINANCE,
  BLE_ANCS_CATEGORY_ID_MASK_LOCATION = 1 << BLE_ANCS_CATEGORY_ID_LOCATION,
  BLE_ANCS_CATEGORY_ID_MASK_ENTERTAINMENT = 1 << BLE_ANCS_CATEGORY_ID_ENTERTAINMENT,
  BLE_ANCS_CATEGORY_ID_MASK_ALL = 0xFFFF
}
 Category ID Mask of IOS notification classify. More...
 
enum  ble_ancs_event_id_t {
  BLE_ANCS_EVENT_ID_NOTIFICATION_ADDED,
  BLE_ANCS_EVENT_ID_NOTIFICATION_MODIFIED,
  BLE_ANCS_EVENT_ID_NOTIFICATION_REMOVED
}
 Event id indicats whether the notification added, modified or removed. More...
 
enum  ble_ancs_event_flag_t {
  BLE_ANCS_EVENT_FLAG_SILENT = 1 << 0,
  BLE_ANCS_EVENT_FLAG_IMPORTANT = 1 << 1,
  BLE_ANCS_EVENT_FLAG_PRE_EXISTING = 1 << 2,
  BLE_ANCS_EVENT_FLAG_POSITIVE_ACTION = 1 << 3,
  BLE_ANCS_EVENT_FLAG_NEGATIVE_ACTION = 1 << 4
}
 Event flags indicate event specificities. More...
 
enum  ble_ancs_command_id_t {
  BLE_ANCS_COMMAND_ID_GET_NOTIFICATION_ATTR,
  BLE_ANCS_COMMAND_ID_GET_APP_ATTR,
  BLE_ANCS_COMMAND_ID_PERFORM_NOTIFICATION_ACTION
}
 Command ID indicates the command. More...
 
enum  ble_ancs_notification_attr_id_t {
  BLE_ANCS_NOTIFICATION_ATTR_ID_APP_ID,
  BLE_ANCS_NOTIFICATION_ATTR_ID_TITLE,
  BLE_ANCS_NOTIFICATION_ATTR_ID_SUB_TITLE,
  BLE_ANCS_NOTIFICATION_ATTR_ID_MESSAGE,
  BLE_ANCS_NOTIFICATION_ATTR_ID_MESSAGE_SIZE,
  BLE_ANCS_NOTIFICATION_ATTR_ID_DATE,
  BLE_ANCS_NOTIFICATION_ATTR_ID_POSITIVE_ACTION_LABLE,
  BLE_ANCS_NOTIFICATION_ATTR_ID_NEGATIVE_ACTION_LABLE
}
 Notification attribute ID. More...
 
enum  ble_ancs_notification_attr_mask_id_t {
  BLE_ANCS_NOTIFICATION_ATTR_ID_MASK_APP_ID = 1 << BLE_ANCS_NOTIFICATION_ATTR_ID_APP_ID,
  BLE_ANCS_NOTIFICATION_ATTR_ID_MASK_TITLE = 1 << BLE_ANCS_NOTIFICATION_ATTR_ID_TITLE,
  BLE_ANCS_NOTIFICATION_ATTR_ID_MASK_SUB_TITLE = 1 << BLE_ANCS_NOTIFICATION_ATTR_ID_SUB_TITLE,
  BLE_ANCS_NOTIFICATION_ATTR_ID_MASK_MESSAGE = 1 << BLE_ANCS_NOTIFICATION_ATTR_ID_MESSAGE,
  BLE_ANCS_NOTIFICATION_ATTR_ID_MASK_MESSAGE_SIZE = 1 << BLE_ANCS_NOTIFICATION_ATTR_ID_MESSAGE_SIZE,
  BLE_ANCS_NOTIFICATION_ATTR_ID_MASK_DATE = 1 << BLE_ANCS_NOTIFICATION_ATTR_ID_DATE,
  BLE_ANCS_NOTIFICATION_ATTR_ID_MASK_POSITIVE_ACTION_LABLE = 1 << BLE_ANCS_NOTIFICATION_ATTR_ID_POSITIVE_ACTION_LABLE,
  BLE_ANCS_NOTIFICATION_ATTR_ID_MASK_NEGATIVE_ACTION_LABLE = 1 << BLE_ANCS_NOTIFICATION_ATTR_ID_NEGATIVE_ACTION_LABLE,
  BLE_ANCS_NOTIFICATION_ATTR_ID_MASK_ALL = 0xFFFF
}
 Mask of Notification attribute ID. More...
 
enum  ble_ancs_action_id_val_t {
  BLE_ACTION_ID_POSITIVE,
  BLE_ACTION_ID_NEGATIVE
}
 Action ID of perform action. More...
 
enum  ble_ancs_app_attr_id_val_t { BLE_ANCS_APP_ATTR_ID_DISPLAY_NAME }
 APP attribute ID. More...
 

Functions

uint8_t ble_ancs_enable (uint8_t conn_idx)
 Enable ble ancs profile service, it will search ANCS service from peer device. It should be called after connection establishment. More...
 
void ble_ancs_category_mask_set (uint16_t mask)
 Set ble ancs category mask to filter dedicated category. More...
 
void ble_ancs_attr_enable (uint8_t attr_index, uint8_t enable, uint16_t len)
 Configure notification attribte id and according length. More...
 
void ble_ancs_app_enable (uint8_t app_index, uint8_t enable, uint16_t len)
 Configure app attribute id and according length. More...
 
void ble_ancs_perform_notification_action (uint32_t noti_uid, ble_ancs_action_id_val_t action_id)
 Perform notification action with speicifed notification UID. More...
 
int32_t ble_ancs_get_app_attr (uint8_t *app_id, uint8_t app_id_len)
 Acquire app attribute via app ID. More...
 
uint8_t ble_ancs_cccd_enable (uint8_t is_enable)
 Set CCCD of ancs. More...
 

Variables

typedef __PACKED_STRUCT
 The structure of attribute value. More...
 
uint16_t len
 
uint8_t data []
 
 ble_ancs_attr_value_t
 

Detailed Description

Enumeration Type Documentation

◆ ble_ancs_action_id_val_t

Action ID of perform action.

Enumerator
BLE_ACTION_ID_POSITIVE 

Positive action.

BLE_ACTION_ID_NEGATIVE 

Negative action.

◆ ble_ancs_app_attr_id_val_t

APP attribute ID.

Enumerator
BLE_ANCS_APP_ATTR_ID_DISPLAY_NAME 

Display name.

◆ ble_ancs_category_id_mask_t

Category ID Mask of IOS notification classify.

Enumerator
BLE_ANCS_CATEGORY_ID_MASK_OTHER 

Others mask.

BLE_ANCS_CATEGORY_ID_MASK_INCOMING_CALL 

Incoming call mask.

BLE_ANCS_CATEGORY_ID_MASK_MISSED_CALL 

Missed call mask.

BLE_ANCS_CATEGORY_ID_MASK_VOICE_MAIL 

Voice call mask.

BLE_ANCS_CATEGORY_ID_MASK_SOCIAL 

Social software mask.

BLE_ANCS_CATEGORY_ID_MASK_SCHEDULE 

Schedule mask.

BLE_ANCS_CATEGORY_ID_MASK_EMAIL 

Email mask.

BLE_ANCS_CATEGORY_ID_MASK_NEWS 

News mask.

BLE_ANCS_CATEGORY_ID_MASK_HEALTH_AND_FITNESS 

Health and fitness mask.

BLE_ANCS_CATEGORY_ID_MASK_BUSINESS_AND_FINANCE 

Business and finance mask.

BLE_ANCS_CATEGORY_ID_MASK_LOCATION 

Location mask.

BLE_ANCS_CATEGORY_ID_MASK_ENTERTAINMENT 

Entertainment mask.

BLE_ANCS_CATEGORY_ID_MASK_ALL 

Mask all categroy.

◆ ble_ancs_category_id_t

Category ID of IOS notification classify.

Enumerator
BLE_ANCS_CATEGORY_ID_OTHER 

Others.

BLE_ANCS_CATEGORY_ID_INCOMING_CALL 

Incoming call.

BLE_ANCS_CATEGORY_ID_MISSED_CALL 

Missed call.

BLE_ANCS_CATEGORY_ID_VOICE_MAIL 

Voice call.

BLE_ANCS_CATEGORY_ID_SOCIAL 

Social software.

BLE_ANCS_CATEGORY_ID_SCHEDULE 

Schedule.

BLE_ANCS_CATEGORY_ID_EMAIL 

Email.

BLE_ANCS_CATEGORY_ID_NEWS 

News.

BLE_ANCS_CATEGORY_ID_HEALTH_AND_FITNESS 

Health and fitness.

BLE_ANCS_CATEGORY_ID_BUSINESS_AND_FINANCE 

Business and finance.

BLE_ANCS_CATEGORY_ID_LOCATION 

Location.

BLE_ANCS_CATEGORY_ID_ENTERTAINMENT 

Entertainment.

◆ ble_ancs_command_id_t

Command ID indicates the command.

Enumerator
BLE_ANCS_COMMAND_ID_GET_NOTIFICATION_ATTR 

Get notifcation attribute.

BLE_ANCS_COMMAND_ID_GET_APP_ATTR 

Get app attribute.

BLE_ANCS_COMMAND_ID_PERFORM_NOTIFICATION_ACTION 

Perform notification action.

◆ ble_ancs_err

ANCS error type.

Enumerator
BLE_ANCS_ERR_NO_ERR 

No error.

BLE_ANCS_ERR_NO_CONNECTION 

No connection yet.

BLE_ANCS_ERR_SEARCH_REMOTE_SERVICE_FAILED 

Remote device doesn't support ANCS NP.

BLE_ANCS_ERR_REGISTER_REMOTE_DEVICE_FAILED 

Register remote deivce failed.

BLE_ANCS_ERR_REJECTED 

Current action is rejected due to, etc, the action is on-going.

◆ ble_ancs_event

ANCS events that notify user.

Enumerator
BLE_ANCS_ENABLE_RSP 

Enable result response.

BLE_ANCS_NOTIFICATION_IND 

Notification indication.

BLE_ANCS_GET_APP_ATTR_RSP 

Get APP attribute response.

◆ ble_ancs_event_flag_t

Event flags indicate event specificities.

Enumerator
BLE_ANCS_EVENT_FLAG_SILENT 

Slient.

BLE_ANCS_EVENT_FLAG_IMPORTANT 

Important.

BLE_ANCS_EVENT_FLAG_PRE_EXISTING 

Pre-existing.

BLE_ANCS_EVENT_FLAG_POSITIVE_ACTION 

Positive action.

BLE_ANCS_EVENT_FLAG_NEGATIVE_ACTION 

Negative action.

◆ ble_ancs_event_id_t

Event id indicats whether the notification added, modified or removed.

Enumerator
BLE_ANCS_EVENT_ID_NOTIFICATION_ADDED 

Notification is added.

BLE_ANCS_EVENT_ID_NOTIFICATION_MODIFIED 

Notification is modified.

BLE_ANCS_EVENT_ID_NOTIFICATION_REMOVED 

Notification is removed.

◆ ble_ancs_notification_attr_id_t

Notification attribute ID.

Enumerator
BLE_ANCS_NOTIFICATION_ATTR_ID_APP_ID 

APP ID.

BLE_ANCS_NOTIFICATION_ATTR_ID_TITLE 

Notification title.

BLE_ANCS_NOTIFICATION_ATTR_ID_SUB_TITLE 

Notification sub-title.

BLE_ANCS_NOTIFICATION_ATTR_ID_MESSAGE 

Message.

BLE_ANCS_NOTIFICATION_ATTR_ID_MESSAGE_SIZE 

Message size.

BLE_ANCS_NOTIFICATION_ATTR_ID_DATE 

Date.

BLE_ANCS_NOTIFICATION_ATTR_ID_POSITIVE_ACTION_LABLE 

Positive action label.

BLE_ANCS_NOTIFICATION_ATTR_ID_NEGATIVE_ACTION_LABLE 

Negative action label.

◆ ble_ancs_notification_attr_mask_id_t

Mask of Notification attribute ID.

Enumerator
BLE_ANCS_NOTIFICATION_ATTR_ID_MASK_APP_ID 

APP ID mask.

BLE_ANCS_NOTIFICATION_ATTR_ID_MASK_TITLE 

Notification title mask.

BLE_ANCS_NOTIFICATION_ATTR_ID_MASK_SUB_TITLE 

Notification sub-title mask.

BLE_ANCS_NOTIFICATION_ATTR_ID_MASK_MESSAGE 

Message mask.

BLE_ANCS_NOTIFICATION_ATTR_ID_MASK_MESSAGE_SIZE 

Message size mask.

BLE_ANCS_NOTIFICATION_ATTR_ID_MASK_DATE 

Date mask.

BLE_ANCS_NOTIFICATION_ATTR_ID_MASK_POSITIVE_ACTION_LABLE 

Positive action label mask.

BLE_ANCS_NOTIFICATION_ATTR_ID_MASK_NEGATIVE_ACTION_LABLE 

Negative action label mask.

BLE_ANCS_NOTIFICATION_ATTR_ID_MASK_ALL 

Mask all.

Function Documentation

◆ ble_ancs_app_enable()

void ble_ancs_app_enable ( uint8_t  app_index,
uint8_t  enable,
uint16_t  len 
)

Configure app attribute id and according length.

Parameters
[in]app_indexapp attribute index(
See also
enum ble_ancs_app_attr_id_val_t).
Parameters
[in]enableenable or disable attribute index.
[in]lenthe maximum length of associated attribute index.

◆ ble_ancs_attr_enable()

void ble_ancs_attr_enable ( uint8_t  attr_index,
uint8_t  enable,
uint16_t  len 
)

Configure notification attribte id and according length.

Parameters
[in]attr_indexnotification attribute index(
See also
enum ble_ancs_notification_attr_id_t).
Parameters
[in]enableenable or disable attribute index.
[in]lenthe maximum length of associated attribute index.

◆ ble_ancs_category_mask_set()

void ble_ancs_category_mask_set ( uint16_t  mask)

Set ble ancs category mask to filter dedicated category.

Parameters
[in]maskcategroy mask(
See also
enum ble_ancs_category_id_mask_t).

◆ ble_ancs_cccd_enable()

uint8_t ble_ancs_cccd_enable ( uint8_t  is_enable)

Set CCCD of ancs.

Parameters
[in]is_enableis enabled cccd.

◆ ble_ancs_enable()

uint8_t ble_ancs_enable ( uint8_t  conn_idx)

Enable ble ancs profile service, it will search ANCS service from peer device. It should be called after connection establishment.

Parameters
[in]conn_idxconnection index.
Return values
result.0 is successful..

◆ ble_ancs_get_app_attr()

int32_t ble_ancs_get_app_attr ( uint8_t *  app_id,
uint8_t  app_id_len 
)

Acquire app attribute via app ID.

Parameters
[in]app_idapp ID.
[in]app_id_lenapp ID length.

◆ ble_ancs_perform_notification_action()

void ble_ancs_perform_notification_action ( uint32_t  noti_uid,
ble_ancs_action_id_val_t  action_id 
)

Perform notification action with speicifed notification UID.

Parameters
[in]noti_uidnotification UID.
[in]action_idaction id(
See also
enum ble_ancs_action_id_val_t).

Variable Documentation

◆ __PACKED_STRUCT

typedef __PACKED_STRUCT
Initial value:
{
uint8_t attr_id

The structure of attribute value.

Attribute id.

◆ data

uint8_t data[]

Attribute content.

◆ len

uint16_t len

Attribute length.