SmartSnippets DA1459x SDK
ble_mgr_gattc.h
Go to the documentation of this file.
1 
41 #ifndef BLE_MGR_GATTC_H_
42 #define BLE_MGR_GATTC_H_
43 
44 #include <stdint.h>
45 #include "osal.h"
46 #include "ble_mgr_cmd.h"
47 #include "ble_att.h"
48 #include "ble_gatt.h"
49 #include "ble_gattc.h"
50 
51 enum ble_cmd_gattc_opcode {
52  BLE_MGR_GATTC_BROWSE_CMD = BLE_MGR_CMD_CAT_FIRST(BLE_MGR_GATTC_CMD_CAT),
53  BLE_MGR_GATTC_BROWSE_RANGE_CMD,
54  BLE_MGR_GATTC_DISCOVER_SVC_CMD,
55  BLE_MGR_GATTC_DISCOVER_INCLUDE_CMD,
56  BLE_MGR_GATTC_DISCOVER_CHAR_CMD,
57  BLE_MGR_GATTC_DISCOVER_DESC_CMD,
58  BLE_MGR_GATTC_READ_CMD,
59  BLE_MGR_GATTC_WRITE_GENERIC_CMD,
60  BLE_MGR_GATTC_WRITE_EXECUTE_CMD,
61  BLE_MGR_GATTC_EXCHANGE_MTU_CMD,
62  /* Dummy command opcode, needs to be always defined after all commands */
63  BLE_MGR_GATTC_LAST_CMD,
64 };
65 
66 typedef struct {
68  uint16_t conn_idx;
69  const att_uuid_t *uuid;
70 } ble_mgr_gattc_browse_cmd_t;
71 
72 typedef struct {
74  ble_error_t status;
75 } ble_mgr_gattc_browse_rsp_t;
76 
77 void ble_mgr_gattc_browse_cmd_handler(void *param);
78 
79 typedef struct {
81  uint16_t conn_idx;
82  const att_uuid_t *uuid;
83  uint16_t start_h;
84  uint16_t end_h;
85 } ble_mgr_gattc_browse_range_cmd_t;
86 
87 typedef struct {
89  ble_error_t status;
90 } ble_mgr_gattc_browse_range_rsp_t;
91 
92 void ble_mgr_gattc_browse_range_cmd_handler(void *param);
93 
94 typedef struct {
96  uint16_t conn_idx;
97  const att_uuid_t *uuid;
98 } ble_mgr_gattc_discover_svc_cmd_t;
99 
100 typedef struct {
101  ble_mgr_msg_hdr_t hdr;
102  ble_error_t status;
103 } ble_mgr_gattc_discover_svc_rsp_t;
104 
105 void ble_mgr_gattc_discover_svc_cmd_handler(void *param);
106 
107 typedef struct {
108  ble_mgr_msg_hdr_t hdr;
109  uint16_t conn_idx;
110  uint16_t start_h;
111  uint16_t end_h;
112 } ble_mgr_gattc_discover_include_cmd_t;
113 
114 typedef struct {
115  ble_mgr_msg_hdr_t hdr;
116  ble_error_t status;
117 } ble_mgr_gattc_discover_include_rsp_t;
118 
119 void ble_mgr_gattc_discover_include_cmd_handler(void *param);
120 
121 typedef struct {
122  ble_mgr_msg_hdr_t hdr;
123  uint16_t conn_idx;
124  uint16_t start_h;
125  uint16_t end_h;
126  const att_uuid_t *uuid;
127 } ble_mgr_gattc_discover_char_cmd_t;
128 
129 typedef struct {
130  ble_mgr_msg_hdr_t hdr;
131  ble_error_t status;
132 } ble_mgr_gattc_discover_char_rsp_t;
133 
134 void ble_mgr_gattc_discover_char_cmd_handler(void *param);
135 
136 typedef struct {
137  ble_mgr_msg_hdr_t hdr;
138  uint16_t conn_idx;
139  uint16_t start_h;
140  uint16_t end_h;
141 } ble_mgr_gattc_discover_desc_cmd_t;
142 
143 typedef struct {
144  ble_mgr_msg_hdr_t hdr;
145  ble_error_t status;
146 } ble_mgr_gattc_discover_desc_rsp_t;
147 
148 void ble_mgr_gattc_discover_desc_cmd_handler(void *param);
149 
150 typedef struct {
151  ble_mgr_msg_hdr_t hdr;
152  uint16_t conn_idx;
153  uint16_t handle;
154  uint16_t offset;
155 } ble_mgr_gattc_read_cmd_t;
156 
157 typedef struct {
158  ble_mgr_msg_hdr_t hdr;
159  ble_error_t status;
160 } ble_mgr_gattc_read_rsp_t;
161 
162 void ble_mgr_gattc_read_cmd_handler(void *param);
163 
164 typedef struct {
165  ble_mgr_msg_hdr_t hdr;
166  uint16_t conn_idx;
167  uint16_t handle;
168  bool no_response:1;
169  bool signed_write:1;
170  bool prepare:1;
171  uint16_t offset;
172  uint16_t length;
173  const uint8_t *value;
174 } ble_mgr_gattc_write_generic_cmd_t;
175 
176 typedef struct {
177  ble_mgr_msg_hdr_t hdr;
178  ble_error_t status;
179 } ble_mgr_gattc_write_generic_rsp_t;
180 
181 void ble_mgr_gattc_write_generic_cmd_handler(void *param);
182 
183 typedef struct {
184  ble_mgr_msg_hdr_t hdr;
185  uint16_t conn_idx;
186  bool commit;
187 } ble_mgr_gattc_write_execute_cmd_t;
188 
189 typedef struct {
190  ble_mgr_msg_hdr_t hdr;
191  ble_error_t status;
192 } ble_mgr_gattc_write_execute_rsp_t;
193 
194 void ble_mgr_gattc_write_execute_cmd_handler(void *param);
195 
196 typedef struct {
197  ble_mgr_msg_hdr_t hdr;
198  uint16_t conn_idx;
199 } ble_mgr_gattc_exchange_mtu_cmd_t;
200 
201 typedef struct {
202  ble_mgr_msg_hdr_t hdr;
203  ble_error_t status;
204 } ble_mgr_gattc_exchange_mtu_rsp_t;
205 
206 void ble_mgr_gattc_exchange_mtu_cmd_handler(void *param);
207 
212 
213 void ble_mgr_gattc_sdp_svc_ind_evt_handler(ble_gtl_msg_t *gtl);
214 
215 void ble_mgr_gattc_cmp__browse_evt_handler(ble_gtl_msg_t *gtl);
216 
217 void ble_mgr_gattc_disc_svc_ind_evt_handler(ble_gtl_msg_t *gtl);
218 
219 void ble_mgr_gattc_disc_svc_incl_ind_evt_handler(ble_gtl_msg_t *gtl);
220 
221 void ble_mgr_gattc_disc_char_ind_evt_handler(ble_gtl_msg_t *gtl);
222 
223 void ble_mgr_gattc_disc_char_desc_ind_evt_handler(ble_gtl_msg_t *gtl);
224 
225 void ble_mgr_gattc_cmp__discovery_evt_handler(ble_gtl_msg_t *gtl);
226 
227 void ble_mgr_gattc_read_ind_evt_handler(ble_gtl_msg_t *gtl);
228 
229 void ble_mgr_gattc_cmp__read_evt_handler(ble_gtl_msg_t *gtl);
230 
231 void ble_mgr_gattc_cmp__write_evt_handler(ble_gtl_msg_t *gtl);
232 
233 void ble_mgr_gattc_event_ind_evt_handler(ble_gtl_msg_t *gtl);
234 
235 void ble_mgr_gattc_event_req_ind_evt_handler(ble_gtl_msg_t *gtl);
236 
237 void ble_mgr_gattc_svc_changed_cfg_ind_evt_handler(ble_gtl_msg_t *gtl);
238 
239 #endif /* BLE_MGR_GATTC_H_ */
240 
ble_mgr_cmd.h
BLE manager command definitions.
ble_gatt.h
Common definitions for GATT API.
ble_mgr_msg_hdr_t
Definition: ble_mgr_cmd.h:54
osal.h
OS abstraction layer API.
ble_mgr_gattc_mtu_changed_ind_evt_handler
void ble_mgr_gattc_mtu_changed_ind_evt_handler(ble_gtl_msg_t *gtl)
ble_gtl_msg
Definition: ad_ble.h:212
ble_att.h
Attribute protocol API.
ble_error_t
ble_error_t
Definition: ble_common.h:53
ble_gattc.h
BLE GATT Client API.