-
Notifications
You must be signed in to change notification settings - Fork 2
/
sink_gatt_client_ancs.h
110 lines (83 loc) · 2.7 KB
/
sink_gatt_client_ancs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/****************************************************************************
Copyright (C) Cambridge Silicon Radio Ltd. 2015
FILE NAME
sink_gatt_client_ancs.h
DESCRIPTION
Routines to handle the GATT ANCS Client.
*/
#ifndef _SINK_GATT_CLIENT_ANCS_H_
#define _SINK_GATT_CLIENT_ANCS_H_
#ifndef GATT_ENABLED
#undef GATT_ANCS_CLIENT
#endif
#include <csrtypes.h>
#include <message.h>
#include <gatt_apple_notification_client.h>
/*!
* Macro to check the UUID of ANCS
*/
#ifdef GATT_ANCS_CLIENT
#define CHECK_ANCS_SERVICE_UUID(uuid) (uuid[0] == 0x7905f431) && \
(uuid[1] == 0xb5ce4e99) && \
(uuid[2] == 0xa40f4b1e) && \
(uuid[3] == 0x122d00d0)
#else
#define CHECK_ANCS_SERVICE_UUID(uuid) (FALSE)
#endif
/****************************************************************************
NAME
sinkGattAncsClientSetupAdvertisingFilter
DESCRIPTION
Adds ANCS service to the advertising filter
*/
#ifdef GATT_ANCS_CLIENT
void sinkGattAncsClientSetupAdvertisingFilter(void);
#else
#define sinkGattAncsClientSetupAdvertisingFilter() ((void)(0))
#endif
/****************************************************************************
NAME
sinkGattAncsClientAddService
DESCRIPTION
Adds Apple Notification Center Service to list of client connection service.
PARAMETERS
cid The connection ID
start The start handle of the ANCS service
end The end handle of the ANCS service
RETURNS
TRUE if the ANCS service was successfully added, FALSE otherwise.
*/
#ifdef GATT_ANCS_CLIENT
bool sinkGattAncsClientAddService(uint16 cid, uint16 start, uint16 end);
#else
#define sinkGattAncsClientAddService(cid, start, end) (FALSE)
#endif
/****************************************************************************
NAME
sinkGattAncsClientRemoveService
DESCRIPTION
Removes the ANCS service associated with the connection ID.
PARAMETERS
gancs The ANCS client pointer
*/
#ifdef GATT_ANCS_CLIENT
void sinkGattAncsClientRemoveService(GANCS *gancs);
#else
#define sinkGattAncsClientRemoveService(gancs) ((void)(0))
#endif
/*******************************************************************************
NAME
sinkGattAncsClientMsgHandler
DESCRIPTION
Handle messages from the GATT Client Task library
PARAMETERS
task The task the message is delivered
id The ID for the GATT message
payload The message payload
*/
#ifdef GATT_ANCS_CLIENT
void sinkGattAncsClientMsgHandler(Task task, MessageId id, Message message);
#else
#define sinkGattAncsClientMsgHandler(task, id, message) ((void)(0))
#endif
#endif /* _SINK_GATT_CLIENT_ANCS_H_ */