nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
ancs_client.h File Reference
#include <zephyr/bluetooth/gatt.h>
#include <zephyr/bluetooth/conn.h>
#include <bluetooth/gatt_dm.h>

Go to the source code of this file.

Data Structures

struct  bt_ancs_notif_flags
 Flags for iOS notifications. More...
 
struct  bt_ancs_evt_notif
 iOS notification structure. More...
 
struct  bt_ancs_attr
 iOS attribute structure. This type is used for both notification attributes and app attributes. More...
 
struct  bt_ancs_attr_list
 iOS notification attribute content requested by the application. More...
 
struct  bt_ancs_attr_response
 Attribute response structure. More...
 
struct  bt_ancs_parse_sm
 
struct  bt_ancs_client
 ANCS client instance, which contains various status information. More...
 

Macros

#define BT_UUID_ANCS_VAL    BT_UUID_128_ENCODE(0x7905f431, 0xb5ce, 0x4e99, 0xa40f, 0x4b1e122d00d0)
 Apple Notification Center Service UUID.
 
#define BT_UUID_ANCS_NOTIFICATION_SOURCE_VAL    BT_UUID_128_ENCODE(0x9fbf120d, 0x6301, 0x42d9, 0x8c58, 0x25e699a21dbd)
 Notification Source Characteristic UUID.
 
#define BT_UUID_ANCS_CONTROL_POINT_VAL    BT_UUID_128_ENCODE(0x69d1d8f3, 0x45e1, 0x49a8, 0x9821, 0x9bbdfdaad9d9)
 Control Point Characteristic UUID.
 
#define BT_UUID_ANCS_DATA_SOURCE_VAL    BT_UUID_128_ENCODE(0x22eac6e9, 0x24d6, 0x4bb5, 0xbe44, 0xb36ace7c7bfb)
 Data Source Characteristic UUID.
 
#define BT_UUID_ANCS   BT_UUID_DECLARE_128(BT_UUID_ANCS_VAL)
 
#define BT_UUID_ANCS_NOTIFICATION_SOURCE    BT_UUID_DECLARE_128(BT_UUID_ANCS_NOTIFICATION_SOURCE_VAL)
 
#define BT_UUID_ANCS_CONTROL_POINT    BT_UUID_DECLARE_128(BT_UUID_ANCS_CONTROL_POINT_VAL)
 
#define BT_UUID_ANCS_DATA_SOURCE   BT_UUID_DECLARE_128(BT_UUID_ANCS_DATA_SOURCE_VAL)
 
#define BT_ANCS_ATTR_DATA_MAX   32
 
#define BT_ANCS_CATEGORY_ID_COUNT   12
 
#define BT_ANCS_NOTIF_ATTR_COUNT   8
 
#define BT_ANCS_APP_ATTR_COUNT   1
 
#define BT_ANCS_EVT_ID_COUNT   3
 
#define BT_ANCS_NOTIF_DATA_LENGTH   8
 Length of the iOS notification data.
 
#define BT_ANCS_EVENT_FLAG_SILENT   0
 
#define BT_ANCS_EVENT_FLAG_IMPORTANT   1
 
#define BT_ANCS_EVENT_FLAG_PREEXISTING   2
 
#define BT_ANCS_EVENT_FLAG_POSITIVE_ACTION   3
 
#define BT_ANCS_EVENT_FLAG_NEGATIVE_ACTION   4
 
#define BT_ATT_ERR_ANCS_NP_UNKNOWN_COMMAND   0xA0
 
#define BT_ATT_ERR_ANCS_NP_INVALID_COMMAND   0xA1
 
#define BT_ATT_ERR_ANCS_NP_INVALID_PARAMETER   0xA2
 
#define BT_ATT_ERR_ANCS_NP_ACTION_FAILED   0xA3
 

Typedefs

typedef void(* bt_ancs_ns_notif_cb) (struct bt_ancs_client *ancs_c, int err, const struct bt_ancs_evt_notif *notif)
 Notification Source notification callback function.
 
typedef void(* bt_ancs_ds_notif_cb) (struct bt_ancs_client *ancs_c, const struct bt_ancs_attr_response *response)
 Data Source notification callback function.
 
typedef void(* bt_ancs_write_cb) (struct bt_ancs_client *ancs_c, uint8_t err)
 Write response callback function.
 

Enumerations

enum  bt_ancs_category_id_val {
  BT_ANCS_CATEGORY_ID_OTHER , BT_ANCS_CATEGORY_ID_INCOMING_CALL , BT_ANCS_CATEGORY_ID_MISSED_CALL , BT_ANCS_CATEGORY_ID_VOICE_MAIL ,
  BT_ANCS_CATEGORY_ID_SOCIAL , BT_ANCS_CATEGORY_ID_SCHEDULE , BT_ANCS_CATEGORY_ID_EMAIL , BT_ANCS_CATEGORY_ID_NEWS ,
  BT_ANCS_CATEGORY_ID_HEALTH_AND_FITNESS , BT_ANCS_CATEGORY_ID_BUSINESS_AND_FINANCE , BT_ANCS_CATEGORY_ID_LOCATION , BT_ANCS_CATEGORY_ID_ENTERTAINMENT
}
 Category IDs for iOS notifications. More...
 
