1
6
7
8
9
10
11
12
13
19
20
21
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
74
75
76
81
82
83
87
88
92
93
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/* ... */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef enum {
EventIDNotificationAdded = 0,
EventIDNotificationModified = 1,
EventIDNotificationRemoved = 2,
}{ ... } esp_EventID;
typedef enum {
EventFlagSilent = (1 << 0),
EventFlagImportant = (1 << 1),
EventFlagPreExisting = (1 << 2),
EventFlagPositiveAction = (1 << 3),
EventFlagNegativeAction = (1 << 4),
}{ ... }esp_EventFlags;
typedef enum {
CategoryIDOther = 0,
CategoryIDIncomingCall = 1,
CategoryIDMissedCall = 2,
CategoryIDVoicemail = 3,
CategoryIDSocial = 4,
CategoryIDSchedule = 5,
CategoryIDEmail = 6,
CategoryIDNews = 7,
CategoryIDHealthAndFitness = 8,
CategoryIDBusinessAndFinance = 9,
CategoryIDLocation = 10,
CategoryIDEntertainment = 11,
}{ ... } esp_CategoryID;
typedef enum {
CommandIDGetNotificationAttributes = 0,
CommandIDGetAppAttributes = 1,
CommandIDPerformNotificationAction = 2,
}{ ... } esp_CommandID;
typedef enum {
NotificationAttributeIDAppIdentifier = 0,
NotificationAttributeIDTitle = 1,
NotificationAttributeIDSubtitle = 2,
NotificationAttributeIDMessage = 3,
NotificationAttributeIDMessageSize = 4,
NotificationAttributeIDDate = 5,
NotificationAttributeIDPositiveActionLabel = 6,
NotificationAttributeIDNegativeActionLabel = 7,
}{ ... } esp_NotificationAttributeID;
/* ... */
typedef enum {
ActionIDPositive = 0,
ActionIDNegative = 1,
}{ ... } esp_ActionID;
typedef enum {
AppAttributeIDDisplayName = 0,
}{ ... } esp_AppAttributeID;
typedef struct {
uint8_t noti_attribute_id;
uint16_t attribute_len;
}{ ... } esp_noti_attr_list_t;
typedef enum {
Unknown_command = (0xA0),
Invalid_command = (0xA1),
Invalid_parameter = (0xA2),
Action_failed = (0xA3),
}{ ... } esp_error_code;
typedef enum {
attr_appidentifier_index = 0,
attr_title_index,
attr_subtitle_index,
attr_message_index,
attr_messagesize_index,
attr_date_index,
attr_positiveactionlabel_index,
attr_negativeactionlabel_index,
}{ ... } esp_attr_index;
#define ESP_NOTIFICATIONUID_LEN 4
char *EventID_to_String(uint8_t EventID);
char *CategoryID_to_String(uint8_t CategoryID);
void esp_receive_apple_notification_source(uint8_t *message, uint16_t message_len);
void esp_receive_apple_data_source(uint8_t *message, uint16_t message_len);
char *Errcode_to_String(uint16_t status);