NimBLE-Arduino 2.1.3
Loading...
Searching...
No Matches
ble_svc_ans.h
1
20#ifndef H_BLE_SVC_ANS_
21#define H_BLE_SVC_ANS_
22
23struct ble_hs_cfg;
24
25/* 16 Bit Alert Notification Service UUID */
26#define BLE_SVC_ANS_UUID16 0x1811
27
28/* 16 Bit Alert Notification Service Characteristic UUIDs */
29#define BLE_SVC_ANS_CHR_UUID16_SUP_NEW_ALERT_CAT 0x2a47
30#define BLE_SVC_ANS_CHR_UUID16_NEW_ALERT 0x2a46
31#define BLE_SVC_ANS_CHR_UUID16_SUP_UNR_ALERT_CAT 0x2a48
32#define BLE_SVC_ANS_CHR_UUID16_UNR_ALERT_STAT 0x2a45
33#define BLE_SVC_ANS_CHR_UUID16_ALERT_NOT_CTRL_PT 0x2a44
34
35/* Alert Notification Service Category ID Bit Masks
36 *
37 * TODO: Add remaining 2 optional categories */
38#define BLE_SVC_ANS_CAT_BM_NONE 0x00
39#define BLE_SVC_ANS_CAT_BM_SIMPLE_ALERT 0x01
40#define BLE_SVC_ANS_CAT_BM_EMAIL 0x02
41#define BLE_SVC_ANS_CAT_BM_NEWS 0x04
42#define BLE_SVC_ANS_CAT_BM_CALL 0x08
43#define BLE_SVC_ANS_CAT_BM_MISSED_CALL 0x10
44#define BLE_SVC_ANS_CAT_BM_SMS 0x20
45#define BLE_SVC_ANS_CAT_BM_VOICE_MAIL 0x40
46#define BLE_SVC_ANS_CAT_BM_SCHEDULE 0x80
47
48/* Alert Notification Service Category IDs
49 *
50 * TODO: Add remaining 2 optional categories */
51#define BLE_SVC_ANS_CAT_ID_SIMPLE_ALERT 0
52#define BLE_SVC_ANS_CAT_ID_EMAIL 1
53#define BLE_SVC_ANS_CAT_ID_NEWS 2
54#define BLE_SVC_ANS_CAT_ID_CALL 3
55#define BLE_SVC_ANS_CAT_ID_MISSED_CALL 4
56#define BLE_SVC_ANS_CAT_ID_SMS 5
57#define BLE_SVC_ANS_CAT_ID_VOICE_MAIL 6
58#define BLE_SVC_ANS_CAT_ID_SCHEDULE 7
59
60/* Number of valid ANS categories
61 *
62 * TODO: Add remaining 2 optional categories */
63#define BLE_SVC_ANS_CAT_NUM 8
64
65/* Alert Notification Control Point Command IDs */
66#define BLE_SVC_ANS_CMD_EN_NEW_ALERT_CAT 0
67#define BLE_SVC_ANS_CMD_EN_UNR_ALERT_CAT 1
68#define BLE_SVC_ANS_CMD_DIS_NEW_ALERT_CAT 2
69#define BLE_SVC_ANS_CMD_DIS_UNR_ALERT_CAT 3
70#define BLE_SVC_ANS_CMD_NOT_NEW_ALERT_IMMEDIATE 4
71#define BLE_SVC_ANS_CMD_NOT_UNR_ALERT_IMMEDIATE 5
72
73/* Error Definitions */
74#define BLE_SVC_ANS_ERR_CMD_NOT_SUPPORTED 0xA0
75
76void ble_svc_ans_on_gap_connect(uint16_t conn_handle);
77
78int ble_svc_ans_new_alert_add(uint8_t cat_id,
79 const char * info_str);
80int ble_svc_ans_unr_alert_add(uint8_t cat_id);
81
82void ble_svc_ans_init(void);
83
84#endif
85
Bluetooth Host main configuration structure.
Definition ble_hs.h:193