enum  bt_ancs_evt_id_values { BT_ANCS_EVENT_ID_NOTIFICATION_ADDED , BT_ANCS_EVENT_ID_NOTIFICATION_MODIFIED , BT_ANCS_EVENT_ID_NOTIFICATION_REMOVED }
 Event IDs for iOS notifications. More...
 
enum  bt_ancs_cmd_id_val { BT_ANCS_COMMAND_ID_GET_NOTIF_ATTRIBUTES , BT_ANCS_COMMAND_ID_GET_APP_ATTRIBUTES , BT_ANCS_COMMAND_ID_PERFORM_NOTIF_ACTION }
 Control point command IDs that the Notification Consumer can send to the Notification Provider. More...
 
enum  bt_ancs_action_id_values { BT_ANCS_ACTION_ID_POSITIVE = 0 , BT_ANCS_ACTION_ID_NEGATIVE }
 IDs for actions that can be performed for iOS notifications. More...
 
enum  bt_ancs_app_attr_id_val { BT_ANCS_APP_ATTR_ID_DISPLAY_NAME = 0 }
 App attribute ID values. More...
 
enum  bt_ancs_notif_attr_id_val {
  BT_ANCS_NOTIF_ATTR_ID_APP_IDENTIFIER = 0 , BT_ANCS_NOTIF_ATTR_ID_TITLE , BT_ANCS_NOTIF_ATTR_ID_SUBTITLE , BT_ANCS_NOTIF_ATTR_ID_MESSAGE ,
  BT_ANCS_NOTIF_ATTR_ID_MESSAGE_SIZE , BT_ANCS_NOTIF_ATTR_ID_DATE , BT_ANCS_NOTIF_ATTR_ID_POSITIVE_ACTION_LABEL , BT_ANCS_NOTIF_ATTR_ID_NEGATIVE_ACTION_LABEL
}
 IDs for iOS notification attributes. More...
 
enum  bt_ancs_parse_state {
  BT_ANCS_PARSE_STATE_COMMAND_ID , BT_ANCS_PARSE_STATE_NOTIF_UID , BT_ANCS_PARSE_STATE_APP_ID , BT_ANCS_PARSE_STATE_ATTR_ID ,
  BT_ANCS_PARSE_STATE_ATTR_LEN1 , BT_ANCS_PARSE_STATE_ATTR_LEN2 , BT_ANCS_PARSE_STATE_ATTR_DATA , BT_ANCS_PARSE_STATE_ATTR_SKIP ,
  BT_ANCS_PARSE_STATE_DONE
}
 Parsing states for received iOS notification and app attributes. More...
 

Functions

int bt_ancs_client_init (struct bt_ancs_client *ancs_c)
 Function for initializing the ANCS client.
 
int bt_ancs_subscribe_notification_source (struct bt_ancs_client *ancs_c, bt_ancs_ns_notif_cb func)
 Function for writing to the CCCD to enable notifications from the Apple Notification Service.
 
int bt_ancs_subscribe_data_source (struct bt_ancs_client *ancs_c, bt_ancs_ds_notif_cb func)
 Function for writing to the CCCD to enable data source notifications from the ANCS.
 
int bt_ancs_unsubscribe_notification_source (struct bt_ancs_client *ancs_c)
 Function for writing to the CCCD to disable notifications from the ANCS.
 
int bt_ancs_unsubscribe_data_source (struct bt_ancs_client *ancs_c)
 Function for writing to the CCCD to disable data source notifications from the ANCS.
 
int bt_ancs_register_attr (struct bt_ancs_client *ancs_c, const enum bt_ancs_notif_attr_id_val id, uint8_t *data, const uint16_t len)
 Function for registering attributes that will be requested when bt_ancs_request_attrs is called.
 
int bt_ancs_register_app_attr (struct bt_ancs_client *ancs_c, const enum bt_ancs_app_attr_id_val id, uint8_t *data, const uint16_t len)
 Function for registering attributes that will be requested when bt_ancs_request_app_attr is called.
 
int bt_ancs_request_attrs (struct bt_ancs_client *ancs_c, const struct bt_ancs_evt_notif *notif, bt_ancs_write_cb func)
 Function for requesting attributes for a notification.
 
int bt_ancs_request_app_attr (struct bt_ancs_client *ancs_c, const uint8_t *app_id, uint32_t len, bt_ancs_write_cb func)
 Function for requesting attributes for a given app.
 
int bt_ancs_notification_action (struct bt_ancs_client *ancs_c, uint32_t uuid, enum bt_ancs_action_id_values action_id, bt_ancs_write_cb func)
 Function for performing a notification action.
 
int bt_ancs_handles_assign (struct bt_gatt_dm *dm, struct bt_ancs_client *ancs_c)
 Function for assigning handles to ANCS client instance.