nRF51 SDK - S310 SoftDevice
|
Apple Notification module - Disclaimer: This module (Apple Notification Center Service) can and will be changed at any time by either Apple or Nordic Semiconductor ASA. More...
Data Structures | |
struct | ble_ancs_c_evt_ios_notification_t |
struct | ble_ancs_c_evt_notif_attribute_t |
struct | ble_ancs_attr_list_t |
struct | ble_ancs_c_evt_t |
Apple Notification Event structure. More... | |
struct | ble_ancs_c_s |
Apple Notification structure. This contains various status information for the client. More... | |
struct | ble_ancs_c_init_t |
Apple Notification init structure. This contains all options and data needed for initialization of the client. More... | |
Macros | |
#define | ANCS_NB_OF_CHARACTERISTICS 5 |
#define | ANCS_NB_OF_SERVICES 1 |
#define | INVALID_SERVICE_HANDLE_BASE 0xF0 |
#define | INVALID_SERVICE_HANDLE (INVALID_SERVICE_HANDLE_BASE + 0x0F) |
#define | INVALID_SERVICE_HANDLE_DISC (INVALID_SERVICE_HANDLE_BASE + 0x0E) |
#define | BLE_ANCS_INVALID_HANDLE 0xFF |
#define | ANCS_ATTRIBUTE_DATA_MAX 32 /*<< Maximium notification attribute data length. */ |
#define | BLE_UUID_APPLE_NOTIFICATION_CENTER_SERVICE 0xf431 /*<< ANCS service UUID. */ |
#define | BLE_UUID_ANCS_CONTROL_POINT_CHAR 0xd8f3 /*<< Control point UUID. */ |
#define | BLE_UUID_ANCS_NOTIFICATION_SOURCE_CHAR 0x120d /*<< Notification source UUID. */ |
#define | BLE_UUID_ANCS_DATA_SOURCE_CHAR 0xc6e9 /*<< Data source UUID. */ |
#define | BLE_ANCS_EVENT_FLAG_SILENT (1 << 0) |
Event flags for iOS notifications. | |
#define | BLE_ANCS_EVENT_FLAG_IMPORTANT (1 << 1) |
Typedefs | |
typedef struct ble_ancs_c_s | ble_ancs_c_t |
Apple Notification structure. This contains various status information for the client. | |
typedef void(* | ble_ancs_c_evt_handler_t )(ble_ancs_c_evt_t *p_evt) |
Apple Notification event handler type. | |
Enumerations | |
enum | ble_ancs_c_evt_type_t { BLE_ANCS_C_EVT_DISCOVER_COMPLETE, BLE_ANCS_C_EVT_DISCOVER_FAILED, BLE_ANCS_C_EVT_IOS_NOTIFICATION, BLE_ANCS_C_EVT_NOTIF_ATTRIBUTE } |
Event types that are passed from client to application on an event. More... | |
enum | ble_ancs_category_id_values_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 IDs for iOS notifications. | |
enum | ble_ancs_event_id_values_t { BLE_ANCS_EVENT_ID_NOTIFICATION_ADDED, BLE_ANCS_EVENT_ID_NOTIFICATION_MODIFIED, BLE_ANCS_EVENT_ID_NOTIFICATION_REMOVED } |
Event IDs for iOS notifications. | |
enum | ble_ancs_command_id_values_t { BLE_ANCS_COMMAND_ID_GET_NOTIFICATION_ATTRIBUTES, BLE_ANCS_COMMAND_ID_GET_APP_ATTRIBUTES } |
Control point command IDs. | |
enum | ble_ancs_notification_attribute_id_values_t { BLE_ANCS_NOTIFICATION_ATTRIBUTE_ID_APP_IDENTIFIER, BLE_ANCS_NOTIFICATION_ATTRIBUTE_ID_TITLE, BLE_ANCS_NOTIFICATION_ATTRIBUTE_ID_SUBTITLE, BLE_ANCS_NOTIFICATION_ATTRIBUTE_ID_MESSAGE, BLE_ANCS_NOTIFICATION_ATTRIBUTE_ID_MESSAGE_SIZE, BLE_ANCS_NOTIFICATION_ATTRIBUTE_ID_DATE } |
Notification attribute IDs. | |
Functions | |
void | ble_ancs_c_on_ble_evt (ble_ancs_c_t *p_ancs, const ble_evt_t *p_ble_evt) |
Function for handling the Application's BLE Stack events. More... | |
void | ble_ancs_c_on_device_manager_evt (ble_ancs_c_t *p_ancs, dm_handle_t const *p_handle, dm_event_t const *p_dm_evt) |
Function for handling the ANCS Client - Device Manager event. More... | |
uint32_t | ble_ancs_c_init (ble_ancs_c_t *p_ancs, const ble_ancs_c_init_t *p_ancs_init) |
Function for initializing the ANCS Client. More... | |
uint32_t | ble_ancs_c_enable_notif_notification_source (const ble_ancs_c_t *p_ancs) |
Function for writing the to CCCD to enable notifications from the Apple Notification Service. More... | |
uint32_t | ble_ancs_c_enable_notif_data_source (const ble_ancs_c_t *p_ancs) |
Function for writing to the CCCD to enable data souce notifications from the Apple Notification Service. More... | |
uint32_t | ble_ancs_c_disable_notif_notification_source (const ble_ancs_c_t *p_ancs) |
Function for writing to the CCCD to notifications from the Apple Notification Service. More... | |
uint32_t | ble_ancs_c_disable_notif_data_source (const ble_ancs_c_t *p_ancs) |
Function for writing to the CCCD to disable data source notifications from the Apple Notification Service. More... | |
uint32_t | ble_ancs_get_notification_attributes (const ble_ancs_c_t *p_ancs, uint8_t *p_uid, uint8_t num_attr, ble_ancs_attr_list_t *p_attr) |
Function to send a Get Notification Attributes command to the ANCS control point. More... | |
uint32_t | ble_ans_c_service_load (const ble_ancs_c_t *p_ancs) |
Function for loading previous discovered service and characteristic handles for bonded centrals from flash into RAM. More... | |
uint32_t | ble_ans_c_service_store (void) |
Function for storing discovered service and characteristic handles for bonded centrals into flash memory. More... | |
uint32_t | ble_ans_c_service_delete (void) |
Function for deleting the Apple Notification Center Client database from flash. More... | |
Variables | |
const ble_uuid128_t | ble_ancs_base_uuid128 |
Apple Notification Center Service UUIDs. More... | |
const ble_uuid128_t | ble_ancs_cp_base_uuid128 |
const ble_uuid128_t | ble_ancs_ns_base_uuid128 |
const ble_uuid128_t | ble_ancs_ds_base_uuid128 |
Apple Notification module - Disclaimer: This module (Apple Notification Center Service) can and will be changed at any time by either Apple or Nordic Semiconductor ASA.
This module implements the Apple Notification Center Service (ANCS) Client.
#define ANCS_NB_OF_CHARACTERISTICS 5 |
Number of characteristics as defined by Apple Notification Service specification.
#define ANCS_NB_OF_SERVICES 1 |
Number of services supported in one master.
#define BLE_ANCS_INVALID_HANDLE 0xFF |
Indication that the current service handle is invalid.
#define INVALID_SERVICE_HANDLE (INVALID_SERVICE_HANDLE_BASE + 0x0F) |
Indication that the current service handle is invalid.
#define INVALID_SERVICE_HANDLE_BASE 0xF0 |
Base for indicating invalid service handle.
#define INVALID_SERVICE_HANDLE_DISC (INVALID_SERVICE_HANDLE_BASE + 0x0E) |
Indication that the current service handle is invalid but the service has been discovered.
Event types that are passed from client to application on an event.
uint32_t ble_ancs_c_disable_notif_data_source | ( | const ble_ancs_c_t * | p_ancs | ) |
Function for writing to the CCCD to disable data source notifications from the Apple Notification Service.
[in] | p_ancs | Apple Notification structure. This structure will have to be supplied by the application. It identifies the particular client instance to use. |
uint32_t ble_ancs_c_disable_notif_notification_source | ( | const ble_ancs_c_t * | p_ancs | ) |
Function for writing to the CCCD to notifications from the Apple Notification Service.
[in] | p_ancs | Apple Notification structure. This structure will have to be supplied by the application. It identifies the particular client instance to use. |
uint32_t ble_ancs_c_enable_notif_data_source | ( | const ble_ancs_c_t * | p_ancs | ) |
Function for writing to the CCCD to enable data souce notifications from the Apple Notification Service.
[in] | p_ancs | Apple Notification structure. This structure will have to be supplied by the application. It identifies the particular client instance to use. |
uint32_t ble_ancs_c_enable_notif_notification_source | ( | const ble_ancs_c_t * | p_ancs | ) |
Function for writing the to CCCD to enable notifications from the Apple Notification Service.
[in] | p_ancs | Apple Notification structure. This structure will have to be supplied by the application. It identifies the particular client instance to use. |
uint32_t ble_ancs_c_init | ( | ble_ancs_c_t * | p_ancs, |
const ble_ancs_c_init_t * | p_ancs_init | ||
) |
Function for initializing the ANCS Client.
[out] | p_ancs | ANCS Client structure. This structure will have to be supplied by the application. It will be initialized by this function, and will later be used to identify this particular client instance. |
[in] | p_ancs_init | Information needed to initialize the client. |
void ble_ancs_c_on_ble_evt | ( | ble_ancs_c_t * | p_ancs, |
const ble_evt_t * | p_ble_evt | ||
) |
Function for handling the Application's BLE Stack events.
Handles all events from the BLE stack of interest to the ANCS Client.
[in] | p_ancs | ANCS Client structure. |
[in] | p_ble_evt | Event received from the BLE stack. |
void ble_ancs_c_on_device_manager_evt | ( | ble_ancs_c_t * | p_ancs, |
dm_handle_t const * | p_handle, | ||
dm_event_t const * | p_dm_evt | ||
) |
Function for handling the ANCS Client - Device Manager event.
Handles all events from the Device Manager of interest to the ANCS Client. The ANCS Client will use the events of re-connection to existing master and creation of new bonds for handling of service discovery and writing of the Apple Notification Control Point for re-send of New Apple and Unread Apple notifications.
[in] | p_ancs | ANCS Client structure. |
[in] | p_handle | Pointer to ANCS device handle. |
[in] | p_dm_evt | Event received from the Bond Manager. |
uint32_t ble_ancs_get_notification_attributes | ( | const ble_ancs_c_t * | p_ancs, |
uint8_t * | p_uid, | ||
uint8_t | num_attr, | ||
ble_ancs_attr_list_t * | p_attr | ||
) |
Function to send a Get Notification Attributes command to the ANCS control point.
[in] | p_ancs | Apple Notification structure. This structure will have to be supplied by the application. It identifies the particular client instance to use. |
[in] | p_uid | UID of the notification. |
[in] | num_attr | Number of attributes. |
[in] | p_attr | Attribute list. |
uint32_t ble_ans_c_service_delete | ( | void | ) |
Function for deleting the Apple Notification Center Client database from flash.
After calling this function you should call ble_ans_c_init(...) to re-initialize the RAM database.
uint32_t ble_ans_c_service_load | ( | const ble_ancs_c_t * | p_ancs | ) |
Function for loading previous discovered service and characteristic handles for bonded centrals from flash into RAM.
Read the database of all discovered service and characteristic handles from flash. If the flash does not contain any valid data, the array of discovered service handles in RAM will be empty.
[in] | p_ancs | Apple Notification Center Service structure. This structure will have to be supplied by the application. It identifies the particular client instance to use. |
uint32_t ble_ans_c_service_store | ( | void | ) |
Function for storing discovered service and characteristic handles for bonded centrals into flash memory.
This function will erase the flash page (if the data to store are diferent than the one already stored) and then write into flash. Those operations could prevent the radio to run.
const ble_uuid128_t ble_ancs_base_uuid128 |
Apple Notification Center Service UUIDs.
Service UUID.
const ble_uuid128_t ble_ancs_cp_base_uuid128 |
Control point UUID.
const ble_uuid128_t ble_ancs_ds_base_uuid128 |
Data source UUID.
const ble_uuid128_t ble_ancs_ns_base_uuid128 |
Notification source UUID.